当前位置: 首页>>代码示例>>C#>>正文


C# CardboardHead类代码示例

本文整理汇总了C#中CardboardHead的典型用法代码示例。如果您正苦于以下问题:C# CardboardHead类的具体用法?C# CardboardHead怎么用?C# CardboardHead使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CardboardHead类属于命名空间,在下文中一共展示了CardboardHead类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

	// Use this for initialization
	void Start () {
		ConsoleLog.SLog ("PlayerGameManager Start()");

		anim = GetComponent<Animator> ();
		cardboardCamera = GameObject.FindGameObjectWithTag("PlayerHead");
		cardboardHead = cardboardCamera.GetComponent<CardboardHead> ();
		headPos = GameObject.FindGameObjectWithTag ("CameraPos").transform;
		gun = GameObject.FindGameObjectWithTag ("MyGun");
		gunProperties = gun.GetComponent<GunProperties> ();
		gunAudio = gun.GetComponents<AudioSource> ();
		gunLight = GameObject.FindGameObjectWithTag ("GunLight");
		gunFlashEmitter = GameObject.FindGameObjectWithTag ("GunFlash").GetComponent<EllipsoidParticleEmitter>();
		gunFlashEmitter.emit = false;
		footstepsAudio = GetComponent<AudioSource> ();
		bulletHoleArray = new ArrayList (bulletHoleMaxAmount);

		//HUD
		HUD = GameObject.FindGameObjectWithTag("HUD");
		healthBar = HUD.transform.GetChild (0) as Transform;
		bulletText = HUD.transform.GetChild (1).GetComponent<TextMesh>();
		reloadText = HUD.transform.GetChild (2).GetComponent<TextMesh>();
		grenadeText = HUD.transform.GetChild (3).GetComponent<TextMesh>();
		HUDCanvas = HUD.transform.GetChild (4).gameObject;
		deadText = HUDCanvas.transform.GetChild (0).gameObject;
		endRoundText = HUDCanvas.transform.GetChild (1).gameObject;
		endGameText = HUDCanvas.transform.GetChild (2).gameObject;

		bulletText.text = gunProperties.bulletLoadCurrent + "/" + gunProperties.bulletStoreCurrent;
		grenadeText.text = grenadeStore + "";
	}
开发者ID:Xenocide93,项目名称:MultiplayerFPSCardboardGame,代码行数:31,代码来源:PlayerGameManager.cs

示例2: Start

 // Use this for initialization
 void Start()
 {
     Cardboard.SDK.OnTrigger += PullTrigger;
     head = GameObject.FindObjectOfType<CardboardHead>();
     rb = GetComponent<Rigidbody>();
     state = GameObject.FindObjectOfType<LevelState>();
 }
开发者ID:VirtualRealityDesigner,项目名称:Squashy-Toad-VR,代码行数:8,代码来源:Player.cs

示例3: Awake

	void Awake(){
		ConsoleLog.SLog ("ControlScript Awake()");
		ConsoleLog.SLog ("CharacterType = " + characterType);

		cardboardMain = GameObject.FindGameObjectWithTag ("CardboardMain");
		cardboardCamera = GameObject.FindGameObjectWithTag("PlayerHead");
		characterHead = GameObject.FindGameObjectWithTag ("CharacterHead");
		cardboardHead = cardboardCamera.GetComponent<CardboardHead> ();
		if (!cardboardHead.isCharacterSync) { cardboardHead.ReSyncCharacter (); }
		cameraPos = GameObject.FindGameObjectWithTag ("CameraPos").transform;
		gazePointer = GameObject.FindGameObjectWithTag ("GazePointer");
	}
开发者ID:Xenocide93,项目名称:MultiplayerFPSCardboardGame,代码行数:12,代码来源:UnityChanControlScriptWithRgidBody.cs

示例4: Start

    private GameObject playerBody = null; // 'Cos' del jugador
    
    void Start(){
        Debug.Log ("Start() PlayerController");

        GameObject gameControllerObject = GameObject.FindWithTag ("GameController");
        if (gameControllerObject != null)
        {
            gameController = gameControllerObject.GetComponent <GameController>();
        }
        if (gameController == null)
        {
            Debug.Log ("No s'ha trobat el script GameController");
        }

        
        playerBody = this.gameObject;
        // CardBoard ?
        if (Camera.main.GetComponent<StereoController>().Head == null){
            // Sense CardBoard
            vr = false;
        } else {
            // amb CardBoard
            vr = true;
            head = Camera.main.GetComponent<StereoController>().Head;
            playerBody.GetComponent<Renderer>().enabled = false;
        }

        jumping = false;
        crouching = false;
    }
开发者ID:sesiomterim,项目名称:Unity,代码行数:31,代码来源:PlayerController.cs

示例5: Start

 void Start()
 {
     head = Camera.main.GetComponent<StereoController>().Head;
     overlay = overlayObject.GetComponent<Overlay>();
     progressBar = transform.parent.FindChild("Bar Progress Pivot").gameObject;
     text = transform.parent.FindChild("Text").GetComponent<TextMesh>();
 }
开发者ID:WouterFlorijn,项目名称:MuseumApp,代码行数:7,代码来源:ResetButton.cs

示例6: Start

	void Start () 
	{
		head = Camera.main.GetComponent<StereoController>().Head;
	
		//playerObject = GameObject.FindWithTag ("Player");

	}
开发者ID:kzenstratus,项目名称:VRDisco,代码行数:7,代码来源:Autowalk.cs

示例7: Start

 void Start()
 {
     head = Camera.main.GetComponent<StereoController>().Head;
     startingPosition = transform.localPosition;
     CardboardGUI.IsGUIVisible = false;
     color = new Color (1, 1, 1, 1);
 }
开发者ID:enakrdzalic,项目名称:VR-Wire-Loop,代码行数:7,代码来源:NormalMenuController.cs

示例8: Start

 void Start()
 {
     head = Camera.main.GetComponent<StereoController>().Head;
     startingPosition = transform.localPosition;
     //    CardboardGUI.IsGUIVisible = true;
     //    CardboardGUI.onGUICallback += this.OnGUI;
 }
开发者ID:lykfe,项目名称:FlyingBearAdventure,代码行数:7,代码来源:Teleport.cs

示例9: Start

 // Use this for initialization
 void Start()
 {
     head = Camera.main.GetComponent<StereoController>().Head;
     //initialOffset = head.transform.eulerAngles;
     initialObjPositionZ = transform.eulerAngles.z;
     //print("Wing: " + initialOffset.x + " " + initialOffset.y + " " + initialOffset.z);
     initialOffset = new Vector3(0, 180, 0);
 }
开发者ID:jpecoraro342,项目名称:VR-Wright-Flyer,代码行数:9,代码来源:WingWarpController.cs

示例10: Start

    void Start()
    {
        //We get the head componant from google
        cardboardHead = Camera.main.GetComponent<StereoController>().Head;

        //We precvent devices such as the LG G2 from going to sleep
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
    }
开发者ID:linojon,项目名称:VirtualOldManB,代码行数:8,代码来源:ClickToWalk.cs

示例11: Start

 // Use this for initialization
 void Start()
 {
     //this sets the head variable to the Head component
     head = Camera.main.GetComponent<StereoController>().Head;
     //this gets the head component
     controller = GameObject.Find("PlayerCapsule");
     //this finds the script that contains the boolean checkAutoWalk
     autowalk = controller.GetComponent<CharacterMotor>();
 }
开发者ID:Christian-Spicer,项目名称:Maori_Nga_Atua,代码行数:10,代码来源:ResetRecenterScript.cs

示例12: Start

 void Start()
 {
     head = Camera.main.GetComponent<StereoController>().Head;
     if (Toolbox.Instance.mode == Constants.VR_MODE) {
         Cardboard.SDK.VRModeEnabled = true;
     } else {
         Cardboard.SDK.VRModeEnabled = false;
     }
 }
开发者ID:VictorCedeno,项目名称:VR-Tour,代码行数:9,代码来源:ChangeScene.cs

示例13: Start

 // Use this for initialization
 void Start()
 {
     cardboardHead = Camera.main.GetComponent<StereoController>().Head;
     gazeInput = GameObject.FindGameObjectWithTag ("EventSystem").GetComponent<GazeInputModule>();
     EventSystemManager = GameObject.FindGameObjectWithTag ("EventSystem").GetComponent<EventSystem> ();
     eventSystem = new PointerEventData (EventSystem.current);
     loader = GameObject.FindGameObjectWithTag ("Clicker");
     loadFill = loader.GetComponent<Image> ();
 }
开发者ID:linojon,项目名称:VirtualOldManB,代码行数:10,代码来源:NoTouchUI.cs

示例14: Start

 void Start()
 {
     head = Camera.main.GetComponent<StereoController>().Head;
     originalParent = pauseMenu.transform.parent;
     buttonText = transform.GetChild (1);
     buttonText.gameObject.SetActive (false);
     song = GameObject.FindWithTag("Song");
     metronome = FindObjectOfType<MetronomeScript>();
     ui = FindObjectOfType<UIScript>();
 }
开发者ID:adolfo1994,项目名称:V-Drums,代码行数:10,代码来源:MenuItemScript.cs

示例15: Load

 public virtual void Load()
 {
     head = Camera.main.GetComponent<StereoController>().Head;
     timer = 0;
     barBGMat = Resources.Load("Materials/BarBG") as Material;
     barSelectedMat = Resources.Load("Materials/BarSelected") as Material;
     barInactiveMat = Resources.Load("Materials/BarInactive") as Material;
     progressBar = transform.parent.FindChild("Bar Progress Pivot").gameObject;
     text = transform.parent.FindChild("Text").GetComponent<TextMesh>();
 }
开发者ID:WouterFlorijn,项目名称:MuseumApp,代码行数:10,代码来源:Button.cs


注:本文中的CardboardHead类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。