public static void RestoreDragDropCommands(string s) { if (string.IsNullOrEmpty(s)) { return; } var commands = JsonUtility.FromJson <DragDropCommands>(s); audioDragDropCommand = commands.audioDragDropCommand; gameObjectDragDropCommand = commands.gameObjectDragDropCommand; alternateGameObjectDragDropCommand = commands.alternateGameObjectDragDropCommand; }
private static string GetCurrentGameObjectCommand(GameObjectDragDropCommand command, string goName) { if (string.IsNullOrEmpty(goName)) { return(string.Empty); } switch (command) { default: case GameObjectDragDropCommand.Camera: return("Camera(default," + goName + ")"); case GameObjectDragDropCommand.DOF: return("DOF(" + goName + ")"); case GameObjectDragDropCommand.SetActiveTrue: return("SetActive(" + goName + ",true)"); case GameObjectDragDropCommand.SetActiveFalse: return("SetActive(" + goName + ",false)"); } }
private static void SetAlternateGameObjectDragDropCommand(object data) { alternateGameObjectDragDropCommand = (GameObjectDragDropCommand)data; }
private static void SetGameObjectDragDropCommand(object data) { gameObjectDragDropCommand = (GameObjectDragDropCommand)data; }