示例#1
0
        public IEntity CreatePlayer(BaseEntityInfo info, AnimationEventStates animationEventStates)
        {
            LevelBase level = Global.NodeGraphMgr.WorldLevelRoot.ActorLevel;

            ActorImplNode actorMain = Global.FactoryMgr.CreatePoolComponent <ActorImplNode>(ePath.Actor, info.AssetInfo.SpriteName,
                                                                                            info.AssetInfo.Position, info.AssetInfo.Rotation, level.transform);


            //actorMain.Initialize(playMakerFsm, animationEventStates);

            ActorRoot actor = new ActorRoot();

            actorMain.Lock();
            actor.AttachChild(actorMain);

            IEntity entity = MakePlayer(info, actorMain);

            if (info.CombatType == eCombatType.Hero)
            {
                m_hero = entity as Hero;
            }
            else if (info.CombatType == eCombatType.Monster)
            {
            }


            AttachActor(level, actor);

            return(entity);
        }
示例#2
0
        public IEntity MakeActor_Editor(BaseEntityInfo info, AnimationEventStates animationEventStates)
        {
            IEntity actor = m_gameRepository.CreatePlayer(info, animationEventStates);

            if (actor != null)
            {
                if (info.IsUser)
                {
                    AudioListenerSingle.Instance.transform.SetParent(actor.Main.transform, false);
                }
                else
                {
                    m_gameRepository.Insert(actor);
                }
            }

            return(actor);
        }