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); } }
public void Activate(GameObject sender) { this.Activated = true; if (OnActivation != null) { OnActivation.Invoke(this.gameObject); } }
public void Activate(GameObject sender) { this.Activated = true; //Debug.Log(gameObject.name + " : Activated"); if (OnActivation != null) { OnActivation.Invoke(this.gameObject); } }
public void Activate(GameObject sender) { AnimCheck.SetTrigger("CheckpointEnable"); this.Activated = true; if (OnActivation != null) { OnActivation.Invoke(this.gameObject); } }
/// <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); } }
public void TriggerEvent(GameObject activator) { OnActivation?.Invoke(activator); }
public void Activate() { _onActivation?.Invoke(); }
/// <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); }