Beispiel #1
0
        // --------------------------------------------------------------------------------------------
        private void OnBeginInteract(Interactable.InteractedEventInfo info)
        {
            if (HeldBy != null)
            {
                return;
            }

            HeldBy.Hold(this);
        }
Beispiel #2
0
 // --------------------------------------------------------------------------------------------
 protected override void OnBeginInteract(Interactable.InteractedEventInfo info)
 {
     if (key && info.instigator.Inventory)
     {
         if (!info.instigator.Inventory.ContainsItem(key))
         {
             HUDManager.HUDDialog.ShowDialog(_isOpen ? needKeyToCloseMessage : lockedMessage);
         }
         else
         {
             base.OnBeginInteract(info);
         }
     }
 }
Beispiel #3
0
        // --------------------------------------------------------------------------------------------
        protected virtual void OnBeginInteract(Interactable.InteractedEventInfo info)
        {
            if (inventory)
            {
                inventory.Remove(this, false);
            }

            inventory = info.instigator.Inventory;

            if (inventory)
            {
                inventory.Add(this);
            }
        }
Beispiel #4
0
        // --------------------------------------------------------------------------------------------
        private void OnOwnerInteracted(Interactable.InteractedEventInfo info)
        {
            if (_attackSequence != null)
            {
                return;
            }

            if (!owner.EquipedWeapon == this)
            {
                return;
            }

            Destructible destructible = info.interactedWith.GetComponent <Destructible>();

            if (!destructible)
            {
                return;
            }

            CurrentlyAttacking = destructible;

            _attackSequence = new TofuAnimation()
                              .Execute(() =>
            {
                PreAttackAnimation().Play();
            })
                              .Wait(_preAttackDelay)
                              .Then()
                              .Execute(() =>
            {
                DoAttack();
            })
                              .Then()
                              .Execute(() =>
            {
                PostAttackAnimation().Play();
            })
                              .Wait(_postAttackCooldown)
                              .Then()
                              .Execute(() =>
            {
                _attackSequence    = null;
                CurrentlyAttacking = null;
            })
                              .Play();
        }
Beispiel #5
0
        // --------------------------------------------------------------------------------------------
        protected override void OnBeginInteract(Interactable.InteractedEventInfo info)
        {
            if (inventory)
            {
                inventory.Remove(this, false);
            }

            inventory = info.instigator.Inventory;

            if (inventory)
            {
                inventory.Add(this, true, () =>
                {
                    if (!info.instigator.EquipedWeapon)
                    {
                        inventory.Remove(this, false);
                        info.instigator.EquipWeapon(this);
                    }
                });
            }
        }
Beispiel #6
0
 // --------------------------------------------------------------------------------------------
 protected virtual void OnBeginInteract(Interactable.InteractedEventInfo info)
 {
     _isOpen = !_isOpen;
     SetLayer();
     _animator.SetBool("open", _isOpen);
 }
Beispiel #7
0
 // --------------------------------------------------------------------------------------------
 protected void OnBeginInteract(Interactable.InteractedEventInfo info)
 {
     HUDManager.HUDDialog.SetMugshot(_spriteRender ? _spriteRender.sprite : null);
     HUDManager.HUDDialog.ShowDialog(dialog);
 }
Beispiel #8
0
 // --------------------------------------------------------------------------------------------
 private void OnEndInteract(Interactable.InteractedEventInfo info)
 {
     HeldBy.Hold(null);
     HeldBy = null;
 }