// INITIALIZE // // public void Initialize(string theName, float f, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theName, theOwnerBlueprint); constant = f; randomMax = f; curve = ScriptableObject.CreateInstance <ScalarCurve>(); curve.Initialize(f, theName + "_curve"); curveMin = ScriptableObject.CreateInstance <ScalarCurve>(); curveMin.Initialize(f, theName + "_curveMin"); curveMax = ScriptableObject.CreateInstance <ScalarCurve>(); curveMax.Initialize(f, theName + "_curveMax"); isInteger = false; Randomize(); }
// COPY PROPERTY // // override public void CopyProperty(BaseProperty originalProperty, AmpsBlueprint theOwnerBlueprint) { base.CopyProperty(originalProperty, theOwnerBlueprint); ScalarProperty originalScalarProperty = originalProperty as ScalarProperty; constant = originalScalarProperty.constant; randomMin = originalScalarProperty.randomMin; randomMax = originalScalarProperty.randomMax; curve = ScriptableObject.CreateInstance <ScalarCurve>(); curve.Initialize(originalScalarProperty.curve); curveMin = ScriptableObject.CreateInstance <ScalarCurve>(); curveMin.Initialize(originalScalarProperty.curveMin); curveMax = ScriptableObject.CreateInstance <ScalarCurve>(); curveMax.Initialize(originalScalarProperty.curveMax); isInteger = originalScalarProperty.isInteger; Randomize(); }