// Use this for initialization void Start() { gameStartObj = GameObject.Find("GameStartObj"); if (gameStartObj != null) { if (gameStartObj.GetComponent<BattleGameStartScript>() != null) { battleGameStartScript = gameStartObj.GetComponent<BattleGameStartScript>(); } if (gameStartObj.GetComponent<NewGameStartScript>() != null) { gameStartScript = gameStartObj.GetComponent<NewGameStartScript>(); } } gameTopObj = GameObject.Find("GameTopManager"); if (gameTopObj != null) { gameTopScript = gameTopObj.GetComponent<GameTopScript>(); } }
// Use this for initialization void Start() { GameObject obj = GameObject.Find("GameTopManager"); gameTopScript = obj.GetComponent<GameTopScript>(); }