mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-22 08:08:51 -05:00
Docs for mobile api
This commit is contained in:
parent
a51ea7cffa
commit
13ab7b6fc3
@ -10,6 +10,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}.Editor
|
||||
namespace UnityAtoms.Editor
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Constant property drawer of type `{TYPE}`. Inherits from `AtomDrawer<{TYPE_NAME}Constant>`.
|
||||
/// </summary>
|
||||
[CustomPropertyDrawer(typeof({TYPE_NAME}Constant))]
|
||||
public class {TYPE_NAME}ConstantDrawer : AtomDrawer<{TYPE_NAME}Constant> { }
|
||||
}
|
||||
|
@ -10,6 +10,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}.Editor
|
||||
namespace UnityAtoms.Editor
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Event property drawer of type `{TYPE}`. Inherits from `AtomDrawer<{TYPE_NAME}Event>`.
|
||||
/// </summary>
|
||||
[CustomPropertyDrawer(typeof({TYPE_NAME}Event))]
|
||||
public class {TYPE_NAME}EventDrawer : AtomDrawer<{TYPE_NAME}Event> { }
|
||||
}
|
||||
|
@ -10,6 +10,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}.Editor
|
||||
namespace UnityAtoms.Editor
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// List property drawer of type `{TYPE}`. Inherits from `AtomDrawer<{TYPE_NAME}List>`.
|
||||
/// </summary>
|
||||
[CustomPropertyDrawer(typeof({TYPE_NAME}List))]
|
||||
public class {TYPE_NAME}ListDrawer : AtomDrawer<{TYPE_NAME}List> { }
|
||||
}
|
||||
|
@ -10,6 +10,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}.Editor
|
||||
namespace UnityAtoms.Editor
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Variable property drawer of type `{TYPE}`. Inherits from `AtomDrawer<{TYPE_NAME}Variable>`.
|
||||
/// </summary>
|
||||
[CustomPropertyDrawer(typeof({TYPE_NAME}Variable))]
|
||||
public class {TYPE_NAME}VariableDrawer : AtomDrawer<{TYPE_NAME}Variable> { }
|
||||
}
|
||||
|
@ -10,6 +10,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}.Editor
|
||||
namespace UnityAtoms.Editor
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Event x 2 property drawer of type `{TYPE}`. Inherits from `AtomDrawer<{TYPE_NAME}{TYPE_NAME}Event>`.
|
||||
/// </summary>
|
||||
[CustomPropertyDrawer(typeof({TYPE_NAME}{TYPE_NAME}Event))]
|
||||
public class {TYPE_NAME}{TYPE_NAME}EventDrawer : AtomDrawer<{TYPE_NAME}{TYPE_NAME}Event> { }
|
||||
}
|
||||
|
@ -14,6 +14,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}.Editor
|
||||
namespace UnityAtoms.Editor
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Event property drawer of type `{TYPE}`. Inherits from `AtomEventEditor<{TYPE}, {TYPE_NAME}Event>`.
|
||||
/// </summary>
|
||||
[CustomEditor(typeof({TYPE_NAME}Event))]
|
||||
public sealed class {TYPE_NAME}EventEditor : AtomEventEditor<{TYPE}, {TYPE_NAME}Event>
|
||||
{
|
||||
|
@ -8,6 +8,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}
|
||||
namespace UnityAtoms
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Action of type `{TYPE}`. Inherits from `AtomAction<{TYPE}>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-purple")]
|
||||
public abstract class {TYPE_NAME}Action : AtomAction<{TYPE}> { }
|
||||
}
|
||||
|
@ -9,6 +9,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}
|
||||
namespace UnityAtoms
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Constant of type `{TYPE}`. Inherits from `AtomBaseVariable<{TYPE}>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-teal")]
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Constants/{TYPE_NAME}", fileName = "{TYPE_NAME}Constant")]
|
||||
public sealed class {TYPE_NAME}Constant : AtomBaseVariable<{TYPE}> { }
|
||||
|
@ -9,6 +9,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}
|
||||
namespace UnityAtoms
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Event of type `{TYPE}`. Inherits from `AtomEvent<{TYPE}>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-cherry")]
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Events/{TYPE_NAME}", fileName = "{TYPE_NAME}Event")]
|
||||
public sealed class {TYPE_NAME}Event : AtomEvent<{TYPE}> { }
|
||||
|
@ -9,6 +9,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}
|
||||
namespace UnityAtoms
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// List of type `{TYPE}`. Inherits from `AtomList<{TYPE}, {TYPE_NAME}Event>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-piglet")]
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Lists/{TYPE_NAME}", fileName = "{TYPE_NAME}List")]
|
||||
public sealed class {TYPE_NAME}List : AtomList<{TYPE}, {TYPE_NAME}Event> { }
|
||||
|
@ -9,6 +9,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}
|
||||
namespace UnityAtoms
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Listener of type `{TYPE}`. Inherits from `AtomListener<{TYPE}, {TYPE_NAME}Action, {TYPE_NAME}Event, {TYPE_NAME}UnityEvent>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-orange")]
|
||||
[AddComponentMenu("Unity Atoms/Listeners/{TYPE_NAME}")]
|
||||
public sealed class {TYPE_NAME}Listener : AtomListener<
|
||||
|
@ -9,6 +9,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}
|
||||
namespace UnityAtoms
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Reference of type `{TYPE}`. Inherits from `AtomReference<{TYPE}, {TYPE_NAME}Variable>`.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public sealed class {TYPE_NAME}Reference : AtomReference<
|
||||
{TYPE},
|
||||
|
@ -9,6 +9,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}
|
||||
namespace UnityAtoms
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Set variable value Action of type `{TYPE}`. Inherits from `SetVariableValue<{TYPE}, {TYPE_NAME}Variable, {TYPE_NAME}Reference, {TYPE_NAME}Event, {TYPE_NAME}{TYPE_NAME}Event>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-purple")]
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Actions/Set Variable Value/{TYPE_NAME}", fileName = "Set{TYPE_NAME}VariableValue")]
|
||||
public sealed class Set{TYPE_NAME}VariableValue : SetVariableValue<
|
||||
|
@ -10,6 +10,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}
|
||||
namespace UnityAtoms
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Unity Event of type `{TYPE}`. Inherits from `UnityEvent<{TYPE}>`.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public sealed class {TYPE_NAME}UnityEvent : UnityEvent<{TYPE}> { }
|
||||
}
|
||||
|
@ -12,11 +12,19 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}
|
||||
namespace UnityAtoms
|
||||
<%ENDIF%>
|
||||
{
|
||||
<%IF EQUATABLE%>
|
||||
/// <summary>
|
||||
/// Variable of type `{TYPE}`. Inherits from `EquatableAtomVariable<{TYPE}, {TYPE_NAME}Event, {TYPE_NAME}{TYPE_NAME}Event>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-lush")]
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Variables/{TYPE_NAME}", fileName = "{TYPE_NAME}Variable")]
|
||||
<%IF EQUATABLE%>
|
||||
public sealed class {TYPE_NAME}Variable : EquatableAtomVariable<{TYPE}, {TYPE_NAME}Event, {TYPE_NAME}{TYPE_NAME}Event> { }
|
||||
<%ELSE%>
|
||||
/// <summary>
|
||||
/// Variable of type `{TYPE}`. Inherits from `AtomVariable<{TYPE}, {TYPE_NAME}Event, {TYPE_NAME}{TYPE_NAME}Event>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-lush")]
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Variables/{TYPE_NAME}", fileName = "{TYPE_NAME}Variable")]
|
||||
public sealed class {TYPE_NAME}Variable : AtomVariable<{TYPE}, {TYPE_NAME}Event, {TYPE_NAME}{TYPE_NAME}Event>
|
||||
{
|
||||
protected override bool AreEqual({TYPE} first, {TYPE} second)
|
||||
|
@ -8,6 +8,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}
|
||||
namespace UnityAtoms
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Action x 2 of type `{TYPE}`. Inherits from `AtomAction<{TYPE}, {TYPE}>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-purple")]
|
||||
public abstract class {TYPE_NAME}{TYPE_NAME}Action : AtomAction<{TYPE}, {TYPE}> { }
|
||||
}
|
||||
|
@ -9,6 +9,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}
|
||||
namespace UnityAtoms
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Event x 2 of type `{TYPE}`. Inherits from `AtomEvent<{TYPE}, {TYPE}>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-cherry")]
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Events/{TYPE_NAME} x 2", fileName = "{TYPE_NAME}{TYPE_NAME}Event")]
|
||||
public sealed class {TYPE_NAME}{TYPE_NAME}Event : AtomEvent<{TYPE}, {TYPE}> { }
|
||||
|
@ -9,6 +9,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}
|
||||
namespace UnityAtoms
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Listener x 2 of type `{TYPE}`. Inherits from `AtomListener<{TYPE}, {TYPE}, {TYPE_NAME}{TYPE_NAME}Action, {TYPE_NAME}{TYPE_NAME}Event, {TYPE_NAME}{TYPE_NAME}UnityEvent>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-orange")]
|
||||
[AddComponentMenu("Unity Atoms/Listeners/{TYPE_NAME} - {TYPE_NAME}")]
|
||||
public sealed class {TYPE_NAME}{TYPE_NAME}Listener : AtomListener<
|
||||
|
@ -10,6 +10,9 @@ namespace UnityAtoms.{SUB_UA_NAMESPACE}
|
||||
namespace UnityAtoms
|
||||
<%ENDIF%>
|
||||
{
|
||||
/// <summary>
|
||||
/// Unity Event x 2 of type `{TYPE}`. Inherits from `UnityEvent<{TYPE}, {TYPE}>`.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public sealed class {TYPE_NAME}{TYPE_NAME}UnityEvent : UnityEvent<{TYPE}, {TYPE}> { }
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ using UnityAtoms.Editor;
|
||||
|
||||
namespace UnityAtoms.Mobile.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// Constant property drawer of type `TouchUserInput`. Inherits from `AtomDrawer<TouchUserInputConstant>`.
|
||||
/// </summary>
|
||||
[CustomPropertyDrawer(typeof(TouchUserInputConstant))]
|
||||
public class TouchUserInputConstantDrawer : AtomDrawer<TouchUserInputConstant> { }
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ using UnityAtoms.Editor;
|
||||
|
||||
namespace UnityAtoms.Mobile.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// Event property drawer of type `TouchUserInput`. Inherits from `AtomDrawer<TouchUserInputEvent>`.
|
||||
/// </summary>
|
||||
[CustomPropertyDrawer(typeof(TouchUserInputEvent))]
|
||||
public class TouchUserInputEventDrawer : AtomDrawer<TouchUserInputEvent> { }
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ using UnityAtoms.Editor;
|
||||
|
||||
namespace UnityAtoms.Mobile.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// Event x 2 property drawer of type `TouchUserInput`. Inherits from `AtomDrawer<TouchUserInputTouchUserInputEvent>`.
|
||||
/// </summary>
|
||||
[CustomPropertyDrawer(typeof(TouchUserInputTouchUserInputEvent))]
|
||||
public class TouchUserInputTouchUserInputEventDrawer : AtomDrawer<TouchUserInputTouchUserInputEvent> { }
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ using UnityAtoms.Editor;
|
||||
|
||||
namespace UnityAtoms.Mobile.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// List property drawer of type `TouchUserInput`. Inherits from `AtomDrawer<TouchUserInputList>`.
|
||||
/// </summary>
|
||||
[CustomPropertyDrawer(typeof(TouchUserInputList))]
|
||||
public class TouchUserInputListDrawer : AtomDrawer<TouchUserInputList> { }
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ using UnityAtoms.Editor;
|
||||
|
||||
namespace UnityAtoms.Mobile.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// Variable property drawer of type `TouchUserInput`. Inherits from `AtomDrawer<TouchUserInputVariable>`.
|
||||
/// </summary>
|
||||
[CustomPropertyDrawer(typeof(TouchUserInputVariable))]
|
||||
public class TouchUserInputVariableDrawer : AtomDrawer<TouchUserInputVariable> { }
|
||||
}
|
||||
|
@ -5,6 +5,9 @@ using UnityAtoms.Editor;
|
||||
|
||||
namespace UnityAtoms.Mobile.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// Event property drawer of type `TouchUserInput`. Inherits from `AtomEventEditor<TouchUserInput, TouchUserInputEvent>`.
|
||||
/// </summary>
|
||||
[CustomEditor(typeof(TouchUserInputEvent))]
|
||||
public sealed class TouchUserInputEventEditor : AtomEventEditor<TouchUserInput, TouchUserInputEvent>
|
||||
{
|
||||
|
@ -2,6 +2,9 @@ using UnityEngine;
|
||||
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/// <summary>
|
||||
/// Set variable value Action of type `TouchUserInput`. Inherits from `SetVariableValue<TouchUserInput, TouchUserInputVariable, TouchUserInputReference, TouchUserInputEvent, TouchUserInputTouchUserInputEvent>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-purple")]
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Actions/Set Variable Value/TouchUserInput", fileName = "SetTouchUserInputVariableValue")]
|
||||
public sealed class SetTouchUserInputVariableValue : SetVariableValue<
|
||||
|
@ -1,5 +1,8 @@
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/// <summary>
|
||||
/// Action of type `TouchUserInput`. Inherits from `AtomAction<TouchUserInput>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-purple")]
|
||||
public abstract class TouchUserInputAction : AtomAction<TouchUserInput> { }
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/// <summary>
|
||||
/// Action x 2 of type `TouchUserInput`. Inherits from `AtomAction<TouchUserInput, TouchUserInput>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-purple")]
|
||||
public abstract class TouchUserInputTouchUserInputAction : AtomAction<TouchUserInput, TouchUserInput> { }
|
||||
}
|
||||
|
@ -3,11 +3,15 @@ using UnityAtoms;
|
||||
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/* Updates the TouchUserInputVariable on every Update tick. Meant to be called every Update.
|
||||
*/
|
||||
/// <summary>
|
||||
/// Updates the `TouchUserInputVariable` on every Update tick. Meant to be called every Update.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Actions/UpdateTouchUserInput", fileName = "UpdateTouchUserInputVariable")]
|
||||
public sealed class UpdateTouchUserInput : VoidAction
|
||||
{
|
||||
/// <summary>
|
||||
/// The `TouchUserInputVariable` to update.
|
||||
/// </summary>
|
||||
public TouchUserInputVariable TouchUserInputVariable;
|
||||
|
||||
private TouchUserInput.State _inputState = TouchUserInput.State.None;
|
||||
@ -18,6 +22,9 @@ namespace UnityAtoms.Mobile
|
||||
|
||||
private Vector2 _inputPosLastDown = Vector2.zero;
|
||||
|
||||
/// <summary>
|
||||
/// Update the `TouchUserInputVariable`.abstract Call this on every Update tick.
|
||||
/// </summary>
|
||||
public override void Do()
|
||||
{
|
||||
#if (UNITY_ANDROID || UNITY_IOS || UNITY_IPHONE) && !UNITY_EDITOR
|
||||
|
@ -2,6 +2,9 @@ using UnityEngine;
|
||||
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/// <summary>
|
||||
/// Constant of type `TouchUserInput`. Inherits from `AtomBaseVariable<TouchUserInput>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-teal")]
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Constants/TouchUserInput", fileName = "TouchUserInputConstant")]
|
||||
public sealed class TouchUserInputConstant : AtomBaseVariable<TouchUserInput> { }
|
||||
|
@ -2,6 +2,9 @@ using UnityEngine;
|
||||
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/// <summary>
|
||||
/// Event of type `TouchUserInput`. Inherits from `AtomEvent<TouchUserInput>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-cherry")]
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Events/TouchUserInput", fileName = "TouchUserInputEvent")]
|
||||
public sealed class TouchUserInputEvent : AtomEvent<TouchUserInput> { }
|
||||
|
@ -2,6 +2,9 @@ using UnityEngine;
|
||||
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/// <summary>
|
||||
/// Event x 2 of type `TouchUserInput`. Inherits from `AtomEvent<TouchUserInput, TouchUserInput>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-cherry")]
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Events/TouchUserInput x 2", fileName = "TouchUserInputTouchUserInputEvent")]
|
||||
public sealed class TouchUserInputTouchUserInputEvent : AtomEvent<TouchUserInput, TouchUserInput> { }
|
||||
|
@ -2,6 +2,9 @@ using UnityEngine;
|
||||
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/// <summary>
|
||||
/// Listener of type `TouchUserInput`. Inherits from `AtomListener<TouchUserInput, TouchUserInputAction, TouchUserInputEvent, TouchUserInputUnityEvent>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-orange")]
|
||||
[AddComponentMenu("Unity Atoms/Listeners/TouchUserInput")]
|
||||
public sealed class TouchUserInputListener : AtomListener<
|
||||
|
@ -2,6 +2,9 @@ using UnityEngine;
|
||||
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/// <summary>
|
||||
/// Listener x 2 of type `TouchUserInput`. Inherits from `AtomListener<TouchUserInput, TouchUserInput, TouchUserInputTouchUserInputAction, TouchUserInputTouchUserInputEvent, TouchUserInputTouchUserInputUnityEvent>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-orange")]
|
||||
[AddComponentMenu("Unity Atoms/Listeners/TouchUserInput - TouchUserInput")]
|
||||
public sealed class TouchUserInputTouchUserInputListener : AtomListener<
|
||||
|
@ -2,6 +2,9 @@ using UnityEngine;
|
||||
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/// <summary>
|
||||
/// List of type `TouchUserInput`. Inherits from `AtomList<TouchUserInput, TouchUserInputEvent>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-piglet")]
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Lists/TouchUserInput", fileName = "TouchUserInputList")]
|
||||
public sealed class TouchUserInputList : AtomList<TouchUserInput, TouchUserInputEvent> { }
|
||||
|
@ -2,6 +2,9 @@ using System;
|
||||
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/// <summary>
|
||||
/// Reference of type `TouchUserInput`. Inherits from `AtomReference<TouchUserInput, TouchUserInputVariable>`.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public sealed class TouchUserInputReference : AtomReference<
|
||||
TouchUserInput,
|
||||
|
@ -4,9 +4,15 @@ using UnityAtoms;
|
||||
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/// <summary>
|
||||
/// Module class holding data for touch user input.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public struct TouchUserInput : IEquatable<TouchUserInput>
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum for different touch user input states.
|
||||
/// </summary>
|
||||
public enum State
|
||||
{
|
||||
None,
|
||||
@ -15,14 +21,51 @@ namespace UnityAtoms.Mobile
|
||||
Up
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Current input state.
|
||||
/// </summary>
|
||||
public State InputState;
|
||||
|
||||
/// <summary>
|
||||
/// Current input position.
|
||||
/// </summary>
|
||||
public Vector2 InputPos;
|
||||
|
||||
/// <summary>
|
||||
/// Input position last frame.
|
||||
/// </summary>
|
||||
public Vector2 InputPosLastFrame;
|
||||
|
||||
/// <summary>
|
||||
/// Input position last time the user pressed down.
|
||||
/// </summary>
|
||||
public Vector2 InputPosLastDown;
|
||||
|
||||
/// <summary>
|
||||
/// The input position in world space.
|
||||
/// </summary>
|
||||
/// <returns>The input position in world space.</returns>
|
||||
public Vector2 InputWorldPos { get { return Camera.main.ScreenToWorldPoint(InputPos); } }
|
||||
|
||||
/// <summary>
|
||||
/// The input position in world space from last frame.
|
||||
/// </summary>
|
||||
/// <returns>The input position in world space from last frame.</returns>
|
||||
public Vector2 InputWorldPosLastFrame { get { return Camera.main.ScreenToWorldPoint(InputPosLastFrame); } }
|
||||
|
||||
/// <summary>
|
||||
/// Input position last time the user pressed down in world space.
|
||||
/// </summary>
|
||||
/// <returns>Input position last time the user pressed down in world space.</returns>
|
||||
public Vector2 InputWorldPosLastDown { get { return Camera.main.ScreenToWorldPoint(InputPosLastDown); } }
|
||||
|
||||
/// <summary>
|
||||
/// Create a `TouchUserInput` class.
|
||||
/// </summary>
|
||||
/// <param name="inputState">Initial input state.</param>
|
||||
/// <param name="inputPos">Initial input position.</param>
|
||||
/// <param name="inputPosLastFrame">Initial input position last frame.</param>
|
||||
/// <param name="inputPosLastDown">Initial input position last time the user pressed down.</param>
|
||||
public TouchUserInput(State inputState, Vector2 inputPos, Vector2 inputPosLastFrame, Vector2 inputPosLastDown)
|
||||
{
|
||||
this.InputState = inputState;
|
||||
@ -31,17 +74,31 @@ namespace UnityAtoms.Mobile
|
||||
this.InputPosLastDown = inputPosLastDown;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determine if 2 `TouchUserInput` are equal.
|
||||
/// </summary>
|
||||
/// <param name="other">The other `TouchUserInput` to compare with.</param>
|
||||
/// <returns>`true` if equal, otherwise `false`.</returns>
|
||||
public bool Equals(TouchUserInput other)
|
||||
{
|
||||
return this.InputState == other.InputState && this.InputWorldPos == other.InputWorldPos && this.InputWorldPosLastFrame == other.InputWorldPosLastFrame;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determine if 2 `TouchUserInput` are equal comparing against another `object`.
|
||||
/// </summary>
|
||||
/// <param name="obj">The other `object` to compare with.</param>
|
||||
/// <returns>`true` if equal, otherwise `false`.</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
TouchUserInput tui = (TouchUserInput)obj;
|
||||
return Equals(tui);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// `GetHashCode()` in order to implement `IEquatable<TouchUserInput>`
|
||||
/// </summary>
|
||||
/// <returns>An unique hashcode for the current value.</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
var hash = 17;
|
||||
@ -51,11 +108,23 @@ namespace UnityAtoms.Mobile
|
||||
return hash;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Equality operator
|
||||
/// </summary>
|
||||
/// <param name="touch1">First `TouchUserInput`.</param>
|
||||
/// <param name="touch2">Other `TouchUserInput`.</param>
|
||||
/// <returns>`true` if equal, otherwise `false`.</returns>
|
||||
public static bool operator ==(TouchUserInput touch1, TouchUserInput touch2)
|
||||
{
|
||||
return touch1.Equals(touch2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inequality operator
|
||||
/// </summary>
|
||||
/// <param name="touch1">First `TouchUserInput`.</param>
|
||||
/// <param name="touch2">Other `TouchUserInput`.</param>
|
||||
/// <returns>`true` if they are not equal, otherwise `false`.</returns>
|
||||
public static bool operator !=(TouchUserInput touch1, TouchUserInput touch2)
|
||||
{
|
||||
return !touch1.Equals(touch2);
|
||||
|
@ -3,6 +3,9 @@ using UnityEngine.Events;
|
||||
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/// <summary>
|
||||
/// Unity Event x 2 of type `TouchUserInput`. Inherits from `UnityEvent<TouchUserInput, TouchUserInput>`.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public sealed class TouchUserInputTouchUserInputUnityEvent : UnityEvent<TouchUserInput, TouchUserInput> { }
|
||||
}
|
||||
|
@ -3,6 +3,9 @@ using UnityEngine.Events;
|
||||
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/// <summary>
|
||||
/// Unity Event of type `TouchUserInput`. Inherits from `UnityEvent<TouchUserInput>`.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public sealed class TouchUserInputUnityEvent : UnityEvent<TouchUserInput> { }
|
||||
}
|
||||
|
@ -2,6 +2,9 @@ using UnityEngine;
|
||||
|
||||
namespace UnityAtoms.Mobile
|
||||
{
|
||||
/// <summary>
|
||||
/// Variable of type `TouchUserInput`. Inherits from `EquatableAtomVariable<TouchUserInput, TouchUserInputEvent, TouchUserInputTouchUserInputEvent>`.
|
||||
/// </summary>
|
||||
[EditorIcon("atom-icon-lush")]
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Variables/TouchUserInput", fileName = "TouchUserInputVariable")]
|
||||
public sealed class TouchUserInputVariable : EquatableAtomVariable<TouchUserInput, TouchUserInputEvent, TouchUserInputTouchUserInputEvent> { }
|
||||
|
@ -10,6 +10,7 @@
|
||||
- [UnityAtoms](./api/unityatoms.md)
|
||||
- [UnityAtoms.Editor](./api/unityatoms.editor.md)
|
||||
- [UnityAtoms.Tags](./api/unityatoms.tags.md)
|
||||
- [UnityAtoms.Mobile](./api/unityatoms.mobile.md)
|
||||
- Subpackages
|
||||
- [Mobile](./subpackages/mobile.md)
|
||||
- [SceneMgmt](./subpackages/scene-mgmt.md)
|
||||
|
224
docs/api/unityatoms.mobile.md
Normal file
224
docs/api/unityatoms.mobile.md
Normal file
@ -0,0 +1,224 @@
|
||||
---
|
||||
id: unityatoms.mobile
|
||||
title: UnityAtoms.Mobile
|
||||
hide_title: true
|
||||
sidebar_label: UnityAtoms.Mobile
|
||||
---
|
||||
|
||||
# Namespace - `UnityAtoms.Mobile`
|
||||
|
||||
## `TouchUserInputAction`
|
||||
|
||||
Action of type `TouchUserInput`. Inherits from `AtomAction<TouchUserInput>`.
|
||||
|
||||
---
|
||||
## `TouchUserInputTouchUserInputAction`
|
||||
|
||||
Action x 2 of type `TouchUserInput`. Inherits from `AtomAction<TouchUserInput, TouchUserInput>`.
|
||||
|
||||
---
|
||||
## `UpdateTouchUserInput`
|
||||
|
||||
Updates the `TouchUserInputVariable` on every Update tick. Meant to be called every Update.
|
||||
|
||||
### Variables
|
||||
|
||||
|
||||
|
||||
#### `TouchUserInputVariable`
|
||||
|
||||
The `TouchUserInputVariable` to update.
|
||||
|
||||
### Methods
|
||||
|
||||
#### `Do`
|
||||
|
||||
Update the `TouchUserInputVariable`.abstract Call this on every Update tick.
|
||||
|
||||
---
|
||||
## `SetTouchUserInputVariableValue`
|
||||
|
||||
Set variable value Action of type `TouchUserInput`. Inherits from `SetVariableValue<TouchUserInput, TouchUserInputVariable, TouchUserInputReference, TouchUserInputEvent, TouchUserInputTouchUserInputEvent>`.
|
||||
|
||||
---
|
||||
## `TouchUserInputConstant`
|
||||
|
||||
Constant of type `TouchUserInput`. Inherits from `AtomBaseVariable<TouchUserInput>`.
|
||||
|
||||
---
|
||||
## `TouchUserInputEvent`
|
||||
|
||||
Event of type `TouchUserInput`. Inherits from `AtomEvent<TouchUserInput>`.
|
||||
|
||||
---
|
||||
## `TouchUserInputTouchUserInputEvent`
|
||||
|
||||
Event x 2 of type `TouchUserInput`. Inherits from `AtomEvent<TouchUserInput, TouchUserInput>`.
|
||||
|
||||
---
|
||||
## `TouchUserInputListener`
|
||||
|
||||
Listener of type `TouchUserInput`. Inherits from `AtomListener<TouchUserInput, TouchUserInputAction, TouchUserInputEvent, TouchUserInputUnityEvent>`.
|
||||
|
||||
---
|
||||
## `TouchUserInputTouchUserInputListener`
|
||||
|
||||
Listener x 2 of type `TouchUserInput`. Inherits from `AtomListener<TouchUserInput, TouchUserInput, TouchUserInputTouchUserInputAction, TouchUserInputTouchUserInputEvent, TouchUserInputTouchUserInputUnityEvent>`.
|
||||
|
||||
---
|
||||
## `TouchUserInputList`
|
||||
|
||||
List of type `TouchUserInput`. Inherits from `AtomList<TouchUserInput, TouchUserInputEvent>`.
|
||||
|
||||
---
|
||||
## `TouchUserInputReference`
|
||||
|
||||
Reference of type `TouchUserInput`. Inherits from `AtomReference<TouchUserInput, TouchUserInputVariable>`.
|
||||
|
||||
---
|
||||
## `TouchUserInput`
|
||||
|
||||
Module class holding data for touch user input.
|
||||
|
||||
### Variables
|
||||
|
||||
|
||||
|
||||
#### `InputState`
|
||||
|
||||
Current input state.
|
||||
|
||||
---
|
||||
|
||||
|
||||
#### `InputPos`
|
||||
|
||||
Current input position.
|
||||
|
||||
---
|
||||
|
||||
|
||||
#### `InputPosLastFrame`
|
||||
|
||||
Input position last frame.
|
||||
|
||||
---
|
||||
|
||||
|
||||
#### `InputPosLastDown`
|
||||
|
||||
Input position last time the user pressed down.
|
||||
|
||||
### Properties
|
||||
|
||||
#### `InputWorldPos`
|
||||
|
||||
The input position in world space.
|
||||
|
||||
---
|
||||
#### `InputWorldPosLastFrame`
|
||||
|
||||
The input position in world space from last frame.
|
||||
|
||||
---
|
||||
#### `InputWorldPosLastDown`
|
||||
|
||||
Input position last time the user pressed down in world space.
|
||||
|
||||
### Methods
|
||||
|
||||
#### `#ctor(UnityAtoms.Mobile.TouchUserInput.State,UnityEngine.Vector2,UnityEngine.Vector2,UnityEngine.Vector2)`
|
||||
|
||||
Create a `TouchUserInput` class.
|
||||
|
||||
##### Parameters
|
||||
|
||||
- `inputState` - Initial input state.
|
||||
- `inputPos` - Initial input position.
|
||||
- `inputPosLastFrame` - Initial input position last frame.
|
||||
- `inputPosLastDown` - Initial input position last time the user pressed down.
|
||||
|
||||
---
|
||||
#### `Equals(UnityAtoms.Mobile.TouchUserInput)`
|
||||
|
||||
Determine if 2 `TouchUserInput` are equal.
|
||||
|
||||
##### Parameters
|
||||
|
||||
- `other` - The other `TouchUserInput` to compare with.
|
||||
|
||||
##### Returns
|
||||
|
||||
`true` if equal, otherwise `false`.
|
||||
|
||||
---
|
||||
#### `Equals(System.Object)`
|
||||
|
||||
Determine if 2 `TouchUserInput` are equal comparing against another `object`.
|
||||
|
||||
##### Parameters
|
||||
|
||||
- `obj` - The other `object` to compare with.
|
||||
|
||||
##### Returns
|
||||
|
||||
`true` if equal, otherwise `false`.
|
||||
|
||||
---
|
||||
#### `GetHashCode`
|
||||
|
||||
`GetHashCode()` in order to implement `IEquatable<TouchUserInput>`
|
||||
|
||||
##### Returns
|
||||
|
||||
An unique hashcode for the current value.
|
||||
|
||||
---
|
||||
#### `op_Equality(UnityAtoms.Mobile.TouchUserInput,UnityAtoms.Mobile.TouchUserInput)`
|
||||
|
||||
Equality operator
|
||||
|
||||
##### Parameters
|
||||
|
||||
- `touch1` - First `TouchUserInput`.
|
||||
- `touch2` - Other `TouchUserInput`.
|
||||
|
||||
##### Returns
|
||||
|
||||
`true` if equal, otherwise `false`.
|
||||
|
||||
---
|
||||
#### `op_Inequality(UnityAtoms.Mobile.TouchUserInput,UnityAtoms.Mobile.TouchUserInput)`
|
||||
|
||||
Inequality operator
|
||||
|
||||
##### Parameters
|
||||
|
||||
- `touch1` - First `TouchUserInput`.
|
||||
- `touch2` - Other `TouchUserInput`.
|
||||
|
||||
##### Returns
|
||||
|
||||
`true` if they are not equal, otherwise `false`.
|
||||
|
||||
---
|
||||
## `TouchUserInput.State`
|
||||
|
||||
Enum for different touch user input states.
|
||||
|
||||
---
|
||||
## `TouchUserInputTouchUserInputUnityEvent`
|
||||
|
||||
Unity Event x 2 of type `TouchUserInput`. Inherits from `UnityEvent<TouchUserInput, TouchUserInput>`.
|
||||
|
||||
---
|
||||
## `TouchUserInputUnityEvent`
|
||||
|
||||
Unity Event of type `TouchUserInput`. Inherits from `UnityEvent<TouchUserInput>`.
|
||||
|
||||
---
|
||||
## `TouchUserInputVariable`
|
||||
|
||||
Variable of type `TouchUserInput`. Inherits from `EquatableAtomVariable<TouchUserInput, TouchUserInputEvent, TouchUserInputTouchUserInputEvent>`.
|
||||
|
||||
---
|
@ -7,8 +7,4 @@ sidebar_label: Mobile
|
||||
|
||||
# Unity Atoms / Mobile
|
||||
|
||||
Unity Atoms for your mobile project.
|
||||
|
||||
## API
|
||||
|
||||
[**TODO**]
|
||||
Unity Atoms specific for mobile projects. See the [API](../api/unityatoms.mobile) for more info.
|
||||
|
@ -22,7 +22,8 @@
|
||||
"publish:mobile": "npm publish ./Packages/Mobile --tag beta",
|
||||
"publish:scene": "npm publish ./Packages/SceneMgmt --tag beta",
|
||||
"publish:tags": "npm publish ./Packages/Tags --tag beta",
|
||||
"publish:ui": "npm publish ./Packages/UI --tag beta"
|
||||
"publish:ui": "npm publish ./Packages/UI --tag beta",
|
||||
"generate:docs": "node scripts/generateDocs.js"
|
||||
},
|
||||
"files": [
|
||||
"/LICENSE.md",
|
||||
|
@ -5,38 +5,6 @@
|
||||
"previous": "Previous",
|
||||
"tagline": "Tiny modular pieces utilizing the power of Scriptable Objects",
|
||||
"docs": {
|
||||
"api/actions": {
|
||||
"title": "Actions",
|
||||
"sidebar_label": "Actions"
|
||||
},
|
||||
"api/constants": {
|
||||
"title": "Constants",
|
||||
"sidebar_label": "Constants"
|
||||
},
|
||||
"api/events": {
|
||||
"title": "Events",
|
||||
"sidebar_label": "Events"
|
||||
},
|
||||
"api/functions": {
|
||||
"title": "Functions",
|
||||
"sidebar_label": "Functions"
|
||||
},
|
||||
"api/listeners": {
|
||||
"title": "Listeners",
|
||||
"sidebar_label": "Listeners"
|
||||
},
|
||||
"api/lists": {
|
||||
"title": "Lists",
|
||||
"sidebar_label": "Lists"
|
||||
},
|
||||
"api/references": {
|
||||
"title": "References",
|
||||
"sidebar_label": "References"
|
||||
},
|
||||
"api/unity-events": {
|
||||
"title": "Unity Events",
|
||||
"sidebar_label": "Unity Events"
|
||||
},
|
||||
"api/unityatoms.editor": {
|
||||
"title": "UnityAtoms.Editor",
|
||||
"sidebar_label": "UnityAtoms.Editor"
|
||||
@ -45,6 +13,10 @@
|
||||
"title": "UnityAtoms",
|
||||
"sidebar_label": "UnityAtoms"
|
||||
},
|
||||
"api/unityatoms.mobile": {
|
||||
"title": "UnityAtoms.Mobile",
|
||||
"sidebar_label": "UnityAtoms.Mobile"
|
||||
},
|
||||
"api/unityatoms.tags": {
|
||||
"title": "UnityAtoms.Tags",
|
||||
"sidebar_label": "UnityAtoms.Tags"
|
||||
|
@ -10,7 +10,8 @@
|
||||
"API Reference": [
|
||||
"api/unityatoms",
|
||||
"api/unityatoms.editor",
|
||||
"api/unityatoms.tags"
|
||||
"api/unityatoms.tags",
|
||||
"api/unityatoms.mobile"
|
||||
],
|
||||
"Subpackages": [
|
||||
"subpackages/mobile",
|
||||
|
Loading…
Reference in New Issue
Block a user