コード例 #1
0
ファイル: MenuComponent.cs プロジェクト: BeNeNuTs/Kakuto
 protected virtual void Awake()
 {
     if (m_AudioManager == null)
     {
         m_AudioManager = GameManager.Instance.GetSubManager <AudioSubGameManager>(ESubManager.Audio);
     }
 }
コード例 #2
0
    // 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;
        }
    }
コード例 #3
0
 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;
 }
コード例 #4
0
    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();
    }
コード例 #5
0
    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
    }