Skip to content

Commit ccdc0cf

Browse files
committed
Add array mutable and immutable variables
1 parent a76ee57 commit ccdc0cf

File tree

176 files changed

+1969
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+1969
-95
lines changed

Packages/SOVariables/Editor/Array.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace RaCoding.Variables
2+
{
3+
public abstract class ArrayVariableEditor<T> : VariableEditor<T>
4+
{
5+
protected override void AssignResetValue()
6+
{
7+
resetValue.arraySize = value.arraySize;
8+
resetValue.ClearArray();
9+
for (int i = 0; i < value.arraySize; i++)
10+
{
11+
resetValue.InsertArrayElementAtIndex(i);
12+
AssignResetArrayElementValue(i);
13+
}
14+
}
15+
16+
protected abstract void AssignResetArrayElementValue(int index);
17+
}
18+
}

Packages/SOVariables/Editor/Array/ArrayVariableEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using UnityEditor;
2+
3+
namespace RaCoding.Variables
4+
{
5+
[CustomEditor(typeof(BoolArrayMutableVariable), editorForChildClasses: true)]
6+
public class BoolArrayVariableEditor : ArrayVariableEditor<bool[]>
7+
{
8+
protected override void AssignResetArrayElementValue(int index)
9+
{
10+
resetValue.GetArrayElementAtIndex(index).boolValue = value.GetArrayElementAtIndex(index).boolValue;
11+
}
12+
}
13+
}

Packages/SOVariables/Editor/Array/BoolArrayVariableEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace RaCoding.Variables
5+
{
6+
[CustomEditor(typeof(ByteArrayMutableVariable), editorForChildClasses: true)]
7+
public class ByteArrayVariableEditor : ArrayVariableEditor<byte[]>
8+
{
9+
protected override void AssignResetArrayElementValue(int index)
10+
{
11+
resetValue.GetArrayElementAtIndex(index).intValue = value.GetArrayElementAtIndex(index).intValue;
12+
}
13+
}
14+
}

Packages/SOVariables/Editor/Array/ByteArrayVariableEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace RaCoding.Variables
5+
{
6+
[CustomEditor(typeof(CharArrayMutableVariable), editorForChildClasses: true)]
7+
public class CharArrayVariableEditor : ArrayVariableEditor<char[]>
8+
{
9+
protected override void AssignResetArrayElementValue(int index)
10+
{
11+
resetValue.GetArrayElementAtIndex(index).intValue = value.GetArrayElementAtIndex(index).intValue;
12+
}
13+
}
14+
}

Packages/SOVariables/Editor/Array/CharArrayVariableEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace RaCoding.Variables
5+
{
6+
[CustomEditor(typeof(ColorArrayMutableVariable), editorForChildClasses: true)]
7+
public class ColorArrayVariableEditor : ArrayVariableEditor<Color[]>
8+
{
9+
protected override void AssignResetArrayElementValue(int index)
10+
{
11+
resetValue.GetArrayElementAtIndex(index).colorValue = value.GetArrayElementAtIndex(index).colorValue;
12+
}
13+
}
14+
}

Packages/SOVariables/Editor/Array/ColorArrayVariableEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace RaCoding.Variables
5+
{
6+
[CustomEditor(typeof(DoubleArrayMutableVariable), editorForChildClasses: true)]
7+
public class DoubleArrayVariableEditor : ArrayVariableEditor<double[]>
8+
{
9+
protected override void AssignResetArrayElementValue(int index)
10+
{
11+
resetValue.GetArrayElementAtIndex(index).doubleValue = value.GetArrayElementAtIndex(index).doubleValue;
12+
}
13+
}
14+
}

Packages/SOVariables/Editor/Array/DoubleArrayVariableEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace RaCoding.Variables
5+
{
6+
[CustomEditor(typeof(FloatArrayMutableVariable), editorForChildClasses: true)]
7+
public class FloatArrayVariableEditor : ArrayVariableEditor<float[]>
8+
{
9+
protected override void AssignResetArrayElementValue(int index)
10+
{
11+
resetValue.GetArrayElementAtIndex(index).floatValue = value.GetArrayElementAtIndex(index).floatValue;
12+
}
13+
}
14+
}

Packages/SOVariables/Editor/Array/FloatArrayVariableEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace RaCoding.Variables
5+
{
6+
[CustomEditor(typeof(GameObjectArrayMutableVariable), editorForChildClasses: true)]
7+
public class GameObjectArrayVariableEditor : ArrayVariableEditor<GameObject[]>
8+
{
9+
protected override void AssignResetArrayElementValue(int index)
10+
{
11+
resetValue.GetArrayElementAtIndex(index).objectReferenceValue = value.GetArrayElementAtIndex(index).objectReferenceValue;
12+
}
13+
}
14+
}

Packages/SOVariables/Editor/Array/GameObjectArrayVariableEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace RaCoding.Variables
5+
{
6+
[CustomEditor(typeof(IntArrayMutableVariable), editorForChildClasses: true)]
7+
public class IntArrayVariableEditor : ArrayVariableEditor<int[]>
8+
{
9+
protected override void AssignResetArrayElementValue(int index)
10+
{
11+
resetValue.GetArrayElementAtIndex(index).intValue = value.GetArrayElementAtIndex(index).intValue;
12+
}
13+
}
14+
}

Packages/SOVariables/Editor/Array/IntArrayVariableEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace RaCoding.Variables
5+
{
6+
[CustomEditor(typeof(LongArrayMutableVariable), editorForChildClasses: true)]
7+
public class LongArrayVariableEditor : ArrayVariableEditor<long[]>
8+
{
9+
protected override void AssignResetArrayElementValue(int index)
10+
{
11+
resetValue.GetArrayElementAtIndex(index).longValue = value.GetArrayElementAtIndex(index).longValue;
12+
}
13+
}
14+
}

Packages/SOVariables/Editor/Array/LongArrayVariableEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace RaCoding.Variables
5+
{
6+
[CustomEditor(typeof(QuaternionArrayMutableVariable), editorForChildClasses: true)]
7+
public class QuaternionArrayVariableEditor : ArrayVariableEditor<Quaternion[]>
8+
{
9+
protected override void AssignResetArrayElementValue(int index)
10+
{
11+
resetValue.GetArrayElementAtIndex(index).quaternionValue = value.GetArrayElementAtIndex(index).quaternionValue;
12+
}
13+
}
14+
}

Packages/SOVariables/Editor/Array/QuaternionArrayVariableEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace RaCoding.Variables
5+
{
6+
[CustomEditor(typeof(SByteArrayMutableVariable), editorForChildClasses: true)]
7+
public class SByteArrayVariableEditor : ArrayVariableEditor<sbyte[]>
8+
{
9+
protected override void AssignResetArrayElementValue(int index)
10+
{
11+
resetValue.GetArrayElementAtIndex(index).intValue = value.GetArrayElementAtIndex(index).intValue;
12+
}
13+
}
14+
}

Packages/SOVariables/Editor/Array/SByteArrayVariableEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace RaCoding.Variables
5+
{
6+
[CustomEditor(typeof(ShortArrayMutableVariable), editorForChildClasses: true)]
7+
public class ShortArrayVariableEditor : ArrayVariableEditor<short[]>
8+
{
9+
protected override void AssignResetArrayElementValue(int index)
10+
{
11+
resetValue.GetArrayElementAtIndex(index).intValue = value.GetArrayElementAtIndex(index).intValue;
12+
}
13+
}
14+
}

Packages/SOVariables/Editor/Array/ShortArrayVariableEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace RaCoding.Variables
5+
{
6+
[CustomEditor(typeof(SpriteArrayMutableVariable), editorForChildClasses: true)]
7+
public class SpriteArrayVariableEditor : ArrayVariableEditor<Sprite[]>
8+
{
9+
protected override void AssignResetArrayElementValue(int index)
10+
{
11+
resetValue.GetArrayElementAtIndex(index).objectReferenceValue = value.GetArrayElementAtIndex(index).objectReferenceValue;
12+
}
13+
}
14+
}

Packages/SOVariables/Editor/Array/SpriteArrayVariableEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)