Пример #1
0
    void Update()
    {
        if (enemies.Count > 0)
        {
            Color col = spaceIsThePlace.color;
            col = Color.Lerp(col, Color.clear, Time.deltaTime * 3);
            spaceIsThePlace.color = col;

            for (int i = 0; i < enemies.Count; i++)
            {
                DamageHealthController DHC = enemies[i].GetComponent <DamageHealthController>();
                if (!DHC.alive)
                {
                    Death(i, true);
                }
            }
        }
        else
        {
            Color col = spaceIsThePlace.color;
            col = Color.Lerp(col, startCol, Time.deltaTime * 3);
            spaceIsThePlace.color = col;
        }

        if (!Player.GetComponentInChildren <DamageHealthController>().alive)
        {
            ButtonText.fontSize = 11;
            ButtonText.text     = "Try Again?";
        }
    }
    void Start()
    {
        PS           = GetComponentsInChildren <ParticleSystem>();
        DHC          = GetComponentInChildren <DamageHealthController>();
        healthAmount = healthBar.GetComponentInChildren <Text>();
        startColor   = healthBar.color;

        ToggleFiring();
    }
 void Start()
 {
     behaviors.Add((Behavior)ScriptableObject.CreateInstance(typeof(Retreat)));
     behaviors.Add((Behavior)ScriptableObject.CreateInstance(typeof(Attack)));
     if (follower)
     {
         behaviors.Add((Behavior)ScriptableObject.CreateInstance(typeof(Follow)));
     }
     behaviors.Add((Behavior)ScriptableObject.CreateInstance(typeof(Search)));
     for (int behavior = 0; behavior < behaviors.Count; behavior++)
     {
         behaviors[behavior].init(this);
     }
     DHC = GetComponent <DamageHealthController>();
 }
Пример #4
0
 private void Start()
 {
     startCol  = spaceIsThePlace.color;
     PlayerDHC = Player.GetComponentInChildren <DamageHealthController>();
 }