public override void Create(CharData charData, EntityViewManager viewMap, Vector3 Pos, Quaternion rotation) { _viewMap = viewMap; gameObj = new CreatureEntity(); gameObj.Init(charData, GlobalClient.GameManager.LogicManager); GameObject obj = GlobalClient.prefabData["PlayerActor1"]; gameGo = GameObject.Instantiate(obj, Pos, rotation) as GameObject; actor = gameGo.GetComponent <Actor>(); actor.viewObj = this; if (Game.GameManager.instance.IsHostPlayer()) { actor.SetMaterial(false, false); gameObj.campType = ECampType.Red; } else { actor.SetMaterial(true, false); gameObj.campType = ECampType.Blue; } gameGo.name = charData.entityName; gameTrans = gameGo.transform; gameObj.Position = gameTrans.position; gameObj.Direction = gameTrans.forward; gameObj.Speed = 0.5f; }
/// <summary> /// 初始化游戏 /// </summary> public void Init() { _logicManager = new LogicEntityManager(); _viewManager = new EntityViewManager(); ViewManager.Init(); LogicManager.Init(); }
public override void Create(CharData charData, EntityViewManager viewMap, Vector3 Pos, Quaternion rotation) { _viewMap = viewMap; gameObj = new CreatureEntity(); gameObj.Init(charData, GlobalClient.GameManager.LogicManager); GameObject obj = GlobalClient.prefabData["Soccer"]; GameObject sp = GameObject.Find("SpawnPoint2"); gameGo = GameObject.Instantiate(obj, sp.transform.position, sp.transform.rotation) as GameObject; gameGo.name = charData.entityName; gameTrans = gameGo.transform; }
public virtual void Create(CharData charData, EntityViewManager viewMap, Vector3 Pos, Quaternion rotation) { _viewMap = viewMap; gameObj = new LogicEntity(); gameObj.Init(charData, GlobalClient.GameManager.LogicManager); //gameGo = GameObject.CreatePrimitive(PrimitiveType.Cube); GameObject obj = GlobalClient.prefabData["PlayerActor1"]; gameGo = GameObject.Instantiate(obj, Pos, rotation) as GameObject; gameGo.name = charData.entityName; gameTrans = gameGo.transform; context = new GameContext(); }