// Start is called before the first frame update void Start() { score = GetComponent <Score>(); gameManage = GetComponent <GameManage>(); statefulInspection = GetComponent <StatefulInspection>(); player = GameObject.FindGameObjectWithTag("Player"); music = true; }
void Start() { GameObject gameControllerObject = GameObject.FindGameObjectWithTag("GameController"); if (gameControllerObject != null) { statefulInspection = gameControllerObject.GetComponent <StatefulInspection>(); } }
void Start() { GameObject gameControllerObject = GameObject.FindGameObjectWithTag("GameController"); if (gameControllerObject != null) { statefulInspection = gameControllerObject.GetComponent <StatefulInspection>(); gameOver = gameControllerObject.GetComponent <GameOver>(); } MagicCircleStart(); player = GameObject.FindGameObjectWithTag("Player"); playerCombo = player.GetComponent <PlayerCombo>(); }
//修改********* // Start is called before the first frame update void Start() { GameObject[] obj = FindObjectsOfType(typeof(GameObject)) as GameObject[]; foreach (GameObject child in obj) { if (child.gameObject.name == "GameController") { gameOver = child.GetComponent <GameOver>(); break; } } //修改************ GameObject gameControllerObject = GameObject.FindGameObjectWithTag("GameController"); if (gameControllerObject != null) { statefulInspection = gameControllerObject.GetComponent <StatefulInspection>(); } //修改************* }