public void GetSoda() { if (CurrentCleanCupTray != null) { audio.PlayOneShot(Mug, 0.3f); Debug.Log("Did"); var cup = CurrentCleanCupTray.TakeCup(); this.Cup = cup; cup.transform.SetParent(this.Hand.transform); cup.transform.localPosition = Vector3.zero; cup.transform.localEulerAngles = Vector3.zero; CurrentCleanCupTray = null; Debug.Log("SettoNull"); } else if (CurrentSodaMachine != null) { TakeCup(CurrentSodaMachine.TakeCup()); CurrentSodaMachine = null; } else { print("else"); TakeCup(AccessingCounter.GetDirtyCup()); AccessingCounter = null; } }
public void GiveCup() { CurrentCleanCupTray = null; if (CurrentSodaMachine != null) { audio.PlayOneShot(Mug); CurrentSodaMachine.PutCups(Cup); this.Cup = null; } else if (AccessingCounter != null) { audio.PlayOneShot(Mug); AccessingCounter.PutCups(Cup); Cup = null; } else if (CurrentDirtyCupTray != null) { CurrentDirtyCupTray.PutCups(Cup); Cup = null; } }