// Start is called before the first frame update void Start() { _hellforge = new HellforgeAggregate(); _hellforge.LoadData(Application.dataPath + "/HellforgeData/Diablo4"); var barbTree = _hellforge.GameData.TalentTrees.First(x => x.Class == "Barbarian"); if (barbTree != null) { InstantiateTalentTree(barbTree); } }
private void Awake() { GameObject.DontDestroyOnLoad(this); var dataPath = Application.dataPath + "/RuntimeAssets/HellforgeData/Diablo4"; Hellforge = new HellforgeAggregate(); Hellforge.LoadData(dataPath); Hellforge.LuaContext.RegisterFunction("print", typeof(D4Data).GetMethod("Print")); RefreshCharacterList(); }
public void Initialize(HellforgeAggregate hellforge, IHellforgeEntity entity = null) { // todo :This init shit is dumb.. isnt' it if (_initialized) { throw new Exception("Don't initialize character twice"); } Hellforge = hellforge; Entity = entity; foreach (AttributeName attr in Enum.GetValues(typeof(AttributeName))) { Attributes.Add(attr, 0); } foreach (var point in Allocations.Points) { if (point.Type == AllocationType.Talent) { AddAffix(point.Identifier, point.Amount - 1, 100); } } foreach (var item in Items) { item.Initialize(this); if (item.Equipped) { item.Equip(); } } _initialized = true; }