- Home /
Default Serialization Values Not Being Set
Hey all,
I feel like there's probably a property or something simple I'm doing wrong on this one. All that's happening is im setting a value such as bool a=true; and its being serialized in a struct. It all shows up in Inspector but the values are all wrong.
Here is the bit of code: public class US_PlayTweenGO : USEventBase {
[System.Serializable]
public class TweenOptions
{
public bool m_PlayReverse = false;
public float m_DurationOfPositionTween = 1.0f;
public float m_DurationOfScaleTween = 1.0f;
public float m_DurationOfAlphaTween = 1.0f;
public bool m_UseOriginalPosDuration=true;
public bool m_UseOriginalScaleDuration = true;
public bool m_UseOriginalAlphaDuration = true;
public bool m_TweenPosition=true;
public bool m_TweenScale = false;
public bool m_TweenAlpha =false;
public bool m_PosPrevEnabled=false;
public bool m_ScalePrevEnabled=false;
public bool m_AlphaPrevEnabled=false;
public float m_OriginalDurationOfPositionTween = 1.0f;
public float m_OriginalDurationOfScaleTween = 1.0f;
public float m_OriginalDurationOfAlphaTween = 1.0f;
public GameObject m_ObjectToTween;
}
public TweenOptions[] m_TweenObjects;
So basically I can add things to the m_TweenObjects array in inspector, once I have something then all the attributes from the class will show up in inspector, but the values will all be 0/false/null.
Any idea what im doing wrong here?
Your answer
Follow this Question
Related Questions
How to serialize an array of classes 1 Answer
Assign script into another script in Inspector 2 Answers
Giving a public Transform field a default value in the inspector 1 Answer
Javascript Serializable Types not showing in inspector 1 Answer
How do I assign 3 variables to every GameObject in the array "enemy"? 2 Answers