public Record(SpreadSheetData.ItemData data) { this.id = data.Id; var stringAsset = AssetDatabase.LoadAssetAtPath <StringAsset>("Assets/HK/AutoAnt/DataSources/StringAsset/Item.asset"); this.name = stringAsset.CreateFinderSafe(data.Name); this.icon = AssetDatabase.LoadAssetAtPath <Texture2D>($"Assets/HK/AutoAnt/Textures/Icon/{data.Icon}.png"); }
public static int ToHash(StringAsset.Finder itemName) { int result; if (!cachedHash.TryGetValue(itemName, out result)) { result = itemName.Get.GetHashCode(); cachedHash.Add(itemName, result); } return(result); }
protected virtual void ApplyProperty(Database.SpreadSheetData.CellEventData data) { var stringAsset = AssetDatabase.LoadAssetAtPath <StringAsset>("Assets/HK/AutoAnt/DataSources/StringAsset/CellEvent.asset"); this.eventName = stringAsset.CreateFinderSafe(data.Name); this.category = (Constants.CellEventCategory)Enum.Parse(typeof(Constants.CellEventCategory), data.Category); this.condition = AssetDatabase.LoadAssetAtPath <CellEventGenerateCondition>($"Assets/HK/AutoAnt/DataSources/CellEvents/Conditions/{data.Condition}.asset"); this.size = data.Size; this.constructionSE = AssetDatabase.LoadAssetAtPath <AudioClip>($"Assets/HK/AutoAnt/DataSources/SE/{data.Constructionse}.mp3"); this.destructionSE = AssetDatabase.LoadAssetAtPath <AudioClip>($"Assets/HK/AutoAnt/DataSources/SE/{data.Destructionse}.mp3"); this.constructionEffect = AssetDatabase.LoadAssetAtPath <GameObject>($"Assets/HK/AutoAnt/Prefabs/Effects/{data.Constructioneffect}.prefab").GetComponent <PoolableEffect>(); this.destructionEffect = AssetDatabase.LoadAssetAtPath <GameObject>($"Assets/HK/AutoAnt/Prefabs/Effects/{data.Destructioneffect}.prefab").GetComponent <PoolableEffect>(); this.gimmickPrefab = AssetDatabase.LoadAssetAtPath <GameObject>($"Assets/HK/AutoAnt/Prefabs/CellEvent/{data.Gimmickprefab}.prefab"); this.visibleAnimation = AssetDatabase.LoadAssetAtPath <GameObject>($"Assets/HK/AutoAnt/Prefabs/Tween/{data.Visibleanimation}.prefab").GetComponent <TweenAnimationAttacher>(); }