I'm having a lot of trouble with creating custom classes. Particularly for classes within a class.
So the game is almost complete and everything is coded, yet when I save using EasySave 3 there are issues saving a class within a class, so I created a custom class.
For example if this is the class...
Code: Select all
public class SomeManager : MonoBehaviour {
[Serializable]
public class SOME_INNER_CLASS {
// other [NonSerialized] fields here...
public string XToString = "1";
public string YToString = "1";
public string AToString = "1";
// constructor
public SOME_INNER_CLASS(float _XToString, float _YToString, float _Alpha) {
...some things going on here
}
// parameterless constructor created only for the purpose of EasySave3 to accept this class
public SOME_INNER_CLASS() {
...some things going on here
}
}
[Serializable]
public AnotherClass() {
// being used like this
public SOME_INNER_CLASS Sizes = new SOME_INNER_CLASS(_XToString 1f, __YToString: 1f, _Alpha: 1f);
}
}
Second, the second error I get is about namespace...
For example inside the ES3 Type generated script this would error(five same errors total):
Assets/Plugins/Easy Save 3/Custom Types/ES3UserType_SOME_INNER_CLASS.cs(12,53): error CS0246: The type or namespace name 'SomeManager' could not be found (are you missing a using directive or an assembly reference?)
Code: Select all
var instance = (SomeManager.SOME_INNER_CLASS)obj;
Also, it's assuming that everyone created code the same way, ie, use namespaces which isn't always the case for everyone and I didn't know I had to keep this standard when I purchased the asset since it didn't mention it anywhere. Please let me know if I'm mistaken in thinking any of this, I'm just referring back to the information I received from the error.
Oh and I have a second more simple question, I always wanted to ask you about the float type. Does it have the same setback as if I didn't use EasySave3, ie. when you save a float it's not exact and the number can be unpredictable? That's actually why I'm still currently saving floats as a string.
I would appreciate any insight you have on these issues, thank you for your help.