public void GotAItem(ICommonItem commonItem) { //commonItem.GotItem(); int itemNum = commonItem.GotItem(); print("itemNum : " + itemNum.ToString() + " In GameManager"); }
//Observer public void OnTriggerEnter(Collider other) { if (other.tag == "ITEMA") { print("col ITEMA"); ICommonItem aItem = other.gameObject.GetComponent <ICommonItem>(); //gameManager.GotAItem(aItem); onNotifyGotItemE(aItem.GotItem()); } }