void Start() { ui = GameObject.FindGameObjectsWithTag("UILink")[0].GetComponent <UILink>(); uiGame = new UIGame(); uiGame.Init(); oxygen = ui.oxygenImage; testlist = new List <int>(); currentOxygen = maxOxygen; }
void Awake() { if (instance != null) { GameObject.Destroy(gameObject); return; } SetupStates(); gameUI.Init(this); instance = this; }
public void Init() { if (!playerGao) { playerGao = Instantiate(playerPrefab); playerGao.transform.SetParent(GameObject.FindGameObjectWithTag("DontDestroyGo").transform); } if (!guiMgr) { guiMgr = Instantiate(guiMgrPrefab); guiMgr.transform.SetParent(GameObject.FindGameObjectWithTag("DontDestroyGo").transform); } player = playerGao.GetComponent <Player>(); uiGame = guiMgr.GetComponent <UIGame>(); uiGame.Init(player); uiGame.transform.GetChild(1).GetComponent <Compass>().Init(player); }
public void init() { uigame = new UIGame(); uigame.Init(); }