コード例 #1
0
 private void Start()
 {
     if (Instance == null)
     {
         Instance             = this;
         _updateNicknamePanel = new UnityEvent();
     }
     else
     {
         Destroy(GetComponent <MultiplayerFunctions>());
     }
     PhotonNetwork.AutomaticallySyncScene = true;
 }
コード例 #2
0
    private static HostData[] hostData = null; //Latest cached hostData result


    void Awake()
    {
        if (SP != null && this != SP)
        {
            //There is already a copy of this script running
            Destroy(this);
            return;
        }
        SP = this;
        StartCoroutine(TestConnection());
        StartCoroutine(SetupMasterServer());
        //DontDestroyOnLoad(this); //enable this to make this an persistent GO
    }
コード例 #3
0
 void Awake()
 {
     if (SP != null && this != SP)
     {
         //There is already a copy of this script running
         Destroy(this);
         return;
     }
     SP = this;
     StartCoroutine(TestConnection());
     StartCoroutine(SetupMasterServer());
     //DontDestroyOnLoad(this); //enable this to make this an persistent GO
 }