void OnGUI() { skin = GUI.skin; size = Vector2.zero; if (content == null) { content = new GUIContent(); } ResetToTop(); DrawLabel(SetDataSceneStrings.HeaderLbl); DrawLabel(SetDataSceneStrings.DescriptionLbl); NewLine(); #if !UNITY_WEBPLAYER if (DrawButton(SetDataSceneStrings.SaveAllBtn)) { GDEDataManager.Save(); } if (DrawButton(SetDataSceneStrings.CreateRandomBtn)) { var newItem = new GDESetCustomData(Guid.NewGuid().ToString().Replace("-", "")); newItem.bool_field = Convert.ToBoolean(Random.Range(0, 1)); newItem.int_field = Random.Range(-100, 100); newItem.float_field = Random.Range(-100f, 100f); newItem.description = "My ID is: " + newItem.Key; newItem.vector2_field = new Vector2(Random.Range(0f, 1f), Random.Range(0f, 1f)); newItem.vector3_field = new Vector3(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f)); newItem.color_field = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f)); } if (DrawButton(SetDataSceneStrings.ReloadAllBtn)) { LoadItems(); } #endif if (DrawButton(SetDataSceneStrings.ResetAllBtn)) { singleData.ResetAll(); listData.ResetAll(); twoDListData.ResetAll(); #if !UNITY_WEBPLAYER GDEDataManager.ClearSaved(); #endif } NewLine(2); DrawLabel(SetDataSceneStrings.SingleOrListLbl); NewLine(); if (DrawButton(SetDataSceneStrings.SingleBtn)) { selectedType = DataType.Single; } if (DrawButton(SetDataSceneStrings.ListBtn)) { selectedType = DataType.List; } NewLine(2); DrawLabel(SetDataSceneStrings.TwoDListLbl); NewLine(); if (DrawButton("Bool 2D")) { selectedType = DataType.Bool2D; } if (DrawButton("Int 2D")) { selectedType = DataType.Int2D; } if (DrawButton("Float 2D")) { selectedType = DataType.Float2D; } if (DrawButton("String 2D")) { selectedType = DataType.String2D; } if (DrawButton("Vec2 2D")) { selectedType = DataType.Vec2_2D; } if (DrawButton("Vec3 2D")) { selectedType = DataType.Vec3_2D; } if (DrawButton("Vec4 2D")) { selectedType = DataType.Vec4_2D; } if (DrawButton("Color 2D")) { selectedType = DataType.Color_2D; } if (DrawButton("Custom 2D")) { selectedType = DataType.Custom_2D; } NewLine(2); DrawLabel(SetDataSceneStrings.SetDataLbl); NewLine(3); if (selectedType.Equals(DataType.Single)) { DrawSingleData(); } else if (selectedType.Equals(DataType.List)) { DrawListData(); } else if (selectedType.Equals(DataType.Bool2D)) { DrawBoolData(); } else if (selectedType.Equals(DataType.Int2D)) { DrawIntData(); } else if (selectedType.Equals(DataType.Float2D)) { DrawFloatData(); } else if (selectedType.Equals(DataType.String2D)) { DrawStringData(); } else if (selectedType.Equals(DataType.Vec2_2D)) { DrawVector2Data(); } else if (selectedType.Equals(DataType.Vec3_2D)) { DrawVector3Data(); } else if (selectedType.Equals(DataType.Vec4_2D)) { DrawVector4Data(); } else if (selectedType.Equals(DataType.Color_2D)) { DrawColorData(); } else if (selectedType.Equals(DataType.Custom_2D)) { DrawCustomData(); } }
void OnGUI() { skin = GUI.skin; size = Vector2.zero; if (content == null) { content = new GUIContent(); } ResetToTop(); DrawLabel(SetDataSceneStrings.HeaderLbl); DrawLabel(SetDataSceneStrings.DescriptionLbl); NewLine(); if (DrawButton(SetDataSceneStrings.ResetAllBtn)) { singleData.ResetAll(); listData.ResetAll(); twoDListData.ResetAll(); } NewLine(2); DrawLabel(SetDataSceneStrings.SingleOrListLbl); NewLine(); if (DrawButton(SetDataSceneStrings.SingleBtn)) { selectedType = DataType.Single; } if (DrawButton(SetDataSceneStrings.ListBtn)) { selectedType = DataType.List; } NewLine(2); DrawLabel(SetDataSceneStrings.TwoDListLbl); NewLine(); if (DrawButton("Bool 2D")) { selectedType = DataType.Bool2D; } if (DrawButton("Int 2D")) { selectedType = DataType.Int2D; } if (DrawButton("Float 2D")) { selectedType = DataType.Float2D; } if (DrawButton("String 2D")) { selectedType = DataType.String2D; } if (DrawButton("Vec2 2D")) { selectedType = DataType.Vec2_2D; } if (DrawButton("Vec3 2D")) { selectedType = DataType.Vec3_2D; } if (DrawButton("Vec4 2D")) { selectedType = DataType.Vec4_2D; } if (DrawButton("Color 2D")) { selectedType = DataType.Color_2D; } if (DrawButton("Custom 2D")) { selectedType = DataType.Custom_2D; } NewLine(2); DrawLabel(SetDataSceneStrings.SetDataLbl); NewLine(3); if (selectedType.Equals(DataType.Single)) { DrawSingleData(); } else if (selectedType.Equals(DataType.List)) { DrawListData(); } else if (selectedType.Equals(DataType.Bool2D)) { DrawBoolData(); } else if (selectedType.Equals(DataType.Int2D)) { DrawIntData(); } else if (selectedType.Equals(DataType.Float2D)) { DrawFloatData(); } else if (selectedType.Equals(DataType.String2D)) { DrawStringData(); } else if (selectedType.Equals(DataType.Vec2_2D)) { DrawVector2Data(); } else if (selectedType.Equals(DataType.Vec3_2D)) { DrawVector3Data(); } else if (selectedType.Equals(DataType.Vec4_2D)) { DrawVector4Data(); } else if (selectedType.Equals(DataType.Color_2D)) { DrawColorData(); } else if (selectedType.Equals(DataType.Custom_2D)) { DrawCustomData(); } }