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