public override void InteractWithObject(CharacterInteractControl interactZone) { // If empty && player has valid object, take object if (mixObject1 == null && mixTimeRemaining <= 0 && interactZone.IsHoldingObject()) { interactZone.GiveAttachedObj(this); return; } if (mixObject1 != null && mixObject2 == null && mixTimeRemaining <= 0 && interactZone.IsHoldingObject()) { interactZone.GiveAttachedObj(this); return; } // If full and cooking completed, and player is empty, give result to player if (mixObject1 != null && mixTimeRemaining <= 0 && !interactZone.IsHoldingObject()) { interactZone.AttachCarryableObject(QueryMixedObject()); mixObject1 = null; mixObject2 = null; currentItem1.SetActive(false); PlaySoundFX(1); return; } }
public void OnTriggerExit2D(Collider2D collision) { CharacterInteractControl interactible = collision.GetComponent <CharacterInteractControl>(); if (interactible != null) { DoGlowPulse(false); } }
public void OnTriggerEnter2D(Collider2D collision) { CharacterInteractControl interactible = collision.GetComponent <CharacterInteractControl>(); if (interactible != null && !isAnimating) { DoGlowPulse(true); } }
public override void InteractWithObject(CharacterInteractControl obj) { if (cooldownCounter - Time.time > cooldownTime) { // TODO: Play rejected sound return; } obj.GiveAttachedObj(this); }
public override void InteractWithObject(CharacterInteractControl interactZone) { // If player is holding an object, return if (interactZone.IsHoldingObject()) { FloatingTextController.Instance.CreateFloatingPopupText("your hands are full", transform.position, default(Color), FloatingFadeMethod.Alpha); return; } // If cooldown is not ready, return if (cooldownCounter - Time.time > cooldownTime) { return; } interactZone.AttachCarryableObject(objGivenName); PlaySoundFX(); // Set my cooldown counter cooldownCounter = Time.time + cooldownTime; }
public override void InteractWithObject(CharacterInteractControl interactZone) { // If empty && player has valid object, take object and begin cooking it if (cookingObject == null && cookTimeRemaining <= 0 && interactZone.IsHoldingObject()) { interactZone.GiveAttachedObj(this); //PlaySoundFX(0); return; } // If full and cooking completed, and player is empty, give result to player if (cookingObject != null && cookTimeRemaining <= 0 && !interactZone.IsHoldingObject()) { interactZone.AttachCarryableObject(QueryCookedObject()); cookingObject = null; currentItem.SetActive(false); PlaySoundFX(1); return; } }
public virtual void InteractWithObject(CharacterInteractControl interactZone = null) { }