Exemplo n.º 1
0
        private void CreateMainActor(ActorModel actor)
        {
            ActorCnf actorCnf = Config.ActorCnf[actor.id];

            //预制体
            GameObject assetGo = LoadHelper.LoadPrefab(actorCnf.prefab.ObjName);
            GameObject actorGo = GameObject.Instantiate(assetGo);

            actorGo.transform.SetParent(PlayerRoot.transform);

            //添加组件
            PlayerActor = actorGo.AddComponent <ActorObj>();
            PlayerActor.Init(actor, currArea);

            //跟随
            LCECS.ECSLayerLocate.Info.GetSensor <GlobalSensor>(LCECS.SensorType.Global).FollowActor.Value = PlayerActor;
        }
Exemplo n.º 2
0
 public void InitPlayer()
 {
     currentPlayer.Init();
     onPlayerInited?.Invoke();
 }