Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        protected override void OnShow(object userData)
        {
            base.OnShow(userData);

            m_EntityData = userData as PartnerEntityData;
            if (m_EntityData == null)
            {
                Log.Error("playerEntityData is null");
                return;
            }

            ActorType      actorType = m_EntityData.ActorType;
            BattleCampType campType  = m_EntityData.CampType;

            Actor = new ActorPartner(this, actorType, campType, m_CharacterController,
                                     m_Animator);
            Actor.Init();
            Actor.SetHost(m_EntityData.Host);
        }