public int AddPartner(ActorPlayer host, PartnerSortType sortPos, int typeId)
        {
            if (typeId <= 0)
            {
                return(0);
            }

            if (host == null)
            {
                return(0);
            }

            int entityId           = GameEntry.Entity.GenerateSerialId();
            PartnerEntityData data = new PartnerEntityData(entityId, typeId, ActorType.Partner, BattleCampType.Ally, host, sortPos);

            Vector3 pPos = host.GetPartnerPosBySort(sortPos);

            data.Position = pPos;
            data.Rotation = host.CachedTransform.rotation;
            data.Scale    = Vector3.one * 1.5f;

            AddRole <PartnerRole>(data);

            return(entityId);
        }
Exemple #2
0
        protected override void OnUpdate(IFsm <ActorBase> fsm, float elapseSeconds, float realElapseSeconds)
        {
            base.OnUpdate(fsm, elapseSeconds, realElapseSeconds);

            ActorPlayer host = m_Owner.Host as ActorPlayer;

            if (host == null)
            {
                return;
            }

            Vector3 pos = host.GetPartnerPosBySort(m_Owner.Sort);

            m_Owner.ExecuteCommand(new AutoMoveCommand(pos, OnFollowFinished));
        }