public static ConfigMonster GetMonsterConfig(string monsterName, string typeName, string configType = "") { MonsterConfigMetaData monsterConfigMetaDataByKey = MonsterConfigMetaDataReader.GetMonsterConfigMetaDataByKey(monsterName, typeName); string configFile = monsterConfigMetaDataByKey.configFile; string name = configType; if (name == string.Empty) { name = monsterConfigMetaDataByKey.configType; } return(monsterGroupMap[configFile].GetConfig <ConfigMonster>(name)); }
public static string GetPrefabResPath(string monsterName, string typeName, bool useLow = false) { MonsterConfigMetaData monsterConfigMetaDataByKey = MonsterConfigMetaDataReader.GetMonsterConfigMetaDataByKey(monsterName, typeName); string categoryName = monsterConfigMetaDataByKey.categoryName; string subTypeName = monsterConfigMetaDataByKey.subTypeName; ConfigMonster monster = GetMonsterConfig(monsterConfigMetaDataByKey.monsterName, monsterConfigMetaDataByKey.typeName, string.Empty); if (useLow && monster.CommonArguments.HasLowPrefab) { string[] textArray1 = new string[] { "Entities/Monster/", categoryName, "/", subTypeName, "/", subTypeName, "_Low" }; return(string.Concat(textArray1)); } string[] textArray2 = new string[] { "Entities/Monster/", categoryName, "/", subTypeName, "/", subTypeName }; return(string.Concat(textArray2)); }
public override void Init(BaseMonoEntity entity) { this.monster = (BaseMonoMonster)entity; base.runtimeID = this.monster.GetRuntimeID(); this.uniqueMonsterID = this.monster.uniqueMonsterID; string configType = string.Empty; if (this.uniqueMonsterID != 0) { configType = MonsterData.GetUniqueMonsterMetaData(this.uniqueMonsterID).configType; } this.config = MonsterData.GetMonsterConfig(this.monster.MonsterName, this.monster.TypeName, configType); base.commonConfig = this.config.CommonConfig; this.metaConfig = MonsterData.GetMonsterConfigMetaData(this.monster.MonsterName, this.monster.TypeName); base.Init(entity); Singleton <EventManager> .Instance.FireEvent(new EvtMonsterCreated(base.runtimeID), MPEventDispatchMode.Normal); this._paralyzeTimer = new EntityTimer(); this._paralyzeTimer.SetActive(false); this._paralyzeState = ParalyzeState.Idle; base.AddPlugin(new MonsterAIPlugin(this)); this.InitAbilityStateImmune(); this.InitDebuffDurationRatio(); }