protected virtual void OnTriggerEnter(Collider other)
    {
        if (!_isActivated && other.CompareTag("Rock") && other.GetComponent <Interactable>().colour == colour)
        {
            _anim.SetBool("PlatformActivated", true);

            _audio.PlayDelayed(0);
            _isActivated = true;

            onActivation?.Invoke(true);
        }
    }
Ejemplo n.º 2
0
 public void Activate(GameObject sender)
 {
     this.Activated = true;
     if (OnActivation != null)
     {
         OnActivation.Invoke(this.gameObject);
     }
 }
Ejemplo n.º 3
0
 public void Activate(GameObject sender)
 {
     this.Activated = true;
     //Debug.Log(gameObject.name + " : Activated");
     if (OnActivation != null)
     {
         OnActivation.Invoke(this.gameObject);
     }
 }
Ejemplo n.º 4
0
 public void Activate(GameObject sender)
 {
     AnimCheck.SetTrigger("CheckpointEnable");
     this.Activated = true;
     if (OnActivation != null)
     {
         OnActivation.Invoke(this.gameObject);
     }
 }
Ejemplo n.º 5
0
    /// <summary>
    /// Start interaction with the lever
    /// </summary>
    /// <param name="target">Target that is trying to interact with the lever</param>
    public override void StartInteract(Transform target)
    {
        if (CanInteract(target))
        {
            _anim.enabled = true;
            _anim.Play("LeverAnimation");
            _anim.SetBool("LeverPulled", true);

            _audio.PlayDelayed(0);

            // Add lever colour to the code input
            //puzzle.AddColour(colour);
            onActivation?.Invoke(colour);
        }
    }
Ejemplo n.º 6
0
 public void TriggerEvent(GameObject activator)
 {
     OnActivation?.Invoke(activator);
 }
Ejemplo n.º 7
0
 public void Activate()
 {
     _onActivation?.Invoke();
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Defines what should happen when the player interacts with the object. It is also what happens when the object is remotely activated, i.e. via a player detector.
 /// </summary>
 public virtual void OnPlayerAction(Tile tile, Player player)
 {
     OnActivation?.Invoke(tile, player);
 }