Exemple #1
0
    // Use this for initialization
    void Start()
    {
        m_showBuff      = 1;
        m_viewStatus    = GHOTS_VIEW_STATUS.INVISIBLE;
        m_pStateMachine = new CStateMachine <GhostMain>(this);
        m_animator      = this.GetComponent <Animator>();
        m_pStateMachine.SetCurrentState(CGhostState_Main.Instance());
        m_pStateMachine.SetGlobalStateState(CGhostState_Wait.Instance());
        m_nowDunmmyNum      = m_maxDunmmyNum;
        dGhost              = new GameObject[3];
        GhostScore          = new SGhostScore();
        GhostScore.hitCandy = 0;
        GhostScore.knockOut = 0;
        int count = 1;

        foreach (Transform i in this.transform)
        {
            if (i.name == ("ghostkodomo_" + count.ToString()))
            {
                dGhost[count - 1] = i.gameObject;
                count++;
            }
            if (i.name == "GhostMeshParticle")
            {
                m_movepatincle = i.GetComponent <ParticleSystem>();
            }
        }
    }
Exemple #2
0
    /*!  OnTriggerExit( Collider )
     *!   \details	光から出たら呼ばれるメソッド
     *!
     *!   \return	戻り値
     */
    void OnTriggerExit(Collider coll)
    {
        // 光から出たら
        bool isHitChar = TAG_HUMAN == coll.tag ||
                         TAG_GHOST == coll.tag ||
                         TAG_DUMMY_G == coll.tag;

        if (!isHitChar)
        {
            return;
        }

        // --- 各オブジェクトのイベント ---
        switch (coll.tag)
        {
        /* 人 */
        case TAG_HUMAN:
            for (int i = 0; i < m_humanList.Count; i++)
            {
                var human = m_humanList[i];
                if (coll.name != human._instance.name)
                {
                    continue;
                }
                human.islightIn         = false;
                human._instance.LightOn = false;
                m_humanList[i]          = human;
                break;
            }
            break;

        /* お化け */
        case TAG_GHOST:
            /* お化けを透明に */
            // Debug.Log( "お化けノットヒットライト" );
            m_ghost._instance.m_pStateMachine.ChangeGlobalState(CGhostState_Main.Instance());
            m_ghost.islightIn = false;
            break;

        case TAG_DUMMY_G:
            for (int i = 0; i < m_dymmyGhostList.Count; i++)
            {
                bool isNameCheck = coll.name == m_dymmyGhostList[i]._instance.name;
                bool isAct       = m_dymmyGhostList[i]._instance.IsAct;

                if (!(isNameCheck && isAct))
                {
                    continue;
                }
                Debug.Log("照らし終わり");
                m_dymmyGhostList[i].islightIn = false;
                m_dymmyGhostList[i]._instance.m_viewStatus = DummyGhost.GHOTS_VIEW_STATUS.INVISIBLE;
            }
            break;
        }
    }
Exemple #3
0
    public override void Execute(GhostMain ghost)
    {
        //スタンされているなら スタン時間を計算する


        m_nowTime += Time.deltaTime;
        if (m_nowTime >= ghost.m_stanInterval)
        {
            ghost.m_pStateMachine.ChangeState(CGhostState_Main.Instance());

            m_nowTime = 0;
        }
    }
Exemple #4
0
    void UpdateServer()
    {
        switch (m_status)
        {
        case (int)GhostStateID.MAIN:

            m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Main.Instance());
            break;

        case (int)GhostStateID.ATK:

            m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Atk.Instance());
            break;

        case (int)GhostStateID.AVATAR:

            m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Avatar.Instance());
            break;

        case (int)GhostStateID.DASH:

            m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Dash.Instance());
            break;

        case (int)GhostStateID.MOVE:

            m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Move.Instance());
            break;

        case (int)GhostStateID.SLOW:

            m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Slow.Instance());
            break;

        case (int)GhostStateID.STAN:

            m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Stan.Instance());
            break;

        case (int)GhostStateID.WAIT:

            m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Wait.Instance());
            break;
        }
    }
Exemple #5
0
    void Move()
    {
        float x = Input.GetAxisRaw("Horizontal");

        float z = Input.GetAxisRaw("Vertical");

        // 移動する向きを求める
        Vector3 tmp = new Vector3(x, 0, z);

        m_ghostMain.MoveDirection = tmp.normalized;

        if (m_ghostMain.MoveDirection.magnitude > 0.1f)
        {
            if (!CInputComponent.InputAction(CInputComponent.KEY_ACTION.PRESS, KeyCode.LeftShift, Dash))
            {
                m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Move.Instance(), m_ghostMain.m_pStateMachine.CurrentState().IsEnd);
            }
            return;
        }

        m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Main.Instance(), m_ghostMain.m_pStateMachine.CurrentState().IsEnd);
    }