Пример #1
0
    private void Awake()
    {
        DontDestroyOnLoad(this);

        Instance = this;

        Name = "Player #" + Random.Range(0, 9999);
    }
Пример #2
0
 private void Awake()
 {
     if (Instance != null)
     {
         return;
     }
     DontDestroyOnLoad(this);
     Instance = this;
 }
Пример #3
0
    // Update is called once per frame
    private void Awake()
    {
        DontDestroyOnLoad(this);

        Instance = this;

        Name = "Player #" + Random.Range(0, 9999);

        photonView      = gameObject.GetComponent <PhotonView>();
        photonView.name = Name;
    }
    // Use this for initialization
    private void Awake()
    {
        Instance   = this;
        PhotonView = GetComponent <PhotonView>();

        PlayerName = "Distul#" + Random.Range(1000, 9999);

        PhotonNetwork.sendRate            = 60;
        PhotonNetwork.sendRateOnSerialize = 30;

        SceneManager.sceneLoaded += OnSceneFinishedLoading;
    }