예제 #1
0
파일: VObjectMgr.cs 프로젝트: mengtest/fs
        public static VBase Create(eVOjectType type)
        {
            VBase obj = null;

            switch (type)
            {
            case eVOjectType.Creature:
                obj = new VObject();
                break;

            case eVOjectType.SkillTrigger:
                obj = new VTrigger();
                break;
            }
            obj.m_id = m_uid++;
            Add(obj.m_id, obj);
            return(obj);
        }
예제 #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);
        }