Exemplo n.º 1
0
        void Update()
        {
            state = interactiveObject.State;

            if (state == BaseInteractiveObject.ObjectState.Selected)
            {
                isSelected = true;
            }
            else
            {
                rigidbodyCmp.position = initPosition;
                rigidbodyCmp.rotation = initRotation;
                isSelected            = false;
            }

            if (isSelected && state != stateLastFrame)
            {
                if (selectSound != null)
                {
                    selectSound.Play();
                }
            }

            stateLastFrame = interactiveObject.State;
        }
Exemplo n.º 2
0
        void Update()
        {
            state = door.State;

            if (state == BaseInteractiveObject.ObjectState.Selected)
            {
                isSelected = true;
            }
            else
            {
                isSelected = false;
            }

            if (isSelected && state != stateLastFrame)
            {
                if (selectSound != null)
                {
                    selectSound.Play();
                }
            }

            stateLastFrame = door.State;
        }
Exemplo n.º 3
0
        void Update()
        {
            state = moveablePhysicsObject.State;

            if (state == BaseInteractiveObject.ObjectState.Selected)
            {
                isSelected = true;
            }
            else
            {
                isSelected = false;
            }

            if (isSelected && state != stateLastFrame)
            {
                if (selectSound != null)
                {
                    selectSound.audioSource.Play();
                }
            }

            stateLastFrame = moveablePhysicsObject.State;
        }
Exemplo n.º 4
0
        void LateUpdate()
        {
            if (target == null || rendererCmp == null)
            {
                return;
            }

            BaseInteractiveObject.ObjectState state = target.State;

            if (state != lastState)
            {
                lastState = state;
                if (state == BaseInteractiveObject.ObjectState.Selected)
                {
                    block.SetColor(colorID, selectedColor);
                    rendererCmp.SetPropertyBlock(block);
                }
                else
                {
                    block.SetColor(colorID, defaultColor);
                    rendererCmp.SetPropertyBlock(block);
                }
            }
        }