-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
Added - Added UniRx integration. - Added IModifierList<T>.AddModifierAsDisposable extension method. Changes - Renamed assembly name "MackySoft.Modiferty.Runtime" to "MackySoft.Modiferty". - OperatorModifiers now inherit from ModifiableProperty. - - The Modifier(s) suffix has been applied to the extension methods defined in IModifiablePropertyExtensions. - Multiply / DivisionModifierInt now must specify the RoundingMethod.
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "MackySoft.Modiferty.Editor", | ||
"references": [ | ||
"GUID:e695879245fa2de4a81d0b0f517b15c3" | ||
], | ||
"includePlatforms": [ | ||
"Editor" | ||
], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": true, | ||
"defineConstraints": [], | ||
"versionDefines": [], | ||
"noEngineReferences": false | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEditor; | ||
|
||
namespace MackySoft.Modiferty { | ||
|
||
[CustomPropertyDrawer(typeof(ModifieableProperty<>),true)] | ||
[CustomPropertyDrawer(typeof(ModifiableInt))] | ||
public class ModifiablePropertyDrawer : PropertyDrawer { | ||
public override void OnGUI (Rect position,SerializedProperty property,GUIContent label) { | ||
var baseValue = property.FindPropertyRelative("m_BaseValue"); | ||
EditorGUI.PropertyField(position,baseValue,label); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "MackySoft.Modiferty.Example", | ||
"references": [ | ||
"GUID:e695879245fa2de4a81d0b0f517b15c3" | ||
], | ||
"includePlatforms": [], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": true, | ||
"defineConstraints": [], | ||
"versionDefines": [], | ||
"noEngineReferences": false | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "MackySoft.Modiferty.UniRx", | ||
"references": [ | ||
"GUID:e695879245fa2de4a81d0b0f517b15c3", | ||
"GUID:560b04d1a97f54a4e82edc0cbbb69285" | ||
], | ||
"includePlatforms": [], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": true, | ||
"defineConstraints": [ | ||
"MODIFERTY_UNIRX" | ||
], | ||
"versionDefines": [], | ||
"noEngineReferences": false | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using UnityEngine; | ||
|
||
namespace MackySoft.Modiferty.Modifiers { | ||
|
||
public abstract class ReactiveOperatorModifierBase<TRHS,TResult> : ReactiveModifiableProperty<TRHS>, IModifier<TResult> { | ||
|
||
[SerializeField] | ||
int m_Priority; | ||
|
||
public int Priority { | ||
get => m_Priority; | ||
set => m_Priority = value; | ||
} | ||
|
||
protected ReactiveOperatorModifierBase () : this(default) { | ||
} | ||
protected ReactiveOperatorModifierBase (TRHS baseValue) : base(baseValue) { | ||
} | ||
|
||
public abstract TResult Evaluate (TResult value); | ||
} | ||
|
||
public abstract class ReactiveOperatorModifierBase<T> : ReactiveOperatorModifierBase<T,T> { | ||
protected ReactiveOperatorModifierBase () : this(default) { | ||
} | ||
protected ReactiveOperatorModifierBase (T baseValue) : base(baseValue) { | ||
} | ||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using UnityEngine; | ||
|
||
namespace MackySoft.Modiferty { | ||
|
||
[Serializable] | ||
public class ReactiveSetModifier<T> : ReactiveModifiableProperty<T>, IModifier<T> { | ||
|
||
[SerializeField] | ||
int m_Priority; | ||
|
||
public int Priority { | ||
get => m_Priority; | ||
set => m_Priority = value; | ||
} | ||
|
||
public ReactiveSetModifier () : this(default) { | ||
} | ||
|
||
public ReactiveSetModifier (T baseValue) : base(baseValue) { | ||
} | ||
|
||
public T Evaluate (T value) { | ||
return Evaluate(); | ||
} | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
using System; | ||
using MackySoft.Modiferty.Modifiers; | ||
|
||
namespace MackySoft.Modiferty { | ||
|
||
[Serializable] | ||
public class ReactiveModifiableFloat : ReactiveModifiableProperty<float> { | ||
public ReactiveModifiableFloat () : this(default) { | ||
} | ||
|
||
public ReactiveModifiableFloat (float initialValue) : base(initialValue) { | ||
} | ||
} | ||
|
||
#region Operator Modifiers | ||
|
||
[Serializable] | ||
public class ReactiveAdditiveModifierFloat : ReactiveOperatorModifierBase<float> { | ||
|
||
public ReactiveAdditiveModifierFloat () : this(default) { | ||
} | ||
public ReactiveAdditiveModifierFloat (float baseValue) : base(baseValue) { | ||
} | ||
|
||
public override float Evaluate (float value) { | ||
return value + Evaluate(); | ||
} | ||
|
||
} | ||
|
||
[Serializable] | ||
public class ReactiveSubtractiveModifierFloat : ReactiveOperatorModifierBase<float> { | ||
|
||
public ReactiveSubtractiveModifierFloat () : this(default) { | ||
} | ||
public ReactiveSubtractiveModifierFloat (float baseValue) : base(baseValue) { | ||
} | ||
|
||
public override float Evaluate (float value) { | ||
return value - Evaluate(); | ||
} | ||
|
||
} | ||
|
||
[Serializable] | ||
public class ReactiveMultiplyModifierFloat : ReactiveOperatorModifierBase<float> { | ||
|
||
public ReactiveMultiplyModifierFloat () : this(1f) { | ||
} | ||
public ReactiveMultiplyModifierFloat (float baseValue) : base(baseValue) { | ||
} | ||
|
||
public override float Evaluate (float value) { | ||
return value * Evaluate(); | ||
} | ||
|
||
} | ||
|
||
[Serializable] | ||
public class ReactiveDivisionModifierFloat : ReactiveOperatorModifierBase<float> { | ||
|
||
public ReactiveDivisionModifierFloat () : this(1f) { | ||
} | ||
public ReactiveDivisionModifierFloat (float baseValue) : base(baseValue) { | ||
} | ||
|
||
public override float Evaluate (float value) { | ||
return value / Evaluate(); | ||
} | ||
|
||
} | ||
|
||
#endregion | ||
|
||
[Serializable] | ||
public class ReactiveSetModifierFloat : ReactiveSetModifier<float> { | ||
public ReactiveSetModifierFloat () : this(default) { | ||
} | ||
|
||
public ReactiveSetModifierFloat (float baseValue) : base(baseValue) { | ||
} | ||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.