コード例 #1
0
    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);
        }
    }
コード例 #2
0
 public void Activate(GameObject sender)
 {
     this.Activated = true;
     if (OnActivation != null)
     {
         OnActivation.Invoke(this.gameObject);
     }
 }
コード例 #3
0
 public void Activate(GameObject sender)
 {
     this.Activated = true;
     //Debug.Log(gameObject.name + " : Activated");
     if (OnActivation != null)
     {
         OnActivation.Invoke(this.gameObject);
     }
 }
コード例 #4
0
ファイル: Fermeture.cs プロジェクト: mlhoutel/DashRaider
 public void Activate(GameObject sender)
 {
     AnimCheck.SetTrigger("CheckpointEnable");
     this.Activated = true;
     if (OnActivation != null)
     {
         OnActivation.Invoke(this.gameObject);
     }
 }
コード例 #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);
        }
    }
コード例 #6
0
 public void TriggerEvent(GameObject activator)
 {
     OnActivation?.Invoke(activator);
 }
コード例 #7
0
 public void Activate()
 {
     _onActivation?.Invoke();
 }
コード例 #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);
 }