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

            HeldBy.Hold(this);
        }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 3
0
        // --------------------------------------------------------------------------------------------
        protected virtual void OnBeginInteract(Interactable.InteractedEventInfo info)
        {
            if (inventory)
            {
                inventory.Remove(this, false);
            }

            inventory = info.instigator.Inventory;

            if (inventory)
            {
                inventory.Add(this);
            }
        }
Exemplo n.º 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();
        }
Exemplo n.º 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);
                    }
                });
            }
        }
Exemplo n.º 6
0
 // --------------------------------------------------------------------------------------------
 protected virtual void OnBeginInteract(Interactable.InteractedEventInfo info)
 {
     _isOpen = !_isOpen;
     SetLayer();
     _animator.SetBool("open", _isOpen);
 }
Exemplo n.º 7
0
 // --------------------------------------------------------------------------------------------
 protected void OnBeginInteract(Interactable.InteractedEventInfo info)
 {
     HUDManager.HUDDialog.SetMugshot(_spriteRender ? _spriteRender.sprite : null);
     HUDManager.HUDDialog.ShowDialog(dialog);
 }
Exemplo n.º 8
0
 // --------------------------------------------------------------------------------------------
 private void OnEndInteract(Interactable.InteractedEventInfo info)
 {
     HeldBy.Hold(null);
     HeldBy = null;
 }