コード例 #1
0
    // Use this for initialization
    void Start()
    {
        _Instance = this;

        IsStopMoveAiPlayer = false;
        if (PlayerShootNpc_2 < PlayerShootNpc_1)
        {
            Debug.LogError("PlayerShootNpc_1 and PlayerShootNpc_2 was wrong!");
            PlayerTran.name = "null";
        }

        if (PlayerHitZhangAi_2 < PlayerHitZhangAi_1)
        {
            Debug.LogError("PlayerHitZhangAi_1 and PlayerHitZhangAi_2 was wrong!");
            PlayerTran.name = "null";
        }

        AudioHitBt = AudioListCtrl.GetInstance().AudioStartBt;
        AudioManager.Instance.PlayBGM(AudioListCtrl.GetInstance().AudioGameBeiJing, true);
        if (GlobalData.GetInstance().gameMode == GameMode.SoloMode)
        {
            //DanJiXueTiaoEng = XueTiaoEngCtrl.GetInstance().GetXueTiaoEngSprite();

            //InitDanJiXueTiaoEng();
            //WaterwheelPlayerCtrl.PlayerZhuanXiangVal = PlayerZhuanXiangVal;
            HeadCtrlPlayer.GetInstanceP1().StopColor();

            StartBtCtrl.GetInstanceP2().CloseStartBtCartoon();
            HeadCtrlPlayer.GetInstanceP2().SetHeadColor();
            if (!GlobalData.GetInstance().IsFreeMode)
            {
                if (GlobalData.GetInstance().Icoin >= GlobalData.GetInstance().XUTOUBI)
                {
                    StartBtCtrl.GetInstanceP2().InitStartBtCartoon();
                }
                else
                {
                    InsertCoinCtrl.GetInstanceP2().ShowInsertCoin();
                }
            }
            else
            {
                StartBtCtrl.GetInstanceP2().InitStartBtCartoon();
            }
            ShowAllCameras();

            //InvokeRepeating("LoopSubXueTiao", 3f, 100f); //test
            //InitFillPlayerBlood(); //test
        }
        else
        {
            /*if (NetworkRpcMsgCtrl.MaxLinkServerCount > 0 && NetworkRpcMsgCtrl.MaxLinkServerCount != NetworkRpcMsgCtrl.NoLinkClientCount) {
             *      CloseAllCameras();
             * }
             * else {
             *      ShowAllCameras();
             * }*/

            //WaterwheelPlayerNetCtrl.PlayerZhuanXiangVal = PlayerZhuanXiangVal;
            HeadCtrlPlayer.GetInstanceP1().StopColor();

            StartBtCtrl.GetInstanceP2().CloseStartBtCartoon();
            HeadCtrlPlayer.GetInstanceP2().SetHeadColor();
            if (!GlobalData.GetInstance().IsFreeMode)
            {
                if (GlobalData.GetInstance().Icoin >= GlobalData.GetInstance().XUTOUBI)
                {
                    StartBtCtrl.GetInstanceP2().InitStartBtCartoon();
                }
                else
                {
                    InsertCoinCtrl.GetInstanceP2().ShowInsertCoin();
                }
            }
            else
            {
                StartBtCtrl.GetInstanceP2().InitStartBtCartoon();
            }
        }

        SetPanelCtrl.GetInstance();
        PlayerAutoFire.ResetPlayerHitZhangAiNum();
        PlayerAutoFire.ResetPlayerShootNpcNum();

        //QueryLinkIp.GetInstance().CheckLinkIpArray();
        //TestIpLink();

        CancelInvoke("FreeMemory");
        InvokeRepeating("FreeMemory", 30000f, 10000f);
    }