public void PickItem(RoBootCondition item) { // Called when picking up item RoBootCondition temp = new RoBootCondition(); temp.Update(GameManager.instance.condition); temp.hand = item.hand == Hand.None ? temp.hand : item.hand; temp.body = item.body == Body.None ? temp.body : item.body; temp.leg = item.leg == Leg.None ? temp.leg : item.leg; UpdateRoBoot(temp); }
private void Update() { // Jump if (!m_Jump) { m_Jump = Input.GetButtonDown("Jump"); } // Pick Item if (Input.GetKeyDown(KeyCode.F) && m_TargetItem != null) { RoBootCondition temp = new RoBootCondition(); temp.Update(m_TargetItem.item); m_TargetItem.ExchangeItem(GameManager.instance.condition); m_RoBoot.PickItem(temp); } if (Input.GetKeyDown(KeyCode.F) && m_DoorTrigger != null && GameManager.instance.condition.hand == Hand.Plug) { m_DoorTrigger.isTriggered = true; } // Debug Code if (Input.GetKeyDown(KeyCode.Q)) { m_RoBoot.UpdateCollider(new RoBootCondition() { body = Body.None, leg = Leg.None }); } if (Input.GetKeyDown(KeyCode.W)) { m_RoBoot.UpdateCollider(new RoBootCondition() { body = Body.None, leg = Leg.Goal }); } if (Input.GetKeyDown(KeyCode.E)) { m_RoBoot.UpdateCollider(new RoBootCondition() { body = Body.Goal, leg = Leg.Goal }); } }