void Start() { _syncPositionRequest = GetComponent <SyncPositionRequest>(); _syncPlayerRequest = GetComponent <SyncPlayerRequest>(); _syncPlayerRequest.DefaultRequest(); InvokeRepeating("SyncPositon", 3f, 0.02f); }
// Use this for initialization void Start() { if (bIslocalPlayer) { GetComponent <Renderer>().material.color = Color.green; scriptSyncPositionRequest = GetComponent <SyncPositionRequest>(); InvokeRepeating("SyncPosition", 3, 1 / 5f);//3s后开始每隔1/5f s调用 } }
void Start() { //当前客户端玩家默认设置为绿色 player.GetComponent <Renderer>().material.color = Color.green; syncPositionRequest = GetComponent <SyncPositionRequest>(); syncPlayerRequest = GetComponent <SyncPlayerRequest>(); syncPlayerRequest.DefaultRequest(); //一秒同步5次 调用 SyncPosition方法 time = 3 (3秒后执行) ,repeatRate = 0.2f 重复执行间隔 InvokeRepeating("SyncPosition", 3, 0.2f); }
// Use this for initialization void Start() { //if (isLocalPlayer) //{ localplayer.GetComponent <Renderer>().material.color = Color.red; syncPosRequest = GetComponent <SyncPositionRequest>(); syncPlayerRequest = GetComponent <SyncPlayerRequest>(); syncPlayerRequest.DefaultRequest(); InvokeRepeating("SyncPosition", 3, 0.1f); //} }
// Start is called before the first frame update void Start() { player.GetComponent <Renderer>().material.color = Color.green; syncPosRequest = GetComponent <SyncPositionRequest>(); syncPlayerRequest = GetComponent <SyncPlayerRequest>(); syncPlayerRequest.DefaultRequest(); //定时调用某个函数 InvokeRepeating("SyncPosition", 1, moveOff); }
// Use this for initialization void Start() { Renderer renderer = player.GetComponent <Renderer>(); renderer.material.color = Color.green; syncPositionRequest = GetComponent <SyncPositionRequest>(); syncPlayerRequest = FindObjectOfType <SyncPlayerRequest>(); syncPlayerRequest.DefaultRequest(); InvokeRepeating("SyncPosition", 3, 0.1f); }
// Use this for initialization void Start() { foreach (var item in player.GetComponentsInChildren <Renderer>()) { item.material.color = Color.green; } player.GetComponentInChildren <Text>().text = userName; syncPositionRequest = GetComponent <SyncPositionRequest>(); syncPlayerRequest = GetComponent <SyncPlayerRequest>(); syncPlayerRequest.DefaultRequest(); InvokeRepeating("OnSyncPosition", 1, 0.2f); }
void Start() { if (IsLocalPlayer) { GetComponent <Renderer>().material.color = Color.green; syncPositionRequest = GetComponent <SyncPositionRequest>(); InvokeRepeating("syncPosition", 3, 0.05f); GetComponent <SyncPlayerRequest>().DefaultRequest(); fow = GameObject.FindGameObjectWithTag("Fow").GetComponent <Fow>(); byte[] byte1 = new byte [1024]; fow.InitMap(200, 200, byte1); fow.StartFow(this.transform); // fow.StartFow(tower); } }
void Start() { inScene = SceneManager.GetActiveScene().name; if (isLocalPlayer) { userName = PhotonEngine.username; playerDict.Clear(); //GetComponent<Renderer>().material.color = Color.green; SyncPosRequest = GetComponent <SyncPositionRequest>(); syncPlayerRequest = GetComponent <SyncPlayerRequest>(); syncPlayerRequest.DefaultRequse(); InvokeRepeating("SyncPosition", 3, 0.1f); } }
// Use this for initialization private void Awake() { m_syncPosRequest = GetComponent <SyncPositionRequest>(); m_syncPlayerRequest = GetComponent <SyncPlayerRequest>(); }