Esempio n. 1
0
    private void Die()
    {
        if (isDead)
        {
            return;
        }

        if (GetComponentInChildren <Virus> () != null)
        {
            GetComponentInChildren <Virus> ().Launch(Vector3.up, 90);
        }

        if (hostType == HostFigureType.Zombie)
        {
            DarkTonic.MasterAudio.MasterAudio.PlaySound("sploosh");
        }

        isDead = true;
        GameManager.Instance.OnHostFigureDie(this);
        UpdateAnimationState("Death");
        currentMoveTween.Kill();
        healthBar.Disable();
        transform.parent = null;

//        Destroy(gameObject);
    }
Esempio n. 2
0
 void SetHost(HostFigure newHost)
 {
     currentHost = newHost;
     DOTween.Kill(spriteTransform);
     transform.parent           = newHost.visualContainer;
     spriteTransform.localScale = Vector3.zero;
     transform.localPosition    = Vector3.zero;
     body.velocity = Vector2.zero;
     isFlying      = false;
     healthbar.Disable();
 }
Esempio n. 3
0
    void Awake()
    {
        visualContainer  = transform.Find("Container");
        m_spriteRenderer = visualContainer.Find("Sprite").GetComponent <SpriteRenderer>();
        m_animator       = GetComponentInChildren <Animator> ();

        healthBar = GetComponentInChildren <Healthbar> ();
        healthBar.Disable();
        hostType = HostFigureType.Soldier;
        UpdateAnimationState("Walk Front");
    }