Skip to content

Commit

Permalink
1.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
App24 committed Sep 17, 2023
1 parent ab7c3c1 commit 512e29b
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Assets/RicUtils/Editor/Settings/RicUtils_EditorSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal class RicUtils_EditorSettings : ScriptableObject

public static string version
{
get { return "1.6.1"; }
get { return "1.6.2"; }
}

public static ScriptableEditor[] scriptableEditors
Expand Down
19 changes: 19 additions & 0 deletions Assets/RicUtils/Editor/Utilities/EditorGUIHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,25 @@ public static IntegerField AddIntField(this VisualElement root, EditorContainer<
return intField;
}

public static LongField AddLongField(this VisualElement root, EditorContainer<long> data, string text = "Long", System.Action onSelectionChange = null)
{
var longField = new LongField()
{
label = text,
value = data.Value,
};

longField.RegisterValueChangedCallback(callback =>
{
data.Value = callback.newValue;
onSelectionChange?.Invoke();
});

root.Add(longField);

return longField;
}

public static Toggle AddToggle(this VisualElement root, EditorContainer<bool> data, string text = "Boolean", System.Action onSelectionChange = null)
{
var toggle = new Toggle()
Expand Down
5 changes: 3 additions & 2 deletions Assets/RicUtils/Editor/Windows/GenericEditorWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ private void CreateGUI()

_container = new ScrollView()
{
showHorizontal = false, showVertical = true,
horizontalScrollerVisibility = ScrollerVisibility.Hidden,
verticalScrollerVisibility = ScrollerVisibility.Auto,
};
base.rootVisualElement.Add(_container);

onLoad = null;
soObjectField = rootVisualElement.AddObjectField(scriptableObject, "Scriptable Object", () =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private static void OnLoad()
}
}

private static void CreateManager(System.Type type, DataManagerScriptableObject data=null)
private static void CreateManager(System.Type type, DataManagerScriptableObject data = null)
{
var method = type.GetMethod("CreateManager", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.InvokeMethod | BindingFlags.FlattenHierarchy);
var manager = method.Invoke(null, new object[] { });
Expand Down
2 changes: 1 addition & 1 deletion Assets/RicUtils/Runtime/Scripts/Managers/TimerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private void Update()
{
timers.RemoveAll(g => g == null);

foreach(var timer in timers)
foreach (var timer in timers)
{
timer.Update();
}
Expand Down
6 changes: 3 additions & 3 deletions Assets/RicUtils/Runtime/Scripts/Utilities/GameTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ internal GameTimer(float timer, bool repeat)

internal void Update()
{
if(ended || !started) return;
if (ended || !started) return;

time += Time.deltaTime;
if(time >= Timer)
if (time >= Timer)
{
onTick?.Invoke();
if(!Repeat) ended = true;
if (!Repeat) ended = true;
time -= Timer;
}
}
Expand Down
22 changes: 11 additions & 11 deletions Assets/RicUtils/Runtime/Scripts/Utilities/RicUtilities.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using RicUtils.ScriptableObjects;
using System.IO;
using System.Text.RegularExpressions;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;

namespace RicUtils.Utilities
Expand Down Expand Up @@ -88,14 +88,14 @@ public static void CreateAssetFolder(string folderPath)
}
}
#endif
public static T GetRandomElement<T>(this IEnumerable<T> array)
{
return array.ElementAt(Random.Range(0, array.Count()));
}
public static T GetRandomElement<T>(this IEnumerable<T> array)
{
return array.ElementAt(Random.Range(0, array.Count()));
}

public static T GetRandomElement<T>(this System.Array array)
{
return (T)array.GetValue(Random.Range(0, array.Length));
}
public static T GetRandomElement<T>(this System.Array array)
{
return (T)array.GetValue(Random.Range(0, array.Length));
}
}
}
2 changes: 1 addition & 1 deletion Assets/RicUtils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "io.github.app24.ricutils",
"version": "1.6.1",
"version": "1.6.2",
"displayName": "RicUtils",
"dependencies": {
"com.solidalloy.type-references": "2.16.0"
Expand Down

0 comments on commit 512e29b

Please sign in to comment.