示例#1
0
 private void Awake()
 {
     if (sharedInstace == null)
     {
         sharedInstace = this;
     }
 }
示例#2
0
    // 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>();
    }