//============================================================================// #if UNITY_EDITOR // INITALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); subMenuName = AmpsHelpers.formatEnumString(eCategories.Basic.ToString()); type = "Scalar condition"; SetDefaultName(); useStackValue = ScriptableObject.CreateInstance <BoolProperty>(); useStackValue.Initialize("Use stack value?", true, theOwnerBlueprint); AddProperty(useStackValue, true); valueA = ScriptableObject.CreateInstance <ScalarProperty>(); valueA.Initialize("Value A", 0f, theOwnerBlueprint); AddProperty(valueA, true); condition = ScriptableObject.CreateInstance <DropdownProperty>(); condition.Initialize("Condition", 0, theOwnerBlueprint); condition.SetDataModes(true, false, false, false, false, false); AddProperty(condition, false); valueB = ScriptableObject.CreateInstance <ScalarProperty>(); valueB.Initialize("Value B", 1f, theOwnerBlueprint); AddProperty(valueB, true); valueFalse = ScriptableObject.CreateInstance <ScalarProperty>(); valueFalse.Initialize("Output for FALSE", 1f, theOwnerBlueprint); AddProperty(valueFalse, true); valueTrue = ScriptableObject.CreateInstance <ScalarProperty>(); valueTrue.Initialize("Output for TRUE", 1f, theOwnerBlueprint); AddProperty(valueTrue, true); }
public static void CreateAsset() { // Solution by yoyo // string path = "Assets"; foreach (UnityEngine.Object obj in Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.Assets)) { path = AssetDatabase.GetAssetPath(obj); if (File.Exists(path)) { path = Path.GetDirectoryName(path); } break; } ///////////////////// string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/NewAmpsBlueprint.asset"); Amps.AmpsBlueprint asset = ScriptableObject.CreateInstance <Amps.AmpsBlueprint>(); asset.Initialize(); AssetDatabase.CreateAsset(asset, assetPathAndName); asset.name = "Blueprint"; List <Object> subObjects = asset.GetSubObjects(); foreach (var item in subObjects) { AssetDatabase.AddObjectToAsset(item, assetPathAndName); } AssetDatabase.SaveAssets(); }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // virtual public void Initialize(AmpsBlueprint theOwnerBlueprint, AmpsHelpers.eStackFunction theStackFunction, string theModuleType) { stackFunction = theStackFunction; name = AmpsHelpers.formatEnumString(theStackFunction.ToString()); moduleType = theModuleType; ownerBlueprint = theOwnerBlueprint; }
// INITIALIZE // // override public void Initialize(AmpsBlueprint theOwnerBlueprint, AmpsHelpers.eStackFunction sf, string mt) { base.Initialize(theOwnerBlueprint, sf, mt); isParticleStack = false; isVector3Stack = false; }
// COPY PROPERTY // // virtual public void CopyProperty(BaseProperty originalProperty, AmpsBlueprint theOwnerBlueprint) { // We don't copy non-user-editable properties so their values // don't linger, code updates are followed in already placed properties // after the next blueprint commit. // //name = originalProperty.name; //allowDataModeRandomConstant = originalProperty.allowDataModeRandomConstant; //allowDataModeCurve = originalProperty.allowDataModeCurve; //allowDataModeRandomCurve = originalProperty.allowDataModeRandomCurve; //allowDataModeReference = originalProperty.allowDataModeReference; //allowDataModeParameter = originalProperty.allowDataModeParameter; dataMode = originalProperty.dataMode; reference = originalProperty.reference; parameterName = originalProperty.parameterName; parameter = originalProperty.parameter; if (theOwnerBlueprint != null) { ownerBlueprint = theOwnerBlueprint; } else { ownerBlueprint = originalProperty.ownerBlueprint; } coordSystem = originalProperty.coordSystem; coordSystemConversionMode = originalProperty.coordSystemConversionMode; }
// INITIALIZE // // override public void Initialize(AmpsBlueprint theOwnerBlueprint, AmpsHelpers.eStackFunction sf, string mt) { base.Initialize(theOwnerBlueprint, sf, mt); if (ownerBlueprint.ownerEmitter != null) { values = new Vector4[ownerBlueprint.ownerEmitter.particleIds.Length]; } isParticleStack = true; if (sf == AmpsHelpers.eStackFunction.Acceleration || sf == AmpsHelpers.eStackFunction.Velocity || sf == AmpsHelpers.eStackFunction.Position || sf == AmpsHelpers.eStackFunction.RotationRate || sf == AmpsHelpers.eStackFunction.Rotation || sf == AmpsHelpers.eStackFunction.Scale || sf == AmpsHelpers.eStackFunction.PivotOffset) { isVector3Stack = true; } else { isVector3Stack = false; } }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); subMenuName = AmpsHelpers.formatEnumString(eCategories.Basic.ToString()); type = "Property sampler"; SetDefaultName(); property = ScriptableObject.CreateInstance <DropdownProperty>(); property.Initialize("Property", 0, theOwnerBlueprint); AddProperty(property, true); sampleFromParent = ScriptableObject.CreateInstance <BoolProperty>(); sampleFromParent.Initialize("Sample parent?", false, property.ownerBlueprint); AddProperty(sampleFromParent, true); modifyX = ScriptableObject.CreateInstance <BoolProperty>(); modifyX.Initialize("Modify X?", true, theOwnerBlueprint); AddProperty(modifyX, true); modifyY = ScriptableObject.CreateInstance <BoolProperty>(); modifyY.Initialize("Modify Y?", true, theOwnerBlueprint); AddProperty(modifyY, true); modifyZ = ScriptableObject.CreateInstance <BoolProperty>(); modifyZ.Initialize("Modify Z?", true, theOwnerBlueprint); AddProperty(modifyZ, true); modifyW = ScriptableObject.CreateInstance <BoolProperty>(); modifyW.Initialize("Modify W?", true, theOwnerBlueprint); AddProperty(modifyW, true); }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); subMenuName = ""; type = "Quad renderer"; SetDefaultName(); orientation = ScriptableObject.CreateInstance <DropdownProperty>(); orientation.Initialize("Orientation", 1, theOwnerBlueprint); AddProperty(orientation, false); alignmentVector = ScriptableObject.CreateInstance <VectorProperty>(); alignmentVector.Initialize("Alignment vector", new Vector4(0, 1, 0, 0), theOwnerBlueprint); alignmentVector.hideW = true; AddProperty(alignmentVector, false); normalMode = ScriptableObject.CreateInstance <DropdownProperty>(); normalMode.Initialize("Normal mode", 0, theOwnerBlueprint); AddProperty(normalMode, false); tangentMode = ScriptableObject.CreateInstance <DropdownProperty>(); tangentMode.Initialize("Tangent mode", 0, theOwnerBlueprint); AddProperty(tangentMode, false); uv2Mode = ScriptableObject.CreateInstance <DropdownProperty>(); uv2Mode.Initialize("UV2 mode", 0, theOwnerBlueprint); AddProperty(uv2Mode, false); isDoubleSided = ScriptableObject.CreateInstance <BoolProperty>(); isDoubleSided.Initialize("Double sided?", false, theOwnerBlueprint); AddProperty(isDoubleSided, false); doubleSidedColorMode = ScriptableObject.CreateInstance <DropdownProperty>(); doubleSidedColorMode.Initialize("Backside color mode", 0, theOwnerBlueprint); AddProperty(doubleSidedColorMode, false); }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); samplerCondition = ScriptableObject.CreateInstance <DropdownProperty>(); samplerCondition.Initialize("Sample condition", 0, theOwnerBlueprint); AddProperty(samplerCondition, true); sampleOnSpawn = ScriptableObject.CreateInstance <BoolProperty>(); sampleOnSpawn.Initialize("Sample on spawn?", true, theOwnerBlueprint); AddProperty(sampleOnSpawn, true); interval = ScriptableObject.CreateInstance <ScalarProperty>(); interval.Initialize("Interval", 1, theOwnerBlueprint); interval.SetDataModes(true, false, false, false, true, true); AddProperty(interval, true); intervalOffset = ScriptableObject.CreateInstance <ScalarProperty>(); intervalOffset.Initialize("Initial delay", 0, theOwnerBlueprint); intervalOffset.SetDataModes(true, false, false, false, true, true); AddProperty(intervalOffset, true); directValue = ScriptableObject.CreateInstance <ScalarProperty>(); directValue.Initialize("Direct value", 0, theOwnerBlueprint); directValue.SetDataModes(false, false, true, true, true, true); AddProperty(directValue, true); System.Random theRandom = new System.Random(); randomSeed = theRandom.Next(1, 65536); }
// COPY PROPERTY // // override public void CopyProperty(BaseProperty originalProperty, AmpsBlueprint theOwnerBlueprint) { base.CopyProperty(originalProperty, theOwnerBlueprint); BoolProperty originalBoolProperty = originalProperty as BoolProperty; value = originalBoolProperty.value; }
//============================================================================// #if UNITY_EDITOR // INITALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); subMenuName = AmpsHelpers.formatEnumString(eCategories.Math.ToString()); type = "Normalize"; SetDefaultName(); }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); particleMaterial = ScriptableObject.CreateInstance <MaterialProperty>(); particleMaterial.Initialize("Material"); AddProperty(particleMaterial, false); }
// COPY PROPERTY // // override public void CopyProperty(BaseProperty originalProperty, AmpsBlueprint theOwnerBlueprint) { base.CopyProperty(originalProperty, theOwnerBlueprint); DropdownProperty originalDropdownProperty = originalProperty as DropdownProperty; displayData = originalDropdownProperty.displayData; constant = originalDropdownProperty.constant; }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); modifySpawnRate = ScriptableObject.CreateInstance <BoolProperty>(); modifySpawnRate.Initialize("Modify Spawn rate?", false, theOwnerBlueprint); modifySpawnRate.allowDataModeReference = false; AddProperty(modifySpawnRate, false); modifyDeathCondition = ScriptableObject.CreateInstance <BoolProperty>(); modifyDeathCondition.Initialize("Modify Death condition?", false, theOwnerBlueprint); modifyDeathCondition.allowDataModeReference = false; AddProperty(modifyDeathCondition, false); modifyDeathDuration = ScriptableObject.CreateInstance <BoolProperty>(); modifyDeathDuration.Initialize("Modify Death duration?", false, theOwnerBlueprint); modifyDeathDuration.allowDataModeReference = false; AddProperty(modifyDeathDuration, false); modifyCustomScalar = ScriptableObject.CreateInstance <BoolProperty>(); modifyCustomScalar.Initialize("Modify Custom scalar?", false, theOwnerBlueprint); modifyCustomScalar.allowDataModeReference = false; AddProperty(modifyCustomScalar, false); modifyCustomVector = ScriptableObject.CreateInstance <BoolProperty>(); modifyCustomVector.Initialize("Modify Custom vector?", false, theOwnerBlueprint); modifyCustomVector.allowDataModeReference = false; AddProperty(modifyCustomVector, false); modifyAcceleration = ScriptableObject.CreateInstance <BoolProperty>(); modifyAcceleration.Initialize("Modify Acceleration?", false, theOwnerBlueprint); modifyAcceleration.allowDataModeReference = false; AddProperty(modifyAcceleration, false); modifyVelocity = ScriptableObject.CreateInstance <BoolProperty>(); modifyVelocity.Initialize("Modify Velocity?", false, theOwnerBlueprint); modifyVelocity.allowDataModeReference = false; AddProperty(modifyVelocity, false); modifyPosition = ScriptableObject.CreateInstance <BoolProperty>(); modifyPosition.Initialize("Modify Position?", false, theOwnerBlueprint); modifyPosition.allowDataModeReference = false; AddProperty(modifyPosition, false); modifyRotationRate = ScriptableObject.CreateInstance <BoolProperty>(); modifyRotationRate.Initialize("Modify Rotation rate?", false, theOwnerBlueprint); modifyRotationRate.allowDataModeReference = false; AddProperty(modifyRotationRate, false); modifyRotation = ScriptableObject.CreateInstance <BoolProperty>(); modifyRotation.Initialize("Modify Rotation?", false, theOwnerBlueprint); modifyRotation.allowDataModeReference = false; AddProperty(modifyRotation, false); modifyScale = ScriptableObject.CreateInstance <BoolProperty>(); modifyScale.Initialize("Modify Scale?", false, theOwnerBlueprint); modifyScale.allowDataModeReference = false; AddProperty(modifyScale, false); modifyColor = ScriptableObject.CreateInstance <BoolProperty>(); modifyColor.Initialize("Modify Color?", false, theOwnerBlueprint); modifyColor.allowDataModeReference = false; AddProperty(modifyColor, false); modifyPivotOffset = ScriptableObject.CreateInstance <BoolProperty>(); modifyPivotOffset.Initialize("Modify Pivot offset?", false, theOwnerBlueprint); modifyPivotOffset.allowDataModeReference = false; AddProperty(modifyPivotOffset, false); }
// INITIALIZE // // override public void Initialize(AmpsBlueprint theOwnerBlueprint, AmpsHelpers.eStackFunction sf, string mt) { base.Initialize(theOwnerBlueprint, sf, mt); if (ownerBlueprint.ownerEmitter != null) { values = new float[ownerBlueprint.ownerEmitter.particleIds.Length]; } isParticleStack = true; isVector3Stack = false; }
//============================================================================// #if UNITY_EDITOR // INITALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); subMenuName = AmpsHelpers.formatEnumString(eCategories.Basic.ToString()); type = "Scalar"; SetDefaultName(); value = ScriptableObject.CreateInstance <ScalarProperty>(); value.Initialize("Value", 1f, theOwnerBlueprint); AddProperty(value, true); }
//============================================================================// #if UNITY_EDITOR // INITALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); subMenuName = AmpsHelpers.formatEnumString(eCategories.Math.ToString()); type = "Converter"; SetDefaultName(); conversionMode = ScriptableObject.CreateInstance <DropdownProperty>(); conversionMode.Initialize("Conversion mode", 0, theOwnerBlueprint); AddProperty(conversionMode, true); }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); weight = ScriptableObject.CreateInstance <ScalarProperty>(); weight.Initialize("Weight", 1, theOwnerBlueprint); weight.SetDataModes(true, true, true, true, false, true); AddProperty(weight, false); blendMode = ScriptableObject.CreateInstance <DropdownProperty>(); blendMode.Initialize("Blend mode", 0, theOwnerBlueprint); blendMode.SetDataModes(true, false, false, false, false, false); AddProperty(blendMode, false); }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); subMenuName = AmpsHelpers.formatEnumString(eCategories.Basic.ToString()); type = "Color"; SetDefaultName(); value = ScriptableObject.CreateInstance <ColorProperty>(); value.Initialize("Color", Vector4.one, theOwnerBlueprint); AddProperty(value, true); implementsVisualization = false; }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // virtual public void Initialize(string theName, AmpsBlueprint theOwnerBlueprint) { name = theName; allowDataModeRandomConstant = true; allowDataModeCurve = true; allowDataModeRandomCurve = true; allowDataModeReference = true; dataMode = eDataMode.Constant; reference = null; ownerBlueprint = theOwnerBlueprint; coordSystem = AmpsHelpers.eCoordSystems.World; coordSystemConversionMode = eCoordSystemConversionMode.NoConversion; }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); subMenuName = AmpsHelpers.formatEnumString(eCategories.Basic.ToString()); type = "Vector sampler"; SetDefaultName(); vector = ScriptableObject.CreateInstance <VectorProperty>(); vector.Initialize("Vector", Vector4.zero, theOwnerBlueprint); vector.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.NoConversion; AddProperty(vector, true); }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); subMenuName = AmpsHelpers.formatEnumString(eCategories.Misc.ToString()); type = "Event listener"; SetDefaultName(); eventName = ScriptableObject.CreateInstance <StringProperty>(); eventName.Initialize("Event name", theOwnerBlueprint); eventName.value = "event"; eventName.SetDataModes(true, false, false, false, false, false); AddProperty(eventName, false); untriggeredValue = ScriptableObject.CreateInstance <VectorProperty>(); untriggeredValue.Initialize("Untriggered value", theOwnerBlueprint); AddProperty(untriggeredValue, false); triggeredCustomValue = ScriptableObject.CreateInstance <VectorProperty>(); triggeredCustomValue.Initialize("Triggered value", theOwnerBlueprint); triggeredCustomValue.constant = new Vector4(1, 0, 0, 0); AddProperty(triggeredCustomValue, false); triggerDataMode = ScriptableObject.CreateInstance <DropdownProperty>(); triggerDataMode.Initialize("Trigger data mode", 0, theOwnerBlueprint); triggerDataMode.SetDataModes(true, false, false, false, false, false); AddProperty(triggerDataMode, false); infiniteTriggerCount = ScriptableObject.CreateInstance <BoolProperty>(); infiniteTriggerCount.Initialize("Infinite trigger count?", theOwnerBlueprint); infiniteTriggerCount.value = true; infiniteTriggerCount.SetDataModes(true, false, false, false, false, false); AddProperty(infiniteTriggerCount, false); maxTriggerCount = ScriptableObject.CreateInstance <ScalarProperty>(); maxTriggerCount.Initialize("Max trigger count per loop", 1f, theOwnerBlueprint); maxTriggerCount.SetDataModes(true, false, false, false, false, false); maxTriggerCount.isInteger = true; AddProperty(maxTriggerCount, false); triggerToggle = ScriptableObject.CreateInstance <BoolProperty>(); triggerToggle.Initialize("Does an event toggle?", theOwnerBlueprint); triggerToggle.value = true; triggerToggle.SetDataModes(true, false, false, false, false, false); AddProperty(triggerToggle, false); triggerDuration = ScriptableObject.CreateInstance <ScalarProperty>(); triggerDuration.Initialize("Trigger duration", 1f, theOwnerBlueprint); triggerDuration.SetDataModes(true, true, false, false, false, false); AddProperty(triggerDuration, false); }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); subMenuName = AmpsHelpers.formatEnumString(eCategories.Shapes.ToString()); type = "Point sampler"; SetDefaultName(); point = ScriptableObject.CreateInstance <VectorProperty>(); point.Initialize("Point", Vector4.zero, theOwnerBlueprint); point.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.AsPosition; implementsVisualization = true; AddProperty(point, true); }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); subMenuName = AmpsHelpers.formatEnumString(eCategories.Misc.ToString()); type = "Child control"; SetDefaultName(); value = ScriptableObject.CreateInstance <ScalarProperty>(); value.Initialize("Value", 0f, theOwnerBlueprint); value.SetDataModes(true, false, false, false, false, false); AddProperty(value, false); condition = ScriptableObject.CreateInstance <DropdownProperty>(); condition.Initialize("Condition", 0, theOwnerBlueprint); condition.SetDataModes(true, false, false, false, false, false); AddProperty(condition, false); useCurrentStack = ScriptableObject.CreateInstance <BoolProperty>(); useCurrentStack.Initialize("Current stack?", theOwnerBlueprint); useCurrentStack.value = true; useCurrentStack.SetDataModes(true, false, false, false, false, false); AddProperty(useCurrentStack, false); property = ScriptableObject.CreateInstance <DropdownProperty>(); property.Initialize("Property", 0, theOwnerBlueprint); property.SetDataModes(true, false, false, false, false, false); AddProperty(property, false); propertyVectorComponent = ScriptableObject.CreateInstance <DropdownProperty>(); propertyVectorComponent.Initialize("Component", 0, theOwnerBlueprint); propertyVectorComponent.SetDataModes(true, false, false, false, false, false); AddProperty(propertyVectorComponent, false); action = ScriptableObject.CreateInstance <DropdownProperty>(); action.Initialize("Action", 0, theOwnerBlueprint); action.SetDataModes(true, false, false, false, false, false); AddProperty(action, false); maxEventCount = ScriptableObject.CreateInstance <ScalarProperty>(); maxEventCount.Initialize("Max event count per loop", 1f, theOwnerBlueprint); maxEventCount.SetDataModes(true, false, false, false, false, false); maxEventCount.isInteger = true; AddProperty(maxEventCount, false); minEventDelay = ScriptableObject.CreateInstance <ScalarProperty>(); minEventDelay.Initialize("Min event delay", 0.1f, theOwnerBlueprint); minEventDelay.SetDataModes(true, false, false, false, false, false); AddProperty(minEventDelay, false); }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); subMenuName = ""; type = "Motion tweaker"; SetDefaultName(); modifyAcceleration.value = true; modifyVelocity.value = true; modifyMomentum = ScriptableObject.CreateInstance <BoolProperty>(); modifyMomentum.Initialize("Modify momentum?", true, theOwnerBlueprint); modifyMomentum.allowDataModeReference = false; AddProperty(modifyMomentum, false); modifyDisplacement = ScriptableObject.CreateInstance <BoolProperty>(); modifyDisplacement.Initialize("Modify displacement?", true, theOwnerBlueprint); modifyDisplacement.allowDataModeReference = false; AddProperty(modifyDisplacement, false); accelerationMultiplier = ScriptableObject.CreateInstance <VectorProperty>(); accelerationMultiplier.Initialize("Acceleration multiplier", Vector4.one, theOwnerBlueprint); accelerationMultiplier.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.NoConversion; accelerationMultiplier.allowDataModeReference = false; accelerationMultiplier.hideW = true; AddProperty(accelerationMultiplier, false); momentumMultiplier = ScriptableObject.CreateInstance <VectorProperty>(); momentumMultiplier.Initialize("Momentum multiplier", Vector4.one, theOwnerBlueprint); momentumMultiplier.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.NoConversion; momentumMultiplier.allowDataModeReference = false; momentumMultiplier.hideW = true; AddProperty(momentumMultiplier, false); velocityMultiplier = ScriptableObject.CreateInstance <VectorProperty>(); velocityMultiplier.Initialize("Velocity multiplier", Vector4.one, theOwnerBlueprint); velocityMultiplier.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.NoConversion; velocityMultiplier.allowDataModeReference = false; velocityMultiplier.hideW = true; AddProperty(velocityMultiplier, false); displacementMultiplier = ScriptableObject.CreateInstance <VectorProperty>(); displacementMultiplier.Initialize("Displacement multiplier", Vector4.one, theOwnerBlueprint); displacementMultiplier.coordSystemConversionMode = BaseProperty.eCoordSystemConversionMode.NoConversion; displacementMultiplier.allowDataModeReference = false; displacementMultiplier.hideW = true; AddProperty(displacementMultiplier, false); }
// 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(); }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); subMenuName = AmpsHelpers.formatEnumString(eCategories.Basic.ToString()); type = "Vector"; SetDefaultName(); value = ScriptableObject.CreateInstance <VectorProperty>(); value.Initialize("Value", Vector4.zero, theOwnerBlueprint); value.SetConversionMode(theOwnerStack.stackFunction); value.SetDefaultCoordSystem(theOwnerStack.stackFunction); AddProperty(value, true); implementsVisualization = true; }
//============================================================================// #if UNITY_EDITOR // INITALIZE // // override public void Initialize(BaseStack theOwnerStack, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theOwnerStack, theOwnerBlueprint); subMenuName = AmpsHelpers.formatEnumString(eCategories.Basic.ToString()); type = "Scalar accumulator"; SetDefaultName(); useStackValue = ScriptableObject.CreateInstance <BoolProperty>(); useStackValue.Initialize("Use stack value?", true, theOwnerBlueprint); AddProperty(useStackValue, true); changePerSecond = ScriptableObject.CreateInstance <ScalarProperty>(); changePerSecond.Initialize("Change per second", 1f, theOwnerBlueprint); AddProperty(changePerSecond, true); }
//============================================================================// #if UNITY_EDITOR // INITIALIZE // // public void Initialize() { if (GetComponent <MeshFilter>() == null) { gameObject.AddComponent <MeshFilter>(); } meshFilter = GetComponent <MeshFilter>(); if (GetComponent <MeshRenderer>() == null) { gameObject.AddComponent <MeshRenderer>(); } ResetMesh(); AmpsHelpers.identityMatrix = Matrix4x4.identity; // Set that variable when the emitter is created in the editor. blueprint = null; }
// INITIALIZE // // public void Initialize(string theName, Vector4 v, AmpsBlueprint theOwnerBlueprint) { base.Initialize(theName, theOwnerBlueprint); constant = v; randomMin = Vector4.zero; randomMax = v; curve = ScriptableObject.CreateInstance <VectorCurve>(); curve.Initialize(Vector4.one, theName + "_curve"); curveMin = ScriptableObject.CreateInstance <VectorCurve>(); curveMin.Initialize(Vector4.zero, theName + "_curveMin"); curveMax = ScriptableObject.CreateInstance <VectorCurve>(); curveMax.Initialize(Vector4.one, theName + "_curveMax"); usePerComponentRandom = false; Randomize(); dummyTexture = new Texture2D(1, 1); }