private void Awake() { if (sharedInstace == null) { sharedInstace = this; } }
// Use this for initialization private void Start() { if (spawnner == null) { spawnner = gameObject.GetComponentInChildren <BatterySpawner>(); } //Debug.Log("Is this start running"); audio = gameObject.AddComponent <AudioSource>(); SetState(GameState.Begin); }
private void Start() { gi = GameInfo.autoRef; if (!gi) { Debug.LogError("CarryBattery.cs: Script GameInfo n'a pas d'auto-référence statique !"); } animator = GetComponentInChildren <Animator>(); audioController = GetComponent <audioController>(); movement = GetComponent <PlayerMovement>(); batterySpawner = GameObject.FindGameObjectWithTag("SpawnBattery").GetComponent <BatterySpawner>(); }