void Start() { _syncPositionRequest = GetComponent <SyncPositionRequest>(); _syncPlayerRequest = GetComponent <SyncPlayerRequest>(); _syncPlayerRequest.DefaultRequest(); InvokeRepeating("SyncPositon", 3f, 0.02f); }
// Use this for initialization void Start() { snycPositionRequest = GetComponent <SnycPositionRequest>(); syncPlayerRequest = GetComponent <SyncPlayerRequest>(); syncPlayerRequest.DefaultRequest(); player.GetComponent <Renderer>().material.color = Color.green; InvokeRepeating("SyncPosition", 3, 0.2f); }
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); }
private void Start() { if (isLocalPlayer) { GetComponent <Renderer>().material.color = Color.green; _syncPosRequest = GetComponent <SyncPosRequest>(); _syncPlayerRequest = GetComponent <SyncPlayerRequest>(); _syncPlayerRequest.DefaultRequest(); InvokeRepeating(nameof(SyncPosition), 3f, 0.05f); } }
// 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); //} }
void Start() { if (isLoacalPlayer) { syncPosRq = GetComponent <SyncPosRequest>(); syncPlayerRq = GetComponent <SyncPlayerRequest>(); syncPlayerRq.DefaultRequest(); player.GetComponent <Renderer>().material.color = Color.green; InvokeRepeating("SyncPosition", 1, 0.05f); } }
// 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() { 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); } }
void Start() { aniSpeed = 1; Spriteslider.mundo = this; ETCJoystick.anima = GameObject.FindWithTag("Player").GetComponent <Mundo>(); syncPlayerRequest = GameObject.FindGameObjectWithTag("UI").GetComponent <SyncPlayerRequest>(); easyTouch = GameObject.FindWithTag("EasyTouch"); syncPlayerRequest.DefaltRequest(); spriteslider = GameObject.FindWithTag("UI").GetComponent <Spriteslider>(); overRequest = GameObject.FindWithTag("UI").GetComponent <GameOverRequest>(); //将this Object 上面的Component赋值给定义的AudioSource source = GetComponent <AudioSource>(); source.volume = Setting.Sound; cc = GetComponent <CharacterController>(); ani = GetComponent <Animator>(); postion = GetComponent <Transform>(); stick = GameObject.FindWithTag("Q Joystick").GetComponent <ETCJoystick>(); mainStick = GameObject.FindWithTag("Main Joystick").GetComponent <ETCJoystick>(); m_image = GameObject.FindWithTag("QMask").GetComponent <Image>(); syncCharacter = GetComponent <SyncPlayDataRequest>(); InvokeRepeating("SyncPlayData", 0, 0.01f); GameSetup(); }
void Start() { SoundSetup(); userNameRequest = GetComponent <UserNameRequest>(); userNameRequest.DefaltRequest(); userNameSet = GetComponent <UserNameSetRequest>(); roomCreateRequest = GetComponent <RoomCreateRequest>(); refreshRoomListRequest = GetComponent <RefreshRoomListRequest>(); syncPlayerRequest = GetComponent <SyncPlayerRequest>(); mainUI = GetComponent <UIPanel>().ui; list = UIPackage.CreateObject("Lobby", "List").asCom; list_sub = UIPackage.CreateObject("Lobby", "List_sub").asCom; sub = list_sub.GetChild("n0").asList; Alert = UIPackage.CreateObject("Lobby", "Alert").asCom; roomList = UIPackage.CreateObject("Lobby", "RoomList").asCom; //监听按钮 mainUI.GetChild("mainButton").onClick.Set(() => { mainUI.GetChild("mainButton").visible = false; OpenList(); }); mainUI.GetChild("n3").onClick.Set(() => { CloseList(); }); }
// Use this for initialization private void Awake() { m_syncPosRequest = GetComponent <SyncPositionRequest>(); m_syncPlayerRequest = GetComponent <SyncPlayerRequest>(); }