public override bool ConsumeJumpBoots(StateArgs args) { var pargs = args as PlanetsStateArgs; var useContext = new UseContext() { m_DeltaTime = Time.fixedDeltaTime, m_Inventory = pargs.m_PlanetsCharacter.InventoryEquipment, m_Inventories = new Inventory[] { pargs.m_PlanetsCharacter.Inventory, pargs.m_PlanetsCharacter.InventoryEquipment } }; for (int i = 0; i < pargs.m_PlanetsCharacter.InventoryEquipment.Count; i++) { useContext.m_Entry = pargs.m_PlanetsCharacter.InventoryEquipment.GetSlot(i); if (useContext.m_Entry == null) { continue; } useContext.m_InventorySlot = i; var slotEntry = pargs.m_PlanetsCharacter.InventoryEquipment.GetEntryInSlot(i); if (slotEntry.m_Item.JumpBoost(useContext)) { EasySound.Play("thrust", args.m_GameObject); return(true); } } return(false); }
public void Chop(float damage, Vector3 chopPlace_ws) { EasySound.Play("woodchop", gameObject); m_ChopsLeft -= damage; if (m_ChopsLeft <= 0.0f) { FellTree(chopPlace_ws); } }