Beispiel #1
0
//	public LegMover legMover;


    // Update is called once per frame
    void Update()
    {
        if (!getRealUpdater)
        {
            getRealUpdater = getRealCamera.GetComponent <getRealCameraUpdater>();
        }

        if (CAVE2Manager.GetButtonDown(1, CAVE2Manager.Button.Button3))
        {
            bodyMover.SetTrigger();
            hipMover.SetTrigger();
            //hipScaler.ScaleUpperBody();
            bodyScaler.ScaleBody();
            if (ethanTutorial != null)
            {
                Destroy(ethanTutorial);
                CaveChefGameController.GetController().StartGame();
            }
            //legMover.SetTrigger();
        }
        if (CAVE2Manager.GetButtonDown(1, CAVE2Manager.Button.Button2))
        {
            SceneManager.LoadScene(0);
        }
    }
Beispiel #2
0
    void CreateCameras()
    {
        if (nodeID <= 18)
        {
            List <int> needCameras = new List <int>();
            for (int i = 1; i < getReal3D.Input.cameras.Count; ++i)
            {
                needCameras.Add(i);
            }

            // find cameras, see which we can remove from needCameras
            foreach (Camera cam in Camera.allCameras)
            {
                if (cam.GetComponent <getRealCameraUpdater>() != null && (cam.name == name || cam.name == name + "(Clone)"))
                {
                    int idx = cam.GetComponent <getRealCameraUpdater>().cameraIndex;
                    if (idx > 0)
                    {
                        needCameras.Remove(idx);
                    }
                }
            }

            // make missing cameras
            foreach (int idx in needCameras)
            {
                GameObject newCamObject = null;
                if (CameraPrefab == null)
                {
                    newCamObject = Instantiate(gameObject) as GameObject;
                }
                else
                {
                    newCamObject = Instantiate(CameraPrefab) as GameObject;
                }

                foreach (AudioListener listener in newCamObject.GetComponents <AudioListener>())
                {
                    Destroy(listener);
                }

                newCamObject.transform.parent = transform.parent;
                newCamObject.tag   = gameObject.tag;
                newCamObject.layer = gameObject.layer;

                getRealCameraUpdater camUpdater = newCamObject.GetComponent <getRealCameraUpdater>();
                if (camUpdater == null)
                {
                    camUpdater = newCamObject.AddComponent <getRealCameraUpdater>();
                }
                camUpdater.cameraIndex = idx;

                newCamObject.GetComponent <Camera>().CopyFrom(GetComponent <Camera>());
            }
        }
    }