예제 #1
0
파일: Health.cs 프로젝트: louisditzel/Unity
    public virtual void InitialiseHealth(ComputerLane computerlane)
    {
        entityLocation = Camera.main.WorldToScreenPoint(gameObject.transform.position);
        if(isServer) {
            // if max heath isnt set, as can be set by later function
            currentHealth = maxHealth;
            percentOfHealth = currentHealth / maxHealth;
            healthBarLength = percentOfHealth * healthBarInitialLength;

            damageText = gameObject.GetComponent<DamageText>();
            damageText.InitialiseDamageText(computerlane);
        }
    }