Exemplo n.º 1
0
        void OnTriggerEnter(Collider collider)
        {
            ConductorStandHook conductorStandHook = collider.gameObject.GetComponent <ConductorStandHook>();

            if (!conductorStandHook)
            {
                return;
            }

            latestSnapStandHook = conductorStandHook;
            toSnap = true;
        }
Exemplo n.º 2
0
        void OnTriggerExit(Collider collider)
        {
            // check if it's a conductor
            ConductorStandHook conductorStandHook = collider.gameObject.GetComponent <ConductorStandHook>();

            if (!conductorStandHook)
            {
                return;
            }

            if (latestSnapStandHook.gameObject.name != collider.name)
            {
                return;
            }

            // reset
            toSnap = false;
        }
Exemplo n.º 3
0
        void Start()
        {
            conductorMF = GetComponent <ConductorMF>();

            isSnapped = false;
            toSnap    = false;

            grabbableHands = GetComponent <GrabbableHands>();
            rb             = GetComponent <Rigidbody>();

            // place at initial position if there's one referenced
            if (initialHook)
            {
                latestSnapStandHook = initialHook;
                toSnap = true;
            }

            audioSource = GetComponent <AudioSource>();
        }