public void ResetParameters() { BoolParameter = false; FloatParameter = 0f; IntParameter = 0; StringParameter = ""; GameObjectParameter = new FsmGameObject(""); Vector2Parameter = new FsmVector2(); Vector3Parameter = new FsmVector3(); RectParamater = new FsmRect(); QuaternionParameter = new FsmQuaternion(); ObjectParameter = new FsmObject(); MaterialParameter = new FsmMaterial(); TextureParameter = new FsmTexture(); ColorParameter = new FsmColor(); EnumParameter = new FsmEnum(); ArrayParameter = new FsmArray(); }
public FunctionCall(FunctionCall source) { FunctionName = source.FunctionName; parameterType = source.parameterType; BoolParameter = new FsmBool(source.BoolParameter); FloatParameter = new FsmFloat(source.FloatParameter); IntParameter = new FsmInt(source.IntParameter); GameObjectParameter = new FsmGameObject(source.GameObjectParameter); ObjectParameter = source.ObjectParameter; StringParameter = new FsmString(source.StringParameter); Vector2Parameter = new FsmVector2(source.Vector2Parameter); Vector3Parameter = new FsmVector3(source.Vector3Parameter); RectParamater = new FsmRect(source.RectParamater); QuaternionParameter = new FsmQuaternion(source.QuaternionParameter); MaterialParameter = new FsmMaterial(source.MaterialParameter); TextureParameter = new FsmTexture(source.TextureParameter); ColorParameter = new FsmColor(source.ColorParameter); EnumParameter = new FsmEnum(source.EnumParameter); ArrayParameter = new FsmArray(source.ArrayParameter); }
public void Init() { if (TargetObject == null) { return; } initialized = true; targetObjectCached = TargetObject.Value; if (TargetObject.UseVariable) { TargetTypeName = TargetObject.TypeName; TargetType = TargetObject.ObjectType; } else if (TargetObject.Value != null) { TargetType = TargetObject.Value.GetType(); TargetTypeName = TargetType.FullName; } if (!string.IsNullOrEmpty(PropertyName)) { memberInfo = ReflectionUtils.GetMemberInfo(TargetType, PropertyName); if (object.ReferenceEquals(memberInfo, null)) { PropertyName = ""; PropertyType = null; ResetParameters(); return; } PropertyType = ReflectionUtils.GetMemberUnderlyingType(memberInfo[memberInfo.Length - 1]); } if (!object.ReferenceEquals(PropertyType, null) && PropertyType.IsEnum && !FsmString.IsNullOrEmpty(StringParameter)) { EnumParameter = new FsmEnum("") { EnumType = PropertyType, Value = (Enum)Enum.Parse(PropertyType, StringParameter.Value) }; StringParameter.Value = null; } }
public FsmProperty(FsmProperty source) { setProperty = source.setProperty; TargetObject = new FsmObject(source.TargetObject); TargetTypeName = source.TargetTypeName; TargetType = source.TargetType; PropertyName = source.PropertyName; PropertyType = source.PropertyType; BoolParameter = new FsmBool(source.BoolParameter); FloatParameter = new FsmFloat(source.FloatParameter); IntParameter = new FsmInt(source.IntParameter); GameObjectParameter = new FsmGameObject(source.GameObjectParameter); StringParameter = new FsmString(source.StringParameter); Vector2Parameter = new FsmVector2(source.Vector2Parameter); Vector3Parameter = new FsmVector3(source.Vector3Parameter); RectParamater = new FsmRect(source.RectParamater); QuaternionParameter = new FsmQuaternion(source.QuaternionParameter); ObjectParameter = new FsmObject(source.ObjectParameter); MaterialParameter = new FsmMaterial(source.MaterialParameter); TextureParameter = new FsmTexture(source.TextureParameter); ColorParameter = new FsmColor(source.ColorParameter); EnumParameter = new FsmEnum(source.EnumParameter); ArrayParameter = new FsmArray(source.ArrayParameter); }
public FsmEnum(FsmEnum source) : base(source) { EnumType = source.EnumType; Value = source.Value; }
public void SetVariable(NamedVariable variable) { if (variable == null) { ResetParameters(); return; } switch (variable.VariableType) { case VariableType.Float: FloatParameter = variable as FsmFloat; break; case VariableType.Int: IntParameter = variable as FsmInt; break; case VariableType.Bool: BoolParameter = variable as FsmBool; break; case VariableType.GameObject: GameObjectParameter = variable as FsmGameObject; break; case VariableType.String: StringParameter = variable as FsmString; break; case VariableType.Vector2: Vector2Parameter = variable as FsmVector2; break; case VariableType.Vector3: Vector3Parameter = variable as FsmVector3; break; case VariableType.Color: ColorParameter = variable as FsmColor; break; case VariableType.Rect: RectParamater = variable as FsmRect; break; case VariableType.Material: MaterialParameter = variable as FsmMaterial; break; case VariableType.Texture: TextureParameter = variable as FsmTexture; break; case VariableType.Quaternion: QuaternionParameter = variable as FsmQuaternion; break; case VariableType.Object: ObjectParameter = variable as FsmObject; break; case VariableType.Array: ArrayParameter = variable as FsmArray; break; case VariableType.Enum: EnumParameter = variable as FsmEnum; break; default: throw new ArgumentOutOfRangeException(); case VariableType.Unknown: break; } }