You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Numerics;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using Vector3 = UnityEngine.Vector3;
|
|
|
|
|
|
|
|
|
|
public class HMDControl : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public GameObject head;
|
|
|
|
|
public GameObject handleft;
|
|
|
|
|
public GameObject handright;
|
|
|
|
|
private int speed=1;
|
|
|
|
|
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
|
|
|
|
head.transform.position +=new Vector3(0,1,0) * 2.8f;
|
|
|
|
|
handright.transform.position = new Vector3(-0.77f, 0.94f, 2.1f);
|
|
|
|
|
handleft.transform.position = new Vector3(-0.47f, 0.94f, 1.5f);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
|
|
|
|
// <20><>ȡˮƽ<CBAE>ʹ<EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD>
|
|
|
|
|
float h = Input.GetAxis("Horizontal");
|
|
|
|
|
float v = Input.GetAxis("Vertical");
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Vector3 movement = new Vector3(h, 0f, v);
|
|
|
|
|
head.transform.Translate(movement * speed * Time.deltaTime);
|
|
|
|
|
//handleft.transform.position = new Vector3(0.063f, 2.022f, 0.745f) ;
|
|
|
|
|
//handleft.transform.eulerAngles = new Vector3(-110, -80, -179);
|
|
|
|
|
}
|
|
|
|
|
}
|