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 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; } }