Esempio n. 1
0
    private void Start()
    {
        PracticalPlayers = DebugModeGame.GetProperty().m_debugMode ? DebugModeGame.GetProperty().m_debugPlayerNum : MaxPlayers;

        GameObject ParentCursor = GameObject.Find("Cursors(Clone)");

        for (int i = 0; i < MaxPlayers; i++)
        {
            if (i < PracticalPlayers)
            {
                targetCursor[i] = ParentCursor.transform.GetChild(i).GetComponent <Cursor>();
            }
            else
            {
                ParentCursor.transform.GetChild(i).gameObject.SetActive(false);
            }
        }
        gameController = GameObject.FindObjectOfType <GameController>();

        if (gameController == null)
        {
            Debug.LogError("Gamecontrollerがシーンにありません");
        }

        myInputManager = GameObject.FindObjectOfType <MyInputManager>();
        if (myInputManager == null)
        {
            Debug.LogError("MyInputManagerがシーンにありません");
        }

        g_UI = GameObject.Find("GameUI");
        _slider_Background = g_UI.transform.GetChild(0).transform.GetChild(3).transform.GetChild(0).gameObject;
        _slider_Fillarea   = g_UI.transform.GetChild(0).transform.GetChild(3).transform.GetChild(1).gameObject;
        timer = GameObject.FindObjectOfType <StartTimer>();
    }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        if (DebugModeGame.GetProperty().m_debugPlayerEnable)
        {
            return;
        }

        Debug.Log(m_state);
        switch (m_state)
        {
        case EState.Start:
            StartUpdate();
            break;

        case EState.Wait:
            WaitUpdate();
            break;

        case EState.Main:
            MainUpdate();
            break;

        case EState.Finish:
            FinishUpdate();
            break;

        case EState.End:
            RestartConfirmation();
            break;
        }
    }
Esempio n. 3
0
    void MainUpdate()
    {
        int deadNum   = 0;
        int playerNum = DebugModeGame.GetProperty().m_debugMode ? DebugModeGame.GetProperty().m_debugPlayerNum : m_playerNum;

        for (int i = 0; i < playerNum; ++i)
        {
            #region 旧Dead
            //if(m_playerObj[i] == null)
            //{
            //    deadNum++;
            //    continue;
            //}
            //if (m_playerObj[i].IsDead())
            //{
            //    deadNum++;
            //}
            #endregion
            if (!m_playerObj[i].gameObject.activeSelf)
            {
                deadNum++;
            }
        }

        if (deadNum >= playerNum - 1)
        {
            m_state = EState.Finish;
        }
    }
Esempio n. 4
0
    void WaitUpdate()
    {
        int playerNum = DebugModeGame.GetProperty().m_debugMode ? DebugModeGame.GetProperty().m_debugPlayerNum : m_playerNum;

        Debug.Log("参加人数" + m_playerObj.Count);
        if (m_playerObj.Count != playerNum)
        {
            return;
        }
        for (int i = 0; i < playerNum; ++i)
        {
            if (!m_playerObj[i].IsWait() && !m_playerObj[i].IsDead())
            {
                return;
            }
        }

        m_state = EState.Main;
        SetPlayerBothCollider(true);    // プレイヤー同士の当たり判定有効化

        for (int i = 0; i < playerNum; ++i)
        {
            m_playerObj[i].PlayStart();
        }

        Debug.Log("ゲームスタート");
    }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        if (DebugModeGame.GetProperty().m_debugPlayerEnable)
        {
            m_state = EState.Main;
        }
        m_gameSceneController = gameObject.GetComponent <GameSceneController>();
        m_costManager         = FindObjectOfType <CostManager>();

        SetPlayerBothCollider(false); // プレイヤー同士の当たり判定無効化
    }
 private void Start()
 {
     if (m_rankingInGame == null)
     {
         m_rankingInGame = FindObjectOfType <RankingInGame>();
     }
     if (m_crushPointManager == null)
     {
         m_crushPointManager = FindObjectOfType <CrushPointManager>();
     }
     m_restrictionNum = DebugModeGame.GetProperty().m_debugMode ? DebugModeGame.GetProperty().m_debugPlayerNum - 1 : 6 - 1;
 }
Esempio n. 7
0
    // Use this for initialization
    void Start()
    {
        //gameController =

        DebugModeGame debugModeGame = gameControllerObj.GetComponent <DebugModeGame>();

        if (!(debugModeGame.m_debugMode.m_debugMode && debugModeGame.m_debugMode.m_debugstageCreate))
        {
            Stages = SelectingStage.Colloseum;
        }

        Load();
    }
Esempio n. 8
0
    private void Start()
    {
        frame   = 0;
        m_state = EState.InitDisplayLoad;

        BgmSet();
        fadeController = FindObjectOfType <FadeController>();
        m_stageCreater = FindObjectOfType <StageCreate>();
        m_LoadCreater  = FindObjectOfType <LoadCreate>();
        m_LoadScript   = FindObjectOfType <LoadScript>();
        armatureSave   = FindObjectOfType <ArtArmatureSave>();
        MaxPlayer      = DebugModeGame.GetProperty().m_debugMode ? DebugModeGame.GetProperty().m_debugPlayerNum : 6;
        StDownflg      = false;
    }
    private void OnTriggerEnter(Collider other)
    {
        //吹っ飛び中に地面に当たると吹っ飛び状態解除

        if (DebugModeGame.GetProperty().m_debugMode&& DebugModeGame.GetProperty().m_debugPlayerEnable)
        {
            return;
        }
        if (m_state != EState.Init)
        {
            return;
        }
        if (LayerMask.LayerToName(other.gameObject.layer) != "Ground")
        {
            return;
        }
        m_state = EState.Wait;

        //        Destroy(GetComponent<BoxCollider>());
    }
Esempio n. 10
0
    void Update()
    {
        for (int i = 0; i < PracticalPlayers; i++)
        {
            if (targetCursor[i] == null)
            {
                continue;
            }
            if (useInitialAngle)
            {
                cannon.SetTargetWithAngle(targetCursor[i].transform.position, initialFireAngle, i);
            }
            else
            {
                cannon.SetTargetWithSpeed(targetCursor[i].transform.position, initialFireSpeed, useLowAngle, i);
            }

            if (targetCursor[i].FireFlg)
            {
                if (timer.TimerFinishflg)
                {
                    gameController.AddPlayer(cannon.FireHuman(i));
                    targetCursor[i].FireFlg = false;
                    _slider_Background.gameObject.SetActive(false);
                    _slider_Fillarea.gameObject.SetActive(false);
                    DeleteCursor(i);
                }
            }
            // デバッグ用射出
            if (DebugModeGame.GetProperty().m_debugMode&& DebugModeGame.GetProperty().m_Injection > i)
            {
                if (Input.GetButtonDown("Injection_" + (i + 1).ToString()))
                {
                    gameController.AddPlayer(cannon.FireHuman(i));
                    targetCursor[i].FireFlg = false;
                    DeleteCursor(i);
                }
            }
        }
        //timeOfFlightText.text = Mathf.Clamp(cannon.lastShotTimeOfFlight - (Time.time - cannon.lastShotTime), 0, float.MaxValue).ToString("F3");
    }
Esempio n. 11
0
    // Update is called once per frame
    void Update()
    {
        if (DebugModeGame.GetProperty().m_debugMode)
        {
            if (DebugModeGame.GetProperty().m_controllerDisable)
            {
                return;
            }
        }

        var stick = Input.GetJoystickNames();
        //Debug.Log("コントローラー接続台数:" + stick.Length);

        int num       = 0;
        int directNum = 0;

        for (int i = 0; i < stick.Length; ++i)
        {
            name[i] = stick[i];
            if (!string.IsNullOrEmpty(stick[i]))
            {
                num++;
                if (stick[i] == controllerName)
                {
                    directNum++;
                    //input[directNum - 1].JoystickNum = i+1;
                    joysticks[directNum - 1] = i + 1;
                }
            }
        }
        Debug.Log("動的接続:" + directNum);
        if (directNum == 6)
        {
            m_isAllConnectFlag = true;
        }
        else
        {
            m_isAllConnectFlag = false;
        }
    }
Esempio n. 12
0
    // Update is called once per frame
    void Update()
    {
        if (DebugModeGame.GetProperty().m_debugMode)
        {
            if (DebugModeGame.GetProperty().m_controllerDisable)
            {
                return;
            }
        }

        var stick = Input.GetJoystickNames();
        //Debug.Log("コントローラー接続台数:" + stick.Length);

        int num       = 0;
        int directNum = 0;

        for (int i = 0; i < joysticks.Length; ++i)
        {
            //if(name[i] != stick[i])
            //name[i] = stick[i];
            if (!string.IsNullOrEmpty(stick[i]))
            {
                // 文字列にコントローラ名がある
                if (stick[i] == controllerName)
                {
                    num++;
                    directNum++;
                    joysticks[directNum - 1] = i + 1;
                    IsConnectFlgs[num - 1]   = true;
                }
            }
            else
            {
                // 前フレームのコントローラ情報と比較
                if (name[i] == stick[i])
                {
                    num++;
                    IsConnectFlgs[num - 1] = false;
                }
            }
            name[i] = stick[i];
        }
        // どこか抜けてないか確認

        /*
         * int diffNum = 0;
         * int maxNum = 0;
         * int lastcount = 0;
         * for (int i = 0; i < oldJoysticks.Length; i++)
         * {
         *  maxNum = i + 1 + diffNum;
         *  if (maxNum > 6) maxNum = 6;
         *  if (joysticks[i] == 6) lastcount++;
         *  if (joysticks[i] != maxNum)
         *  {
         *      m_disconnectedNum.Add(i + 1);
         *          diffNum++;
         *      }
         *  }
         * Debug.Log("mmmm" + lastcount);
         *  Debug.Log("llll" + m_disconnectedNum.Count);
         */
        for (int i = 0; i < IsConnectFlgs.Length; ++i)
        {
            // falseの時(i+1)= playerIDをリストに追加
            if (!IsConnectFlgs[i])
            {
                m_disconnectedNum.Add(i + 1);
            }
        }
        Debug.Log("動的接続:" + directNum);
        if (directNum == 6)
        {
            m_isAllConnectFlag = true;
            canvasInterruption.OnConnectedReady();
        }
        else
        {
            m_isAllConnectFlag = false;
            canvasInterruption.OnDisconnected(m_disconnectedNum);
        }
        m_disconnectedNum.Clear();
    }
Esempio n. 13
0
    // Use this for initialization
    void Start()
    {
        /*
         * // デフォルトの肌の色の数値を代入する
         * SaveColor = new Color(1.0f, 0.78f, 0.55f, 1.0f);
         * // 色が変わった状態でHumanが無くなるとMaterialが変更されてままになるので生成時に初期色入れておく
         * Hand_R.color = SaveColor;
         * Hand_L.color = SaveColor;
         * Calf_R.color = SaveColor;
         * Calf_L.color = SaveColor;
         */
        m_state = EState.Init;
        m_hitReceivePlayerID = PlayerID;

        InputName[0] = "Horizontal_Player";
        InputName[1] = "Vertical_Player";
        InputName[2] = "A_Player";
        InputName[3] = "B_Player";
        InputName[4] = "X_Player";
        InputName[5] = "Y_Player";

        myInputManager = FindObjectOfType <MyInputManager>();
        if (myInputManager == null)
        {
            Debug.LogError("MyInputManagerがシーンに存在しません");
        }

        m_crushPointManager = FindObjectOfType <CrushPointManager>();
        if (m_crushPointManager == null)
        {
            Debug.LogError("CrushPointManagerがシーンに存在しません。");
        }

        // 手足伸ばすスクリプト
        m_extendAndShrink = GetComponent <PlayerExtendAndShrink>();
        if (m_extendAndShrink == null)
        {
            Debug.LogError("PlayerExtendAndShrinkをアタッチしてください。");
        }
        // 移動処理スクリプト
        m_moving = GetComponent <PlayerMoving>();
        if (m_moving == null)
        {
            Debug.LogError("PlayerMovingをアタッチしてください。");
        }
        // プレイヤーカメラスクリプト
        P_Camera = GetComponent <PlayerCamera>();
        if (P_Camera == null)
        {
            Debug.LogError("PlayerCameraをアタッチしてください。");
        }
        // 地面とのRayの処理スクリプト
        if (m_ray == null)
        {
            Debug.LogError("PlayerRayをセットしてください。");
        }
        // パーツスケールのスクリプト
        m_parts = GetComponent <PartsScale>();
        if (m_parts == null)
        {
            Debug.LogError("PartsScaleをアタッチしてください。");
        }


        if (!DebugModeGame.GetProperty().m_debugMode)
        {
            return;
        }
        // デバッグモードONの時の設定
        if (DebugModeGame.GetProperty().m_debugPlayerEnable)
        {
            m_state = EState.Idle;
        }
        if (DebugModeGame.GetProperty().m_controllerDisable)
        {
            myInputManager.joysticks[m_playerID - 1] = m_playerID;
        }
    }