// ************************************************************** // STAMINA - END // ************************************************************** public void PublishHealth() { // publish new health to hurtbox PlayerHurtBox.GetInstance().currentHealth = health; PlayerHurtBox.GetInstance().maxHealth = maxHealth; // publish health to gui eventHealth.Invoke(maxHealth, health); }
// Use this for initialization void Awake() { moveController = GetComponent <PlayerMoveController2D>(); soundController = GetComponent <PlayerSounds>(); spriteRenderer = GetComponent <SpriteRenderer>(); boxCollider2D = GetComponent <BoxCollider2D>(); animator = GetComponent <Animator>(); currentState = new SwordUpState(this); statistics = GetComponentInChildren <PlayerStatistics>(); input = GetComponent <InputController>(); hurtBox = GetComponentInChildren <PlayerHurtBox>(); _instance = this; // init weapon and animation layer SetWeapon("-1", 0); }
public void Awake() { _instance = this; }