Inheritance: MonoBehaviour
Exemplo n.º 1
0
 void Start()
 {
     surface       = GetComponent <SurfaceDetection>();
     lifeIndicator = GetComponent <LifeIndicator>();
     controller    = GetComponent <CharacterController>();
     controller.detectCollisions = true;
 }
Exemplo n.º 2
0
    //float yMin, yMax;

    // Use this for initialization
    void Start()
    {
        SetUpMoveBoundaries();
        lifeIndicator     = FindObjectOfType <LifeIndicator>();
        mySpriteRenderer  = GetComponent <SpriteRenderer>();
        playerAudioSource = GetComponent <AudioSource>();
    }
Exemplo n.º 3
0
 void SpawnWave(int waveType, int num, int startTime, float freq, TDPath path)
 {
     for (int i = 0; i < num; i++)
     {
         FollowPath FollowPath = GameObject.Instantiate(UnitsModels[waveType], path.GetPoint(0), Quaternion.identity);
         FollowPath.startTime = startTime + freq * i;
         FollowPath.gameObject.SetActive(true);
         instances.Add(FollowPath.gameObject);
         LifeIndicator lifeIndicator = FollowPath.gameObject.GetComponentInChildren <LifeIndicator>();
         if (lifeIndicator)
         {
             Enemy enemyObject = FollowPath.gameObject.GetComponent <Enemy>();
             lifeIndicator.root = enemyObject;
         }
     }
 }
    // Use this for initialization
    void Start()
    {
        Player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMOD>();
        //score = GameObject.FindGameObjectWithTag("Manager").GetComponent<ScoreSystem>();
        lifeIndicator = GameObject.FindGameObjectWithTag("LifeIndicator").GetComponent <LifeIndicator>();

        explosionParticles.SetActive(false);
        //healParticles.SetActive(false);
        healParticles.Stop();
        hitPoint.SetActive(true);
        counter = maxEnemies;

        InvokeRepeating("Spawn", spawnRate, spawnRate);

        if (isDestroyed)
        {
            if (isDestroyedState)
            {
                hitPoint.SetActive(false);
                isDestroyedState = false;
                CancelInvoke();
            }
        }
    }
Exemplo n.º 5
0
 void Start()
 {
     player        = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMOD>();
     cam           = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <MainCamera>();
     lifeIndicator = GameObject.FindGameObjectWithTag("LifeIndicator").GetComponent <LifeIndicator>();
 }