private void InstanceUnLoadObj(KBEngine.Entity entity) { if (entity.className == "Avatar") { KBEngine.Avatar avatar = (KBEngine.Avatar)entity; GameObject obj = (GameObject)Resources.Load("Prefabs/AvatarPlayer"); obj = Instantiate(obj, avatar.position, Quaternion.identity) as UnityEngine.GameObject; SpaceData.Instance.SpacePlayers.Add(((KBEngine.Avatar)entity).componentFrameSync); SpaceData.Instance.SpacePlayers = SpaceData.Instance.SpacePlayers.OrderBy(s => s.seatNo).ToList(); if (avatar.teamID == CommonConfigs.RED_TEAM_ID) { //变换头发 } obj.transform.forward = avatar.direction; if (entity.isPlayer()) { AvatarPlayer = obj; AvatarPlayer.name = PlayerCommonName.AvatarPlayerName; AddCameraFllow(); AddController(); // Debug.Log("entity_entity_entity:::" + entity.id + ",CurWeapon:::" + GameManager.Instance.CurWeapon); } FrameSyncManager.InitPlayerBehaviour(obj, avatar); entity.renderObj = obj; AddBattleRelateData(entity, obj); Debug.Log("name::" + avatar.name + " ,entity.id::" + entity.id + " ,position::" + avatar.position + ",direction::" + avatar.direction); return; } }
private void Awake() { instance = this; lockedTimeStep = FrameSyncGlobalConfig.lockedTimeStep; FPRandom.Init(); }
/// <summary> /// 切换到结束场景 /// </summary> public void onEnding() { gameState = E_GameState.GS_ENDING; for (int i = 0; i < BeforeEnterBattleObjs.Count; i++) { FrameSyncManager.RemovePlayer(BeforeEnterBattleObjs[i].id); } SceneManager.LoadScene(SceneComNames.Ending, LoadSceneMode.Single); Debug.Log("Ending_Scene start."); }
private void Awake() { FrameSyncManager.m_instance = this; }