override public void ShowGUI(List <ActionParameter> parameters) { location = (VariableLocation)EditorGUILayout.EnumPopup("Source:", location); switch (location) { case VariableLocation.Global: if (AdvGame.GetReferences().variablesManager != null) { variableID = AdvGame.GlobalVariableGUI("PopUp variable:", variableID, VariableType.PopUp); } break; case VariableLocation.Local: if (isAssetFile) { EditorGUILayout.HelpBox("Local variables cannot be accessed in ActionList assets.", MessageType.Info); } else if (localVariables != null) { variableID = AdvGame.LocalVariableGUI("PopUp variable:", variableID, VariableType.PopUp); } else { EditorGUILayout.HelpBox("No 'Local Variables' component found in the scene. Please add an AC GameEngine object from the Scene Manager.", MessageType.Info); } break; case VariableLocation.Component: variables = (Variables)EditorGUILayout.ObjectField("Component:", variables, typeof(Variables), true); variablesConstantID = FieldToID <Variables> (variables, variablesConstantID); variables = IDToField <Variables> (variables, variablesConstantID, false); if (variables != null) { variableID = AdvGame.ComponentVariableGUI("PopUp variable:", variableID, VariableType.PopUp, variables); } break; } GVar _var = GetVariable(); if (_var != null) { numSockets = _var.popUps.Length; if (numSockets == 0) { EditorGUILayout.HelpBox("The selected variable has no values!", MessageType.Warning); } } }
private int ShowVarGUI(int ID) { switch (location) { case VariableLocation.Global: return(AdvGame.GlobalVariableGUI("Global integer:", ID, VariableType.Integer)); case VariableLocation.Local: return(AdvGame.LocalVariableGUI("Local integer:", ID, VariableType.Integer)); case VariableLocation.Component: return(AdvGame.ComponentVariableGUI("Component integer:", ID, VariableType.Integer, variables)); } return(ID); }
protected int ShowVarGUI(int ID, bool changeID) { if (changeID) { switch (location) { case VariableLocation.Global: ID = AdvGame.GlobalVariableGUI("Global integer:", ID, VariableType.Integer); break; case VariableLocation.Local: ID = AdvGame.LocalVariableGUI("Local integer:", ID, VariableType.Integer); break; case VariableLocation.Component: ID = AdvGame.ComponentVariableGUI("Component integer:", ID, VariableType.Integer, variables); break; } } return(ID); }
override public void ShowGUI(List <ActionParameter> parameters) { location = (VariableLocation)EditorGUILayout.EnumPopup("Source:", location); switch (location) { case VariableLocation.Global: if (AdvGame.GetReferences().variablesManager != null) { parameterID = Action.ChooseParameterGUI("Variable:", parameters, parameterID, ParameterType.GlobalVariable); if (parameterID >= 0) { placeholderPopUpLabelDataID = AdvGame.GetReferences().variablesManager.ShowPlaceholderPresetData(placeholderPopUpLabelDataID); if (placeholderPopUpLabelDataID <= 0) { placeholderNumValues = EditorGUILayout.DelayedIntField("Placeholder # of values:", placeholderNumValues); if (placeholderNumValues < 1) { placeholderNumValues = 1; } } } else { variableID = AdvGame.GlobalVariableGUI("PopUp variable:", variableID, VariableType.PopUp); } } break; case VariableLocation.Local: if (isAssetFile) { EditorGUILayout.HelpBox("Local variables cannot be accessed in ActionList assets.", MessageType.Info); } else if (localVariables == null) { EditorGUILayout.HelpBox("No 'Local Variables' component found in the scene. Please add an AC GameEngine object from the Scene Manager.", MessageType.Info); } else { parameterID = Action.ChooseParameterGUI("Variable:", parameters, parameterID, ParameterType.LocalVariable); if (parameterID >= 0) { placeholderPopUpLabelDataID = AdvGame.GetReferences().variablesManager.ShowPlaceholderPresetData(placeholderPopUpLabelDataID); if (placeholderPopUpLabelDataID <= 0) { placeholderNumValues = EditorGUILayout.DelayedIntField("Placeholder # of values:", placeholderNumValues); if (placeholderNumValues < 1) { placeholderNumValues = 1; } } } else { variableID = AdvGame.LocalVariableGUI("PopUp variable:", variableID, VariableType.PopUp); } } break; case VariableLocation.Component: parameterID = Action.ChooseParameterGUI("Variable:", parameters, parameterID, ParameterType.ComponentVariable); if (parameterID >= 0) { placeholderPopUpLabelDataID = AdvGame.GetReferences().variablesManager.ShowPlaceholderPresetData(placeholderPopUpLabelDataID); if (placeholderPopUpLabelDataID <= 0) { placeholderNumValues = EditorGUILayout.DelayedIntField("Placeholder # of values:", placeholderNumValues); if (placeholderNumValues < 1) { placeholderNumValues = 1; } } } else { variables = (Variables)EditorGUILayout.ObjectField("Component:", variables, typeof(Variables), true); variablesConstantID = FieldToID <Variables> (variables, variablesConstantID); variables = IDToField <Variables> (variables, variablesConstantID, false); if (variables != null) { variableID = AdvGame.ComponentVariableGUI("PopUp variable:", variableID, VariableType.PopUp, variables); } } break; } if (parameterID >= 0) { numSockets = placeholderNumValues; PopUpLabelData popUpLabelData = AdvGame.GetReferences().variablesManager.GetPopUpLabelData(placeholderPopUpLabelDataID); if (popUpLabelData != null) { numSockets = popUpLabelData.Length; placeholderNumValues = numSockets; } } else { GVar _var = GetVariable(); if (_var != null) { numSockets = _var.GetNumPopUpValues(); placeholderNumValues = numSockets; placeholderPopUpLabelDataID = _var.popUpID; } } if (numSockets == 0) { EditorGUILayout.HelpBox("The selected variable has no values!", MessageType.Warning); } }
override public void ShowGUI(List <ActionParameter> parameters) { obToReadParameterID = Action.ChooseParameterGUI("Object to record:", parameters, obToReadParameterID, ParameterType.GameObject); if (obToReadParameterID >= 0) { obToReadConstantID = 0; obToRead = null; } else { obToRead = (GameObject)EditorGUILayout.ObjectField("Object to record:", obToRead, typeof(GameObject), true); obToReadConstantID = FieldToID(obToRead, obToReadConstantID); obToRead = IDToField(obToRead, obToReadConstantID, false); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Record:", GUILayout.MaxWidth(100f)); transformLocation = (GlobalLocal)EditorGUILayout.EnumPopup(transformLocation); transformRecordType = (TransformRecordType)EditorGUILayout.EnumPopup(transformRecordType); EditorGUILayout.EndHorizontal(); variableLocation = (VariableLocation)EditorGUILayout.EnumPopup("Variable location:", variableLocation); switch (variableLocation) { case VariableLocation.Global: variableParameterID = Action.ChooseParameterGUI("Record to variable:", parameters, variableParameterID, ParameterType.GlobalVariable); if (variableParameterID < 0) { variableID = AdvGame.GlobalVariableGUI("Record to variable:", variableID, VariableType.Vector3); } break; case VariableLocation.Local: if (!isAssetFile) { variableParameterID = Action.ChooseParameterGUI("Record to variable:", parameters, variableParameterID, ParameterType.LocalVariable); if (variableParameterID < 0) { variableID = AdvGame.LocalVariableGUI("Record to variable:", variableID, VariableType.Vector3); } } else { EditorGUILayout.HelpBox("Local variables cannot be accessed in ActionList assets.", MessageType.Info); } break; case VariableLocation.Component: variableParameterID = Action.ChooseParameterGUI("Record to variable:", parameters, variableParameterID, ParameterType.ComponentVariable); if (variableParameterID >= 0) { variables = null; variablesConstantID = 0; } else { variables = (Variables)EditorGUILayout.ObjectField("Component:", variables, typeof(Variables), true); variablesConstantID = FieldToID <Variables> (variables, variablesConstantID); variables = IDToField <Variables> (variables, variablesConstantID, false); if (variables != null) { variableID = AdvGame.ComponentVariableGUI("Record to variable:", variableID, VariableType.Vector3, variables); } } break; } AfterRunningOption(); }
public override void ShowGUI(List <ActionParameter> parameters) { isPlayer = EditorGUILayout.Toggle("Move Player?", isPlayer); if (isPlayer) { if (KickStarter.settingsManager != null && KickStarter.settingsManager.playerSwitching == PlayerSwitching.Allow) { parameterID = ChooseParameterGUI("Player ID:", parameters, parameterID, ParameterType.Integer); if (parameterID < 0) { playerID = ChoosePlayerGUI(playerID, true); } } } else { parameterID = Action.ChooseParameterGUI("Moveable object:", parameters, parameterID, ParameterType.GameObject); if (parameterID >= 0) { constantID = 0; linkedProp = null; } else { linkedProp = (Moveable)EditorGUILayout.ObjectField("Moveable object:", linkedProp, typeof(Moveable), true); constantID = FieldToID <Moveable> (linkedProp, constantID); linkedProp = IDToField <Moveable> (linkedProp, constantID, false); } } EditorGUILayout.BeginHorizontal(); transformType = (TransformType)EditorGUILayout.EnumPopup(transformType); if (transformType != TransformType.CopyMarker) { toBy = (ToBy)EditorGUILayout.EnumPopup(toBy); } EditorGUILayout.EndHorizontal(); if (transformType == TransformType.CopyMarker) { markerParameterID = Action.ChooseParameterGUI("Marker:", parameters, markerParameterID, ParameterType.GameObject); if (markerParameterID >= 0) { markerID = 0; marker = null; } else { marker = (Marker)EditorGUILayout.ObjectField("Marker:", marker, typeof(Marker), true); markerID = FieldToID <Marker> (marker, markerID); marker = IDToField <Marker> (marker, markerID, false); } } else { setVectorMethod = (SetVectorMethod)EditorGUILayout.EnumPopup("Vector is: ", setVectorMethod); if (setVectorMethod == SetVectorMethod.EnteredHere) { newVectorParameterID = Action.ChooseParameterGUI("Value:", parameters, newVectorParameterID, ParameterType.Vector3); if (newVectorParameterID < 0) { newVector = EditorGUILayout.Vector3Field("Value:", newVector); } } else if (setVectorMethod == SetVectorMethod.FromVector3Variable) { variableLocation = (VariableLocation)EditorGUILayout.EnumPopup("Source:", variableLocation); switch (variableLocation) { case VariableLocation.Global: vectorVarParameterID = Action.ChooseParameterGUI("Vector3 variable:", parameters, vectorVarParameterID, ParameterType.GlobalVariable); if (vectorVarParameterID < 0) { vectorVarID = AdvGame.GlobalVariableGUI("Vector3 variable:", vectorVarID, VariableType.Vector3); } break; case VariableLocation.Local: if (!isAssetFile) { vectorVarParameterID = Action.ChooseParameterGUI("Vector3 variable:", parameters, vectorVarParameterID, ParameterType.LocalVariable); if (vectorVarParameterID < 0) { vectorVarID = AdvGame.LocalVariableGUI("Vector3 variable:", vectorVarID, VariableType.Vector3); } } else { EditorGUILayout.HelpBox("Local variables cannot be accessed in ActionList assets.", MessageType.Info); } break; case VariableLocation.Component: vectorVarParameterID = Action.ChooseParameterGUI("Vector3 variable:", parameters, vectorVarParameterID, ParameterType.ComponentVariable); if (vectorVarParameterID >= 0) { variables = null; variablesConstantID = 0; } else { variables = (Variables)EditorGUILayout.ObjectField("Component:", variables, typeof(Variables), true); variablesConstantID = FieldToID <Variables> (variables, variablesConstantID); variables = IDToField <Variables> (variables, variablesConstantID, false); if (variables != null) { vectorVarID = AdvGame.ComponentVariableGUI("Vector3 variable:", vectorVarID, VariableType.Vector3, variables); } } break; } } clearExisting = EditorGUILayout.Toggle("Stop existing transforms?", clearExisting); } if (transformType == TransformType.CopyMarker || (transformType == TransformType.Translate && toBy == ToBy.To) || (transformType == TransformType.Rotate && toBy == ToBy.To)) { inWorldSpace = EditorGUILayout.Toggle("Act in world-space?", inWorldSpace); if (inWorldSpace && transformType == TransformType.CopyMarker) { EditorGUILayout.HelpBox("The moveable object's scale will be changed in local space.", MessageType.Info); } } transitionTimeParameterID = Action.ChooseParameterGUI("Transition time (s):", parameters, transitionTimeParameterID, ParameterType.Float); if (transitionTimeParameterID < 0) { transitionTime = EditorGUILayout.FloatField("Transition time (s):", transitionTime); } if (transitionTime > 0f) { if (transformType == TransformType.Rotate) { doEulerRotation = EditorGUILayout.Toggle("Euler rotation?", doEulerRotation); } moveMethod = (MoveMethod)EditorGUILayout.EnumPopup("Move method:", moveMethod); if (moveMethod == MoveMethod.CustomCurve) { timeCurve = EditorGUILayout.CurveField("Time curve:", timeCurve); } willWait = EditorGUILayout.Toggle("Wait until finish?", willWait); } AfterRunningOption(); }
public override void ShowGUI(List <ActionParameter> parameters) { invAction = (InvAction)EditorGUILayout.EnumPopup("Method:", invAction); string _label = "Object to instantiate:"; if (invAction == InvAction.Remove) { _label = "Object to delete:"; } ParameterType[] parameterTypes = new ParameterType[2] { ParameterType.GameObject, ParameterType.InventoryItem }; parameterID = Action.ChooseParameterGUI(_label, parameters, parameterID, parameterTypes); if (parameterID >= 0) { constantID = 0; gameObject = null; } else { gameObject = (GameObject)EditorGUILayout.ObjectField(_label, gameObject, typeof(GameObject), true); constantID = FieldToID(gameObject, constantID); gameObject = IDToField(gameObject, constantID, false); } if (invAction == InvAction.Add) { positionRelativeTo = (PositionRelativeTo)EditorGUILayout.EnumPopup("Position relative to:", positionRelativeTo); if (positionRelativeTo == PositionRelativeTo.RelativeToGameObject) { relativeGameObjectParameterID = Action.ChooseParameterGUI("Relative GameObject:", parameters, relativeGameObjectParameterID, ParameterType.GameObject); if (relativeGameObjectParameterID >= 0) { relativeGameObjectID = 0; relativeGameObject = null; } else { relativeGameObject = (GameObject)EditorGUILayout.ObjectField("Relative GameObject:", relativeGameObject, typeof(GameObject), true); relativeGameObjectID = FieldToID(relativeGameObject, relativeGameObjectID); relativeGameObject = IDToField(relativeGameObject, relativeGameObjectID, false); } } else if (positionRelativeTo == PositionRelativeTo.EnteredValue) { relativeVectorParameterID = Action.ChooseParameterGUI("Value:", parameters, relativeVectorParameterID, ParameterType.Vector3); if (relativeVectorParameterID < 0) { relativeVector = EditorGUILayout.Vector3Field("Value:", relativeVector); } } else if (positionRelativeTo == PositionRelativeTo.VectorVariable) { variableLocation = (VariableLocation)EditorGUILayout.EnumPopup("Source:", variableLocation); switch (variableLocation) { case VariableLocation.Global: vectorVarParameterID = Action.ChooseParameterGUI("Vector3 variable:", parameters, vectorVarParameterID, ParameterType.GlobalVariable); if (vectorVarParameterID < 0) { vectorVarID = AdvGame.GlobalVariableGUI("Vector3 variable:", vectorVarID, VariableType.Vector3); } break; case VariableLocation.Local: if (!isAssetFile) { vectorVarParameterID = Action.ChooseParameterGUI("Vector3 variable:", parameters, vectorVarParameterID, ParameterType.LocalVariable); if (vectorVarParameterID < 0) { vectorVarID = AdvGame.LocalVariableGUI("Vector3 variable:", vectorVarID, VariableType.Vector3); } } else { EditorGUILayout.HelpBox("Local variables cannot be accessed in ActionList assets.", MessageType.Info); } break; case VariableLocation.Component: vectorVarParameterID = Action.ChooseParameterGUI("Vector3 variable:", parameters, vectorVarParameterID, ParameterType.ComponentVariable); if (vectorVarParameterID >= 0) { variables = null; variablesConstantID = 0; } else { variables = (Variables)EditorGUILayout.ObjectField("Component:", variables, typeof(Variables), true); variablesConstantID = FieldToID <Variables> (variables, variablesConstantID); variables = IDToField <Variables> (variables, variablesConstantID, false); if (variables != null) { vectorVarID = AdvGame.ComponentVariableGUI("Vector3 variable:", vectorVarID, VariableType.Vector3, variables); } } break; } } spawnedObjectParameterID = ChooseParameterGUI("Send to parameter:", parameters, spawnedObjectParameterID, ParameterType.GameObject); } else if (invAction == InvAction.Replace) { EditorGUILayout.Space(); replaceParameterID = Action.ChooseParameterGUI("Object to delete:", parameters, replaceParameterID, ParameterType.GameObject); if (replaceParameterID >= 0) { replaceConstantID = 0; replaceGameObject = null; } else { replaceGameObject = (GameObject)EditorGUILayout.ObjectField("Object to delete:", replaceGameObject, typeof(GameObject), true); replaceConstantID = FieldToID(replaceGameObject, replaceConstantID); replaceGameObject = IDToField(replaceGameObject, replaceConstantID, false); } } AfterRunningOption(); }
override public void ShowGUI(List <ActionParameter> parameters) { isPlayer = EditorGUILayout.Toggle("Is Player?", isPlayer); if (!isPlayer) { obToMoveParameterID = Action.ChooseParameterGUI("Object to move:", parameters, obToMoveParameterID, ParameterType.GameObject); if (obToMoveParameterID >= 0) { obToMoveID = 0; obToMove = null; } else { obToMove = (GameObject)EditorGUILayout.ObjectField("Object to move:", obToMove, typeof(GameObject), true); obToMoveID = FieldToID(obToMove, obToMoveID); obToMove = IDToField(obToMove, obToMoveID, false); } } markerParameterID = Action.ChooseParameterGUI("Teleport to:", parameters, markerParameterID, ParameterType.GameObject); if (markerParameterID >= 0) { markerID = 0; teleporter = null; } else { teleporter = (Marker)EditorGUILayout.ObjectField("Teleport to:", teleporter, typeof(Marker), true); markerID = FieldToID <Marker> (teleporter, markerID); teleporter = IDToField <Marker> (teleporter, markerID, false); } positionRelativeTo = (PositionRelativeTo)EditorGUILayout.EnumPopup("Position relative to:", positionRelativeTo); if (positionRelativeTo == PositionRelativeTo.RelativeToGameObject) { relativeGameObjectParameterID = Action.ChooseParameterGUI("Relative GameObject:", parameters, relativeGameObjectParameterID, ParameterType.GameObject); if (relativeGameObjectParameterID >= 0) { relativeGameObjectID = 0; relativeGameObject = null; } else { relativeGameObject = (GameObject)EditorGUILayout.ObjectField("Relative GameObject:", relativeGameObject, typeof(GameObject), true); relativeGameObjectID = FieldToID(relativeGameObject, relativeGameObjectID); relativeGameObject = IDToField(relativeGameObject, relativeGameObjectID, false); } } else if (positionRelativeTo == PositionRelativeTo.EnteredValue) { relativeVectorParameterID = Action.ChooseParameterGUI("Value:", parameters, relativeVectorParameterID, ParameterType.Vector3); if (relativeVectorParameterID < 0) { relativeVector = EditorGUILayout.Vector3Field("Value:", relativeVector); } } else if (positionRelativeTo == PositionRelativeTo.VectorVariable) { variableLocation = (VariableLocation)EditorGUILayout.EnumPopup("Source:", variableLocation); switch (variableLocation) { case VariableLocation.Global: vectorVarParameterID = Action.ChooseParameterGUI("Vector3 variable:", parameters, vectorVarParameterID, ParameterType.GlobalVariable); if (vectorVarParameterID < 0) { vectorVarID = AdvGame.GlobalVariableGUI("Vector3 variable:", vectorVarID, VariableType.Vector3); } break; case VariableLocation.Local: if (!isAssetFile) { vectorVarParameterID = Action.ChooseParameterGUI("Vector3 variable:", parameters, vectorVarParameterID, ParameterType.LocalVariable); if (vectorVarParameterID < 0) { vectorVarID = AdvGame.LocalVariableGUI("Vector3 variable:", vectorVarID, VariableType.Vector3); } } else { EditorGUILayout.HelpBox("Local variables cannot be accessed in ActionList assets.", MessageType.Info); } break; case VariableLocation.Component: vectorVarParameterID = Action.ChooseParameterGUI("Vector3 variable:", parameters, vectorVarParameterID, ParameterType.ComponentVariable); if (vectorVarParameterID >= 0) { variables = null; variablesConstantID = 0; } else { variables = (Variables)EditorGUILayout.ObjectField("Component:", variables, typeof(Variables), true); variablesConstantID = FieldToID <Variables> (variables, variablesConstantID); variables = IDToField <Variables> (variables, variablesConstantID, false); if (variables != null) { vectorVarID = AdvGame.ComponentVariableGUI("Vector3 variable:", vectorVarID, VariableType.Vector3, variables); } } break; } } copyRotation = EditorGUILayout.Toggle("Copy rotation?", copyRotation); if (isPlayer) { snapCamera = EditorGUILayout.Toggle("Teleport active camera too?", snapCamera); } if (isPlayer || (obToMove != null && obToMove.GetComponent <Char>())) { recalculateActivePathFind = EditorGUILayout.Toggle("Recalculate pathfinding?", recalculateActivePathFind); } AfterRunningOption(); }