void Start() { head = this.gameObject.GetComponentInChildren <StereoController>().Head; //onDoubleTap.AddListener (doubleClickThisFrame ); rgdBody = this.GetComponent <Rigidbody> (); head.transform.forward = this.transform.forward; }
void Start() { rb = GetComponent <Rigidbody>(); Debug.Log("Setting color " + chosenColor); foreach (Material mat in gameObject.GetComponent <MeshRenderer>().materials) { mat.color = chosenColor; } if (!isLocalPlayer) { return; } //transform.position = Camera.main.transform.position; //offset = Camera.main.transform.position - transform.position; head = (GvrHead)FindObjectOfType(typeof(GvrHead)); head.transform.position = transform.position + offset; GvrViewer viewer = (GvrViewer)FindObjectOfType(typeof(GvrViewer)); viewer.Recenter(); //head.transform.rotation = Quaternion.LookRotation(Vector3.zero - head.transform.position); //Camera.main.transform.position = transform.position + offset; //Camera.main.transform.rotation = Quaternion.LookRotation(Vector3.zero - Camera.main.transform.position); }
public void Start() { cardboard = gameObject.GetComponent <CardboardControl>(); StereoController stereoController = Camera.main.GetComponent <StereoController>(); head = stereoController.Head; }
// Use this for initialization void Start() { GvrViewer.Instance.OnTrigger += PullTrigger; head = GameObject.FindObjectOfType <GvrHead> (); rb = GetComponent <Rigidbody> (); state = GameObject.FindObjectOfType <LevelState> (); }
// Update is called once per frame void Update() { try { GvrHead gvrhead = GetComponent <GvrHead>(); Destroy(gvrhead); GvrViewer gvrviewer = GameObject.Find("GvrViewerMain").GetComponent <GvrViewer>(); gvrviewer.VRModeEnabled = false; } catch (System.Exception ex) { } float x, y; x = Input.GetAxis("Vertical") * -2; y = Input.GetAxis("Horizontal") * 2; if (x == 0 && y == 0) { x = Input.GetAxis("Mouse Y") * -2; y = Input.GetAxis("Mouse X") * 2; if (x != 0 && y != 0) { Cursor.visible = false; } } else { Cursor.visible = true; } xrot += x; yrot += y; tf.rotation = Quaternion.Euler(xrot, yrot, 0); Debug.Log(x + " " + y + " " + yrot + " " + xrot); }
void Start() { head = GameObject.FindObjectOfType <GvrHead> (); gvrViewer = GameObject.FindObjectOfType <GvrViewer> (); inventory = GameObject.FindObjectOfType <Inventory>(); resourceMining = GameObject.FindObjectOfType <ResourceMining> (); inventory.reticleOnObject = false; }
public override void Start() { base.Start(); startForward = nowForward = Vector3.zero; player = GameKernel._instance.gameObject; cameras = player.GetComponentsInChildren <Camera>(); gvrViewer = player.GetComponent <GvrViewer>(); gvrHead = player.GetComponentInChildren <GvrHead>(); playerStates = states.other; gvrHead.trackRotation = false; }
void Start() { startingPosition = transform.localPosition; inventory = GameObject.FindObjectOfType <Inventory>(); player = FindObjectOfType <GvrHead>(); glow = GetComponent <Glow> (); displayCanvas = FindObjectOfType <DisplayCanvas> (); if (glow == null) { glow = GetComponentInChildren <Glow> (); } }
void Start() { startingPosition = transform.localPosition; inventory = GameObject.FindObjectOfType <Inventory>(); player = FindObjectOfType <GvrHead>(); healthManagement = FindObjectOfType <HealthManagement> (); glow = GetComponent <Glow> (); if (glow == null) { glow = GetComponentInChildren <Glow> (); } }
// Update is called once per frame void Update() { if (!gameState) { SceneManager.LoadScene(0); //Catches Null Exception of game state and just loads the beginning scene again. } FrogHead = FindObjectOfType <GvrHead>(); //Allow the player to start jumping if the game is being played (After the player presses the "Escape" button) if (!gameState.IsIdle && !gameState.IsGameOver) { allowJump = true; } else { allowJump = false; } }
private void Awake() { if (mInstant != null) { DestroyImmediate(this); } mInstant = this; LogTool.Log("开始查找Env 和 UI"); //CinemaUI = GameObject.FindGameObjectWithTag("CinemaUI"); GvrHead = Camera.main.gameObject.GetComponent <GvrHead>(); IsPointerEnterVideoPlayerUI = false; IsPlayEndWhenKTTVModel = false; IsInFocus = false; IsInLockAngle = false; IsFirstInLockAngle = false; }
public override void StartController(InstantVR ivr) { base.StartController(ivr); #if UNITY_ANDROID if (extension == null) { extension = ivr.GetComponent <IVR_Cardboard>(); } Camera camera = CheckCamera(); if (camera != null) { cameraTransform = camera.transform; neck2eyes = HeadUtils.GetNeckEyeDelta(ivr); cameraTransform.gameObject.SetActive(false); GvrViewer cardboardPrefab = Resources.Load <GvrViewer>("CardboardPrefab"); cardboard = Instantiate(cardboardPrefab); if (cardboard == null) { Debug.LogError("Could not instantiate Cardboard. CardboardCameraRig is missing?"); } else { cameraRoot = cardboard.gameObject; cameraRoot.transform.parent = ivr.transform; cameraRoot.transform.position = transform.position; cameraRoot.transform.rotation = ivr.transform.rotation; GvrHead gvrHead = cardboard.GetComponentInChildren <GvrHead>(); if (gvrHead != null) { camera = Camera.main; cameraTransform = Camera.main.transform; } } } controller = Controllers.GetController(0); #if INSTANTVR_ADVANCED vicoVRHead = GetComponent <IVR_VicoVRHead>(); #endif #endif }
void Start() { gvrMain = FindObjectOfType<GvrViewer>(); gvrHead = FindObjectOfType<GvrHead>(); }
void Awake() { _instance = this; player = GameObject.FindGameObjectsWithTag(Constants.goPlayer) [0] as GameObject; head = Camera.main.GetComponent <StereoController>().Head; }
void Start() { head = Camera.main.GetComponent <StereoController>().Head; }
void Start() { head = GetComponentInChildren <StereoController>().Head; // head = ; }
/// Clear the cached array of GvrEye children, as well as the GvrHead that controls /// their gaze. /// @note Be sure to call this if you programmatically change the set of GvrEye children /// managed by this StereoController. public void InvalidateEyes() { #if !UNITY_EDITOR eyes = null; head = null; #endif }
// Update is called once per frame void Update() { FrogHead = FindObjectOfType <GvrHead>(); }
static void BuildGearVRSettings() { PlayerSettings.virtualRealitySupported = true; GvrViewer cardboard = (GvrViewer)GameObject.FindGameObjectWithTag("Player").GetComponent <GvrViewer>(); GvrHead carboardHead = cardboard.gameObject.transform.GetChild(0).GetComponent <GvrHead>(); }