private void OnTriggerEnter2D(Collider2D collider)
    {
        plateColliders.Add(collider);

        // If first object enter plate
        if (plateColliders.Count == 1)
        {
            DigitalRuby.SoundManagerNamespace.SoundManager.PlayOneShotSound(GetComponent <AudioSource>(), PreasureSound);
            plateAnimator.SetBool("Pressed", true);
            stateBroadcaster.BroadcastState(true, 0.5f);

            SendMessage("FinalizeAll", SendMessageOptions.DontRequireReceiver);
        }
    }
Exemplo n.º 2
0
    void OnInteract()
    {
        state = !state;

        animator.speed = 1;
        animator.SetBool("State", state);
        stateBroadcaster.BroadcastState(state, delay);

        DigitalRuby.SoundManagerNamespace.SoundManager.PlayOneShotSound(GetComponent <AudioSource>(), LeverSound);
    }
Exemplo n.º 3
0
    void Start()
    {
        if (animator == null)
        {
            animator = GetComponent <Animator>();
        }

        stateBroadcaster = GetComponent <StateBroadcaster>();

        animator.SetBool("State", state);
        animator.speed = 100;
        stateBroadcaster.BroadcastState(state, delay);
    }