getLife() public méthode

public getLife ( ) : float
Résultat float
Exemple #1
0
    private void Update()
    {
        if (life.getLife() <= 0)
        {
            if (!isDieing)
            {
                isDieing = true;
                animation.Play("Anim_Death");
                dieingSound.Play();
                deathParticles.SetActive(true);
                Destroy(gameObject, animation.clip.length);
            }
            return;
        }

        if (navMeshAgent.isStopped)
        {
            state = StateAI.Attacking;
            if (!animation.isPlaying)
            {
                animation.Play("Anim_Attack");
                playerLife.decreaseLife(attackPower * Time.deltaTime);
                attackSound.Play();
            }
        }
        else
        {
            state = StateAI.Walking;
            if (!animation.isPlaying)
            {
                animation.Play("Anim_Run");
            }
        }
    }
Exemple #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            CreateTableBox();
            life = new Life(Pattern.PatternTy.TYPE_1);
            drawTable(life.getLife());

            lifeThread = new LifeThread(this, life, Pattern.PatternTy.TYPE_1);
            lifeThread.startThread();
        }
Exemple #3
0
    private void Update()
    {
        if (life.getLife() <= 0)
        {
            return;
        }

        Vector3 playerPosition = TPSWalker.floorPoint;

        navMeshAgent.SetDestination(playerPosition);
        float distance = Vector3.Distance(transform.position, playerPosition);

        if (distance < minDist)
        {
            navMeshAgent.isStopped = true;
        }
        else
        {
            navMeshAgent.isStopped = false;
        }
    }
Exemple #4
0
 //Getter & setter for the life.
 public float getLife()
 {
     return(_lifeManager.getLife());
 }
Exemple #5
0
 public void onLifeCreated(Life life)
 {
     drawTable(life.getLife());
     lifeThread = new LifeThread(this, life, Pattern.PatternTy.TYPE_1);
     lifeThread.startThread();
 }