コード例 #1
0
        public void Init(int id, uint excelId)
        {
            List <Dictionary <string, string> > dbs = DBManager.Instance.QuerySqliteRow <string>(GlobalConfig.DBFile, "data_collection", "id", excelId.ToString());

            if (dbs.Count > 0)
            {
                mDBConfig = dbs[0];
                // 帮派BOSS火把
                mGuildBossFireComponent = null;
                if (mDBConfig["class"] == "guild_boss_fire")
                {
                    mGuildBossFireComponent = gameObject.AddComponent <GuildBossFireComponent>();
                    mGuildBossFireComponent.Init((uint)id);
                }

                UpdateModel();

                var collectionObjectBehaviour = gameObject.AddComponent <CollectionObjectBehaviour>();
                collectionObjectBehaviour.Init((uint)id, excelId);

                // 头顶名字
                if (string.IsNullOrEmpty(mDBConfig["head_name"]) == false)
                {
                    UI3DText           textComponent = gameObject.AddComponent <UI3DText>();
                    UI3DText.StyleInfo styleInfo     = new UI3DText.StyleInfo();
                    styleInfo.Offset = DBTextResource.ParseVector3(mDBConfig["head_name_pos_offset"]);
                    textComponent.ResetStyleInfo(styleInfo);
                    textComponent.Text = mDBConfig["head_name"];
                }
            }

            ClientEventMgr.GetInstance().SubscribeClientEvent((int)ClientEvent.CE_SETTING_QUALITY_CHANGED, OnSettingQualityChanged);
        }
コード例 #2
0
ファイル: UIHelper.cs プロジェクト: wuhuolong/MaxBooks
 public static Vector3 GetDBTextResourceVector(string str)
 {
     return(DBTextResource.ParseVector3(str));
 }