Esempio n. 1
0
 // Use this for initialization
 void Start()
 {
     _instance = this;
     NetCtrl.InitPlayerIpArray();
     NetworkServerNet.CountPlayerStatic = 0;
     PlayerCreatNet.ResetClientCount();
 }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     _Instance = this;
     if (GlobalData.GetInstance().gameMode == GameMode.OnlineMode)
     {
         GameObject bikegamectrl = GameObject.Find(GlobalData.bikeGameCtrl);
         playerCreatScript   = bikegamectrl.GetComponent <PlayerCreatNet>();
         NetworkServerScript = NetworkServerNet.GetInstance();
         netCtrlScript       = NetCtrl.GetInstance();
         if (NetworkServerScript != null && NetworkServerScript.GetIsServer())
         {
             return;
         }
         else
         {
             SoureAudio = AudioManager.Instance.audio;
         }
     }
     else
     {
         SoureAudio = AudioManager.Instance.audio;
         ui         = GetComponent <UISprite>();
         scale      = GetComponent <TweenScale>();
         StartCoroutine("Gogo");
     }
 }
    void Start()
    {
        //ScreenLog.Log("PlayerCreatNet init...");
        _Instance = this;
        if (GlobalData.GetInstance().gameMode == GameMode.SoloMode)
        {
            return;
        }
        IsDisconnected = false;
        ShowServerWait();

        for (int index = 0; index < ChaCheSpawnPoint.Length; index++)
        {
            ChaCheSpawnPoint[index].gameObject.SetActive(false);
        }

        if (WangQiuNetGroup != null)
        {
            for (int index = 0; index < WangQiuNetGroup.childCount; index++)
            {
                WangQiuNetGroup.GetChild(index).gameObject.SetActive(false);
            }
        }

        if (DianChiNetGroup != null)
        {
            for (int index = 0; index < DianChiNetGroup.childCount; index++)
            {
                DianChiNetGroup.GetChild(index).gameObject.SetActive(false);
            }
        }

        if (ShouBiaoNetGroup != null)
        {
            for (int index = 0; index < ShouBiaoNetGroup.childCount; index++)
            {
                ShouBiaoNetGroup.GetChild(index).gameObject.SetActive(false);
            }
        }

        for (int index = 0; index < spawnTran.Length; index++)
        {
            spawnTran[index].gameObject.SetActive(false);
        }

        if (Network.peerType == NetworkPeerType.Client)
        {
            SendPlayerIntoGame();
        }

        if (Network.peerType == NetworkPeerType.Server)
        {
            CheckServerInitGame();
        }
    }
 void NetCtrlSendPlayerIntoGame()
 {
     PlayerCreatNet.OnPlayerIntoGame();
 }