Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 /// <summary>
 /// 初始化游戏
 /// </summary>
 public void Init()
 {
     _logicManager = new LogicEntityManager();
     _viewManager  = new EntityViewManager();
     ViewManager.Init();
     LogicManager.Init();
 }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        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();
        }