예제 #1
0
    private void Start()
    {
        uiHealthBar        = HUD.GetComponentInChildren <UpdateHealthBar>();
        uiHealthPercentage = HUD.GetComponentInChildren <UpdateHealthPercentage>();

        uiHealthBar.SetPlayerHealthScript(gameObject.GetComponent <Health>());
        uiHealthPercentage.SetPlayerHealthScript(gameObject.GetComponent <Health>());
    }
예제 #2
0
    void Start()
    {
        healthManager = GetComponent <HealthManager>();

        healthBar       = (GameObject)Instantiate(healthBarToClone, transform.position, Quaternion.identity);
        updateHealthBar = healthBar.GetComponent <UpdateHealthBar> ();
        updateHealthBar.targetToFollow = gameObject;

        hitDamageForLevel = hitDamage * Mathf.Pow(hitDamageLevelFactor, (float)GameLogic.GetInstance().GetCurrentLevel());
    }
예제 #3
0
 // Use this for initialization
 void Awake()
 {
     DieEffectHash             = VFXController.StringToHash("Smoke");
     shootTime                 = shootCoolDown;
     contactFilter2D.layerMask = hitLayerMask;
     rayCastPosition           = transform.position;
     bulletPool                = BulletPool.GetObjectPool(Bullet, 10);
     animator        = GetComponent <Animator>();
     shootScript     = Bullet.GetComponent <StartShooting>();
     spriteRenderer  = GetComponent <SpriteRenderer>();
     updateHealthBar = GetComponentInChildren <UpdateHealthBar>();
 }
예제 #4
0
파일: HouseController.cs 프로젝트: cor/LD33
    void Start()
    {
        originalPosition = transform.position;

        healthManager = GetComponent<HealthManager>();

        healthBar = (GameObject)Instantiate(healthBarToClone, transform.position, Quaternion.identity);
        updateHealthBar = healthBar.GetComponent<UpdateHealthBar> ();
        updateHealthBar.targetToFollow = gameObject;
        updateHealthBar.healthBarOffset = new Vector3(0, 1f, -0.2f);

        seed = Random.value * 100;
    }
예제 #5
0
    void Start()
    {
        originalPosition = transform.position;

        healthManager = GetComponent <HealthManager>();

        healthBar       = (GameObject)Instantiate(healthBarToClone, transform.position, Quaternion.identity);
        updateHealthBar = healthBar.GetComponent <UpdateHealthBar> ();
        updateHealthBar.targetToFollow  = gameObject;
        updateHealthBar.healthBarOffset = new Vector3(0, 1f, -0.2f);

        seed = Random.value * 100;
    }
예제 #6
0
파일: HumanController.cs 프로젝트: cor/LD33
    void Start()
    {
        healthManager = GetComponent<HealthManager>();

        healthBar = (GameObject)Instantiate(healthBarToClone, transform.position, Quaternion.identity);
        updateHealthBar = healthBar.GetComponent<UpdateHealthBar> ();
        updateHealthBar.targetToFollow = gameObject;

        hitDamageForLevel = hitDamage * Mathf.Pow (hitDamageLevelFactor, (float)GameLogic.GetInstance ().GetCurrentLevel());
    }