Exemple #1
0
        public override bool Create(int csvId, string name, Vector2d pos, Vector2d dir, float scale = 1)
        {
            // 通过不同类型,读取不同配置表
            BuffTriggerCsv buffCsv = CsvManager.Inst.GetCsv <BuffTriggerCsv>((int)eAllCSV.eAc_BuffTrigger);

            m_triggerData = buffCsv.GetData(csvId);

            InitPos(ref pos, ref dir);

            if (m_triggerData.ModelResId != 0)
            {
                // 表现
                m_vCreature = VObjectMgr.Create(eVOjectType.SkillTrigger);
                sVOjectBaseInfo info = new sVOjectBaseInfo();
                info.m_resId      = m_triggerData.ModelResId;
                info.m_pos        = pos.ToVector3() + Vector3.up * m_triggerData.vBulletDeltaPos.y;
                info.m_dir        = dir.ToVector3();
                info.m_headHeight = m_triggerData.HeadHeight;
                info.m_showHead   = false;
                m_vCreature.Create(info);
            }

            SetPos(pos, true);
            SetDir(dir);
            SetScale(scale);
            SetSpeed(new FixedPoint(m_triggerData.FlySpeed));

            CFrameTimeMgr.Inst.RegisterEvent(m_triggerData.ContinuanceTime, () =>
            {
                if (!m_destroy)
                {
                    Destory();
                }
            });

            if (m_triggerData.DelayCheckTime == 0)
            {
                m_bStartCheck = true;
                Trigger();
            }
            else
            {
                CFrameTimeMgr.Inst.RegisterEvent(m_triggerData.DelayCheckTime, () =>
                {
                    m_bStartCheck = true;
                    Trigger();
                });
            }
            InitObstacle(pos);
            return(true);
        }
Exemple #2
0
        public virtual void UpdateVO_Create(int resId, float headHeight, eVOjectType type = eVOjectType.Creature)
        {
            if (resId == 0)
            {
                Debug.LogError("严重错误,模型id为空");
                return;
            }

            m_vCreature = VObjectMgr.Create(type);
            if (type == eVOjectType.Creature)
            {
                ((VObject)m_vCreature).UpdateMaster(IsMaster());
            }
            sVOjectBaseInfo info = new sVOjectBaseInfo();

            info.m_uid        = (int)GetUid();
            info.csvId        = m_csvData.Id;
            info.m_resId      = resId;
            info.m_pos        = GetPos().ToVector3();
            info.m_dir        = GetDir().ToVector3();
            info.m_scale      = GetScale();
            info.m_speed      = GetSpeed().value;
            info.m_headHeight = headHeight;
            //if (m_csvData != null)
            //{
            //    info.m_dieSound = m_csvData.dieSound;
            //    info.m_speakId = m_csvData.speakId;
            //    info.m_dieEffect = m_csvData.dieEffect;
            //}
            if (string.IsNullOrEmpty(m_name))
            {
                info.m_showHead = false;
            }
            else
            {
                info.m_showHead = true;
            }
            m_vCreature.Create(info);
        }