Skip to content

Commit

Permalink
Clean up using statements
Browse files Browse the repository at this point in the history
  • Loading branch information
bgk- committed Jul 25, 2024
1 parent d453324 commit 8de4135
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Editor/TopiEnumReferenceDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property)
var enumObjField = new PropertyField(enumObjectProperty);
var dropdownField = new PopupField<string>("Value", new List<string>(), 0);

enumObjField.RegisterCallback<ChangeEvent<Object>>(evt =>
enumObjField.RegisterCallback<ChangeEvent<Object>>(_ =>
{
var enumObject = enumObjectProperty.objectReferenceValue as EnumObject;
if (enumObject == null) return;
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Can be installed via the Package Manager > Add Package From Git URL...

This repo has a dependency on the EvtVariable package which MUST be installed first. (From my understanding Unity does not allow git urls to be used as dependencies of packages) https://github.com/peartreegames/evt-variables.git

This package also depends on the Unity Addressables package, which should automatically be installed, but if you any issues please install it manually from the Package Manager.
This package also depends on the Unity Addressables package, which should automatically be installed, but if you have any issues please install it manually from the Package Manager.

then the repo can be added

Expand Down Expand Up @@ -153,7 +153,7 @@ value.Bool // true

## EvtVariables

I've made [EvtVariables](https://github.com/peartreegames/evt-variables), a scriptableobject event system architecture, a dependency of this package.
I've made [EvtVariables](https://github.com/peartreegames/evt-variables), a ScriptableObject event system architecture, a dependency of this package.
Though it isn't actually necessary, a lot of my tools use it.
If you prefer not to keep it, please feel free to fork this repo and remove it.

Expand Down
1 change: 0 additions & 1 deletion Runtime/Choice.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Runtime.InteropServices;
using UnityEngine;

namespace PeartreeGames.Topiary.Unity
{
Expand Down
3 changes: 1 addition & 2 deletions Runtime/Dialogue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Runtime.InteropServices;
using AOT;
using PeartreeGames.Evt.Variables;
using Sirenix.OdinInspector;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
Expand Down Expand Up @@ -32,10 +31,10 @@ public class Dialogue : MonoBehaviour
public static event Action<Dialogue, Choice[]> OnChoices;
public static event Action<Dialogue, string, TopiValue> OnValueChanged;

[ShowInInspector]
public static readonly State State = new();
public static readonly Dictionary<string, Speaker> Speakers = new();
public static readonly Dictionary<IntPtr, Dialogue> Dialogues = new();

private static readonly Dictionary<string, EvtVariable> Variables = new();
private static readonly Dictionary<string, Delegate> Callbacks = new();
private static readonly List<TopiAttribute.FuncPtr> FunctionPtrs = new();
Expand Down
2 changes: 0 additions & 2 deletions Runtime/Library.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace PeartreeGames.Topiary.Unity
{
Expand Down
2 changes: 0 additions & 2 deletions Runtime/Line.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Runtime.InteropServices;
using UnityEngine;
using IntPtr = System.IntPtr;

namespace PeartreeGames.Topiary.Unity
{
Expand Down
2 changes: 1 addition & 1 deletion Runtime/ScriptableObjects/List/EvtTopiVariableList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace PeartreeGames.Topiary.Unity
{
public class EvtTopiVariableList<T> : EvtVariableList<T>
public abstract class EvtTopiVariableList<T> : EvtVariableList<T>
{
public new void Add(T item) => Value.Add(item);
public new void Remove(T item) => Value.Remove(item);
Expand Down
4 changes: 0 additions & 4 deletions Runtime/State.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
using Newtonsoft.Json.Linq;
using Sirenix.OdinInspector;
using UnityEngine;

namespace PeartreeGames.Topiary.Unity
{
public class State
{
private JObject _rootState;
[ShowInInspector]
public string Value => _rootState?.ToString();

/// <summary>
Expand All @@ -16,7 +13,6 @@ public class State
/// <param name="jsonString"></param>
public void Amend(string jsonString)
{
Debug.Log($"jsonString: {jsonString}");
if (_rootState == null) _rootState = JObject.Parse(jsonString);
else
{
Expand Down
4 changes: 2 additions & 2 deletions Runtime/TopiAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public class TopiAttribute : Attribute
/// <summary>
/// Gets or sets the name of the function in the topi file.
/// </summary>
public string Name { get; private set; }
public string Name { get; }

public byte Arity { get; private set; }
public byte Arity { get; }

/// <summary>
/// Declare the function as an extern topi function
Expand Down

0 comments on commit 8de4135

Please sign in to comment.