protected virtual void DoSetOperation() { if (variable == null) { return; } if (variable.GetType() == typeof(BooleanVariable)) { BooleanVariable booleanVariable = (variable as BooleanVariable); booleanVariable.Apply(setOperator, booleanData.Value); } else if (variable.GetType() == typeof(IntegerVariable)) { IntegerVariable integerVariable = (variable as IntegerVariable); integerVariable.Apply(setOperator, integerData.Value); } else if (variable.GetType() == typeof(FloatVariable)) { FloatVariable floatVariable = (variable as FloatVariable); floatVariable.Apply(setOperator, floatData.Value); } else if (variable.GetType() == typeof(StringVariable)) { StringVariable stringVariable = (variable as StringVariable); var flowchart = GetFlowchart(); stringVariable.Apply(setOperator, flowchart.SubstituteVariables(stringData.Value)); } else if (variable.GetType() == typeof(GameObjectVariable)) { GameObjectVariable gameObjectVariable = (variable as GameObjectVariable); gameObjectVariable.Apply(setOperator, gameObjectData.Value); } }
protected override bool EvaluateCondition() { if (variable == null) { return(false); } bool condition = false; if (variable.GetType() == typeof(BooleanVariable)) { BooleanVariable booleanVariable = (variable as BooleanVariable); condition = booleanVariable.Evaluate(compareOperator, booleanData.Value); } else if (variable.GetType() == typeof(IntegerVariable)) { IntegerVariable integerVariable = (variable as IntegerVariable); condition = integerVariable.Evaluate(compareOperator, integerData.Value); } else if (variable.GetType() == typeof(FloatVariable)) { FloatVariable floatVariable = (variable as FloatVariable); condition = floatVariable.Evaluate(compareOperator, floatData.Value); } else if (variable.GetType() == typeof(StringVariable)) { StringVariable stringVariable = (variable as StringVariable); condition = stringVariable.Evaluate(compareOperator, stringData.Value); } else if (variable.GetType() == typeof(GameObjectVariable)) { GameObjectVariable gameObjectVariable = (variable as GameObjectVariable); condition = gameObjectVariable.Evaluate(compareOperator, gameObjectData.Value); } return(condition); }
public GameObjectData(GameObject v) { gameObjectVal = v; gameObjectRef = null; }