Пример #1
0
        // Called automatically by Unity after Awake whenever the script is enabled.
        void OnEnable()
        {
            SceneLinkedSMB <PlayerController> .Initialise(m_Animator, this);

            m_Damageable = GetComponent <Damageable>();
            m_Damageable.onDamageMessageReceivers.Add(this);

            EquipMeleeWeapon(false);

            m_Renderers = GetComponentsInChildren <Renderer>();

            m_lastPosition = transform.position;
            if (IsMine)
            {
                m_healthUI.ChangeHitPointUI(m_Damageable);
            }
        }
Пример #2
0
 public void Heal(int maxHitPointsAdd, int currentHitPointsAdd)
 {
     this.maxHitPoints     += maxHitPointsAdd;
     this.currentHitPoints += currentHitPointsAdd;
     if (_healthUi == null)
     {
         _healthUi = FindObjectOfType <HealthUI>();
     }
     _healthUi.ChangeHitPointUI(this);
 }