How to create a type for a constructor with a parameter?
Posted: Tue Jul 23, 2019 2:43 am
Hello, I saw in the documentation that users will need to manually modify the ES3TYPE file if you are attempting to create a type from a class that does not have a parameterless constructor. I read the part where it mentions modifying the read and write portions of the type file, but I'm afraid my C# knowledge isn't at the point where I can do this on my own.
I'm attempting to make a type for this class:
My constructor needs to take in another class as the parameter to read the variables off of the current character game object with the CharacterManager script attached to it. Could I get a little help with what I specifically need to modify in order for the CharacterData type to work?
I'm attempting to make a type for this class:
Code: Select all
[System.Serializable]
public class CharacterData
{
public string characterName;
public string currentArmor;
public string currentWeapon;
public string id;
public CharacterData (CharacterManager characterManager)
{
characterName = characterManager.characterName;
currentArmor = characterManager.currentArmor;
currentWeapon = characterManager.currentWeapon;
}
}