Beispiel #1
0
        public void Update()
        {
            if (gazeIn)
            {
                // fade color towards selectColor until popTime has elapsed

                counter += Time.deltaTime;
                meshRenderer.material.color = Color.Lerp(initialColor, selectColor, counter / popTime);

                if (counter > popTime)
                {
                    // Start pickup script
                    //Debug.Log("Pickup");

                    //first disable rotate script
                    RotateMe         = FindObjectOfType <rotateMe>();
                    RotateMe.enabled = false;

                    //start and initialize pickup of cube
                    PickupMe         = FindObjectOfType <PickupMe>();
                    PickupMe.enabled = true;
                    PickupMe.grabbed = false;
                    PickupMe.PickupOrDrop();
                    Reset();
                }
            }
        }
Beispiel #2
0
        public void CheckMode()
        {
            //When the cube is clicked disable picking up of cube
            PickupMe         = FindObjectOfType <PickupMe>();
            PickupMe.enabled = false;

            //Start rotate script and initialize new values
            RotateMe         = FindObjectOfType <rotateMe>();
            RotateMe.enabled = true;
            RotateMe.Start();
            RotateMe.RotateOrDrop();
            RotateMe.Update();
        }