You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to RelicData inheriting from UnityEngine.ScriptableObject, calling its constructor is impossible.
RelicDataCustomData=newRelicData(/* parameters here... */);// Errors, impossible to compile// User needs to do this:RelicDataCustomData=ScriptableObject.CreateInstance<RelicData>();CustomData.Name="...";CustomData.Rarity= ...;CustomData.MaxStack= ...;// and so on...
Example of the usage
RelicDataCustomData;CustomData=newRelics.Data(){Name="...",Rarity= ...,MaxStack= ...,// and so on...};CustomData=newRelics.Data("Name",rarity,maxStack, ...);CustomData=Relics.DataFromJson(jsonString);CustomData=Relics.DataFromJson(pathToJson);intID=Relics.Register(CustomData,textureSmall,textureBig);
The text was updated successfully, but these errors were encountered:
What is the addition?
New ways of creating
RelicData
objects.Why?
Due to
RelicData
inheriting fromUnityEngine.ScriptableObject
, calling its constructor is impossible.Example of the usage
The text was updated successfully, but these errors were encountered: