コード例 #1
0
 protected virtual void Start()
 {
     SetMaxHealthFromHealthLevel();
     currentHealth     = maxHealth;
     animatorHandler   = GetComponentInChildren <AnimatorHandler>();
     weaponSlotManager = GetComponentInChildren <WeaponSlotManager>();
 }
コード例 #2
0
        private void OnTriggerEnter(Collider other)
        {
            PlayerStats playerStats = other.GetComponent <PlayerStats>();

            if (playerStats != null)
            {
                WeaponSlotManager weaponSlotManager = other.GetComponentInChildren <WeaponSlotManager>();
                weaponSlotManager.CloseDamageCollider();
                playerStats.TakeDamage(damage, 0);
            }
        }