protected virtual void Awake() { if (m_AudioManager == null) { m_AudioManager = GameManager.Instance.GetSubManager <AudioSubGameManager>(ESubManager.Audio); } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) //{ // //} // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) //{ // //} void InitIfNeeded(GameObject owner) { if (!m_Initialized) { m_PlayerIndex = owner.GetComponentInParent <PlayerInfoComponent>().GetPlayerIndex(); m_AudioManager = GameManager.Instance.GetSubManager <AudioSubGameManager>(ESubManager.Audio); m_Initialized = true; } }
public virtual void OnInit(PlayerAttackComponent playerAttackComponent, PlayerAttack attack) { m_Owner = playerAttackComponent.gameObject; m_Attack = attack; m_Animator = playerAttackComponent.m_Animator; m_MovementComponent = playerAttackComponent.m_MovementComponent; m_AttackComponent = playerAttackComponent; m_InfoComponent = playerAttackComponent.m_InfoComponent; m_AudioManager = playerAttackComponent.m_AudioManager; }
private void Awake() { m_HP = m_HealthConfig.m_MaxHP; m_StunInfoSC = new PlayerStunInfoSubComponent(this, m_InfoComponent, m_MovementComponent, m_Anim); m_ProximityGuardSubComponent = new PlayerProximityGuardSubComponent(this, m_MovementComponent, m_Anim); m_TimeScaleManager = GameManager.Instance.GetSubManager <TimeScaleSubGameManager>(ESubManager.TimeScale); m_FXManager = GameManager.Instance.GetSubManager <FXSubGameManager>(ESubManager.FX); m_AudioManager = GameManager.Instance.GetSubManager <AudioSubGameManager>(ESubManager.Audio); RegisterListeners(); }
private void Awake() { m_Animator = GetComponent <Animator>(); m_TimeScaleManager = GameManager.Instance.GetSubManager <TimeScaleSubGameManager>(ESubManager.TimeScale); m_FXManager = GameManager.Instance.GetSubManager <FXSubGameManager>(ESubManager.FX); m_AudioManager = GameManager.Instance.GetSubManager <AudioSubGameManager>(ESubManager.Audio); m_UIBackground = GameObject.FindGameObjectWithTag("UIBackground")?.GetComponent <SpriteRenderer>(); m_UIMaskedBackground = GameObject.FindGameObjectWithTag("UIMaskedBackground")?.GetComponent <SpriteRenderer>(); m_UIBackgroundMask = GameObject.FindGameObjectWithTag("UIBackgroundMask")?.GetComponent <SpriteMask>(); m_UIBackgroundMaskDetail = GameObject.FindGameObjectWithTag("UIBackgroundMaskDetail")?.GetComponent <SpriteRenderer>(); #if UNITY_EDITOR if (m_UIBackground == null || m_UIMaskedBackground == null || m_UIBackgroundMask == null) { KakutoDebug.LogError("UIBackground elements can't be found"); } #endif }