// Use this for initialization public void Setup(LevelManager _lev) { levMan = _lev; NotifPop = FETool.findWithinChildren(gameObject ,"Ingame/Panels/NotifObj").GetComponent<PopUp>(); NotifPop.Setup(); NotifPop.Fade(); HandClock = FETool.findWithinChildren(gameObject, "Ingame/Panels/Clock/Aiguille").GetComponentInChildren<OTSprite>(); FoodState = FETool.findWithinChildren(gameObject, "Ingame/Panels/PanFood/Bar").GetComponentInChildren<OTSprite>(); SleepState = FETool.findWithinChildren(gameObject, "Ingame/Panels/PanSleep/Bar").GetComponentInChildren<OTSprite>(); Controls = FETool.findWithinChildren(gameObject, "Ingame/Controls").GetComponentInChildren<OTSprite>(); dialogPop = FETool.findWithinChildren(gameObject, "Ingame/Dialog").GetComponent<PopUp>(); WillBack = FETool.findWithinChildren(gameObject, "Ingame/Dialog/WillBeBack").GetComponentInChildren<OTSprite>(); WillBackTxt = FETool.findWithinChildren(gameObject, "Ingame/Dialog/WillBeBack").GetComponentInChildren<TextUI>(); OtherText = FETool.findWithinChildren(gameObject, "Ingame/Dialog/OtherText").GetComponentInChildren<TextUI>(); dialogPop.Setup(); VictoryGO = FETool.findWithinChildren(gameObject, "Ingame/Victory"); DeathGO = FETool.findWithinChildren(gameObject, "Ingame/Death"); StartGO = FETool.findWithinChildren(gameObject, "Ingame/Start"); TitleGO = FETool.findWithinChildren(gameObject, "Ingame/Title"); StartCoroutine("fadeControls"); // dialogPop.Fade(); Paper = FETool.findWithinChildren(gameObject, "Ingame/Paper/SeekPaper").GetComponentInChildren<OTSprite>(); paperText = FETool.findWithinChildren(gameObject, "Ingame/Paper/State").GetComponentInChildren<TextUI>(); Clock = FETool.findWithinChildren(gameObject, "Ingame/Panels/Clock/Hours").GetComponent<TextUI>(); DarkBG = FETool.findWithinChildren(gameObject, "Ingame/Black").GetComponentInChildren<OTSprite>(); UIBtn[] listBtn = GetComponentsInChildren<UIBtn>(); foreach ( UIBtn btn in listBtn) { btn.Setup(this); } GameEventManager.GameOver += GameOver; GameEventManager.Respawn += Respawn; GameEventManager.GameStart += GameStart; GameEventManager.EndGame += EndGame; }