Ejemplo n.º 1
0
    private void Hurt(GameObject other)
    {
        LifeEntity life = other.GetComponent <LifeEntity>();

        if (life)
        {
            isSomethingInside = true;

            timeAfterStopAttacking.StartCoolDown();

            if (!life.isPlayer && hurtOnlyPlayer)
            {
                return;
            }


            //ici on a déja tapé...
            if (!coolDown.IsReady())
            {
                return;
            }

            //ici on tape
            coolDown.StartCoolDown();
            life.GetHit(hurtAmount, transform.position);

            if (kamikaze)
            {
                parentToKill.GetComponent <IKillable>().Kill();
                return;
            }
        }
    }
Ejemplo n.º 2
0
 private void Start()
 {
     Speed   = 1f;
     mystate = this.GetComponent <LifeEntity>();
     StartCoroutine(Move());
 }