Ejemplo n.º 1
0
        public PoseRoleData(int entityId, int typeId, ProfessionType professionType)
            : base(entityId, typeId)
        {
            m_ProfessionType = professionType;

            IDataTable <DRPoseRole> dtPoseRole = GameEntry.DataTable.GetDataTable <DRPoseRole>();
            DRPoseRole drPoseRole = dtPoseRole.GetDataRow(TypeId);

            if (drPoseRole == null)
            {
                return;
            }

            m_ProfessionType = (ProfessionType)drPoseRole.ProfessionType;
            m_Effect01Data   = new EffectData(GameEntry.Entity.GenerateTempSerialId(), drPoseRole.Effect01, drPoseRole.Effect01Duration, drPoseRole.Effect01Delay);
            m_Effect02Data   = new EffectData(GameEntry.Entity.GenerateTempSerialId(), drPoseRole.Effect02, drPoseRole.Effect02Duration, drPoseRole.Effect02Delay);
            m_SoundId        = drPoseRole.SoundId;
            m_SoundDelay     = drPoseRole.SoundDelay;
        }
Ejemplo n.º 2
0
        protected override void OnShow(object userData)
        {
            base.OnShow(userData);

            m_effectData = userData as EffectData;
            if (m_effectData == null)
            {
                Log.Error("Effect Data is invalid.");
                return;
            }

            Name = string.Format("{0}[{1}]", m_effectData.TypeId, m_effectData.Id);

            CachedTransform.position      = m_effectData.Position;
            CachedTransform.localPosition = m_effectData.LocalPosition;
            CachedTransform.rotation      = m_effectData.Rotation;
            CachedTransform.localScale    = m_effectData.Scale;
            m_ElapseSeconds = 0f;
        }
Ejemplo n.º 3
0
        private void AddEffect()
        {
            if (Data.EffectID == 0)
            {
                return;
            }

            m_EntityId = GameEntry.Entity.GenerateTempSerialId();
            EffectData effectdata = new EffectData(m_EntityId, Data.EffectID)
            {
                BindType  = (EffectBindType)Data.EffectBind,
                DeadType  = (FlyObjDeadType)Data.DestroyType,
                FlyType   = FlyObjFlyType.Stay,
                KeepTime  = Data.LifeTime,
                Owner     = m_Owner,
                Parent    = m_Owner.CachedTransform,
                SetParent = true
            };

            GameEntry.Entity.ShowEffect(effectdata);
        }
Ejemplo n.º 4
0
 public static void ShowEffect(this EntityComponent entityComponent, EffectData data)
 {
     entityComponent.ShowEntity(typeof(Effect), "Effect", Constant.AssetPriority.EffectAsset, data);
 }
Ejemplo n.º 5
0
 //-----------------简化调用函数----------------
 public static void ShowEffect(this EntityComponent entityComponent, EffectData data)
 {
     entityComponent.ShowEntity(typeof(Effect), data);
 }