protected void SendEvent(GameEngine.Event e) { if (m_owner != null) { m_owner.SendEvent(e); } }
void OnPlayerMove(GameEngine.Event evt) { GameProtos.common.Move move = (evt as PlayerActionEvent).moveData; int myID = proxyMgr.GetProxy <AccountProxy>().ID; if (myID != move.Id && players.ContainsKey(move.Id)) { players[move.Id].SyncPosition(new Vector3(move.X, move.Y, move.Z)); } }
void OnJoinSucess(GameEngine.Event evt) { GameProtos.common.NewUser newUser = (evt as RoomEvent).newUser; Debug.Log("new user: " + newUser.Name); GameProtos.common.NewUser playerData = (evt as RoomEvent).newUser; if (players.ContainsKey(playerData.Uid)) { return; } Player player = Instantiate(playerPrefab).GetComponent <Player>(); int myID = proxyMgr.GetProxy <AccountProxy>().ID; player.Init(playerData.Uid, playerData.Name, newUser.Uid == myID); players.Add(newUser.Uid, player); }
void OnAllMembers(GameEngine.Event evt) { var members = (evt as RoomEvent).allMembers.Members; int myID = proxyMgr.GetProxy <AccountProxy>().ID; for (int i = 0; i < members.Count; i++) { int uid = int.Parse(members[i]); if (players.ContainsKey(uid)) { continue; } Player player = Instantiate(playerPrefab).GetComponent <Player>(); player.Init(uid, members[i], myID == uid); players.Add(uid, player); } }
void OnJoinSucess(GameEngine.Event loginEvent) { btnJoin.SetActive(false); }
void OnLoginSucess(GameEngine.Event loginEvent) { SceneManager.LoadScene("Game"); }
public void SendEvent(GameEngine.Event e) { ProxyMgr.Instance.EventManager.SendEvent(e); }
public void SendEvent(GameEngine.Event e) { EventManager.SendEvent(e); }