コード例 #1
0
        public Vector3 GetHeroModelScale(PERSONMODELVIEWID viewId, int nHeroId)
        {
            HeroModelTransFormInfo heroInfo = GetHeroModelInfo(viewId, nHeroId);

            if (heroInfo == null)
            {
                return(new Vector3(600, 600, 600));
            }
            else
            {
                return(heroInfo.Scale);
            }
        }
コード例 #2
0
        public Vector3 GetHeroModelPosition(PERSONMODELVIEWID viewId, int nHeroId)
        {
            HeroModelTransFormInfo heroInfo = GetHeroModelInfo(viewId, nHeroId);

            if (heroInfo == null)
            {
                return(new Vector3(50, -600, -400));
            }
            else
            {
                return(heroInfo.Position);
            }
        }
コード例 #3
0
        public Vector3 GetHeroModelRotation(PERSONMODELVIEWID viewId, int nHeroId)
        {
            HeroModelTransFormInfo heroInfo = GetHeroModelInfo(viewId, nHeroId);

            if (heroInfo == null)
            {
                return(new Vector3(0, 180, 0));
            }
            else
            {
                return(heroInfo.Rotation);
            }
        }
コード例 #4
0
        public HeroModelTransFormInfo GetHeroModelInfo(PERSONMODELVIEWID viewId, int nHeroId)
        {
            if (allPersonModelTransFormInfoTable == null || !allPersonModelTransFormInfoTable.ContainsKey((int)viewId))
            {
                return(null);
            }

            ViewHeroModelInfo viewInfo = allPersonModelTransFormInfoTable[(int)viewId] as ViewHeroModelInfo;

            if (viewInfo == null || !viewInfo.dicAllViewHeroModel.ContainsKey(nHeroId))
            {
                return(null);
            }

            HeroModelTransFormInfo heroInfo = viewInfo.dicAllViewHeroModel[nHeroId];

            return(heroInfo);
        }
コード例 #5
0
        // 初始化csv表
        protected void InitPersonModelTransFormInfoCsv(string stPath)
        {
            // string stSchemeAllText = File.ReadAllText(stPath);
            ScpReader reader = new ScpReader(stPath, true, 2);

            allPersonModelTransFormInfoTable = new Hashtable();
            int nIndex = 0;

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                nIndex = 0;

                HeroModelTransFormInfo singleHeroInfo = new HeroModelTransFormInfo();

                singleHeroInfo.nHeroId = reader.GetInt(i, (int)nIndex++, 0);
                int nViewId = reader.GetInt(i, (int)nIndex++, 0);
                singleHeroInfo.Position.x = reader.GetFloat(i, (int)nIndex++, 0);
                singleHeroInfo.Position.y = reader.GetFloat(i, (int)nIndex++, 0);
                singleHeroInfo.Position.z = reader.GetFloat(i, (int)nIndex++, 0);
                singleHeroInfo.Rotation.x = reader.GetInt(i, (int)nIndex++, 0);
                singleHeroInfo.Rotation.y = reader.GetInt(i, (int)nIndex++, 0);
                singleHeroInfo.Rotation.z = reader.GetInt(i, (int)nIndex++, 0);
                singleHeroInfo.Scale.x    = reader.GetFloat(i, (int)nIndex++, 0);
                singleHeroInfo.Scale.y    = reader.GetFloat(i, (int)nIndex++, 0);
                singleHeroInfo.Scale.z    = reader.GetFloat(i, (int)nIndex++, 0);

                if (!allPersonModelTransFormInfoTable.ContainsKey(nViewId))
                {
                    ViewHeroModelInfo ViewHeroInfo = new ViewHeroModelInfo();
                    ViewHeroInfo.dicAllViewHeroModel[singleHeroInfo.nHeroId] = singleHeroInfo;
                    ViewHeroInfo.nViewId = nViewId;
                    allPersonModelTransFormInfoTable[ViewHeroInfo.nViewId] = ViewHeroInfo;
                }
                else
                {
                    ViewHeroModelInfo ViewHeroInfo = allPersonModelTransFormInfoTable[nViewId] as ViewHeroModelInfo;
                    ViewHeroInfo.dicAllViewHeroModel[singleHeroInfo.nHeroId] = singleHeroInfo;
                }
            }
        }