Exemplo n.º 1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Exemplo n.º 2
0
        void Update()
        {
            if (timer > 1.0f)
            {
                timer      -= 1.0f;
                currentTile = currentTile.NextTile;
            }

            if (currentTile.NextTile == null)
            {
                CreepManager.DespawnCreep(this);

                return;
            }

            transform.position = currentTile.transform.position * (1.0f - timer) + currentTile.NextTile.transform.position * timer;

            timer += Time.deltaTime * data.MoveSpeed * (isChilled ? chillSpeedModifier : 1.0f);

            if (isChilled)
            {
                chillTimer += Time.deltaTime;

                if (chillTimer > chillDuration)
                {
                    isChilled = false;
                }
            }

            if (spriteRenderer != null)
            {
                spriteRenderer.color = isChilled ? chilledColor : normalColor;
            }
        }
Exemplo n.º 3
0
        public void Damage(Shell shell)
        {
            currentHitpoints--;

            if (shell.HasChillEffect)
            {
                chillTimer = 0.0f;

                isChilled = true;
            }

            if (!IsAlive())
            {
                CreepManager.DespawnCreep(this);
            }
        }
Exemplo n.º 4
0
 public void StartWave()
 {
     CreepManager.LaunchWave();
 }