Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

com.mambojambostudios.unity-atoms-core

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.mambojambostudios.unity-atoms-core - npm Package Compare versions

Comparing version 4.2.1 to 4.3.0

Editor/Editors/EventInstancers.meta

275

Editor/Generator/Resources/UA_Template__BaseEventReference.txt
using System;
<%IF TYPE_IS_ATOMBASEVARIABLE%>using UnityEngine;<%ENDIF%>
<%IF TYPE_IS_FSMTRANSITIONDATA%>using UnityEngine;<%ENDIF%>
<%IF TYPE_IS_VOID%>using UnityEngine;<%ENDIF%>
<%IF TYPE_HAS_NAMESPACE%>using {TYPE_NAMESPACE};<%ENDIF%>

@@ -10,3 +13,42 @@

{
<%IF TYPE_IS_ATOMBASEVARIABLE%>
/// <summary>
/// Different types of Event Reference usages.
/// </summary>
public class AtomBaseVariableEventReferenceUsage
{
public const int EVENT = 0;
public const int EVENT_INSTANCER = 1;
public const int COLLECTION_ADDED_EVENT = 2;
public const int COLLECTION_REMOVED_EVENT = 3;
public const int LIST_ADDED_EVENT = 4;
public const int LIST_REMOVED_EVENT = 5;
public const int COLLECTION_INSTANCER_ADDED_EVENT = 6;
public const int COLLECTION_INSTANCER_REMOVED_EVENT = 7;
public const int LIST_INSTANCER_ADDED_EVENT = 8;
public const int LIST_INSTANCER_REMOVED_EVENT = 9;
}
<%ENDIF%>
<%IF TYPE_IS_VOID%>
public class VoidBaseEventReferenceUsage
{
public const int EVENT = 0;
public const int EVENT_INSTANCER = 1;
public const int COLLECTION_CLEARED_EVENT = 2;
public const int LIST_CLEARED_EVENT = 3;
public const int COLLECTION_INSTANCER_CLEARED_EVENT = 4;
public const int LIST_INSTANCER_CLEARED_EVENT = 5;
}
<%ENDIF%>
<%IF TYPE_IS_FSMTRANSITIONDATA%>
/// <summary>
/// Different Event Reference usages.
/// </summary>
public class FSMTransitionDataBaseEventReferenceUsage
{
public const int FSM = 2;
public const int FSM_INSTANCER = 3;
}
<%ENDIF%>
/// <summary>
/// Event Reference of type `{VALUE_TYPE}`. Inherits from `AtomBaseEventReference&lt;{VALUE_TYPE}, {VALUE_TYPE_NAME}Event, {VALUE_TYPE_NAME}EventInstancer&gt;`.

@@ -19,3 +61,234 @@ /// </summary>

{VALUE_TYPE_NAME}EventInstancer>, IGetEvent
{ }
{
<%IF TYPE_IS_FSMTRANSITIONDATA%>
/// <summary>
/// Get the value for the Reference.
/// </summary>
/// <value>The value of type `FiniteStateMachine`.</value>
public override FSMTransitionDataEvent Event
{
get
{
switch (_usage)
{
case (FSMTransitionDataBaseEventReferenceUsage.FSM_INSTANCER): return ((FiniteStateMachine)_fsmInstancer.Variable).TransitionStarted;
case (FSMTransitionDataBaseEventReferenceUsage.FSM): return _fsm.TransitionStarted;
default:
return base.Event;
}
}
set
{
switch (_usage)
{
case (FSMTransitionDataBaseEventReferenceUsage.FSM_INSTANCER):
((FiniteStateMachine)_fsmInstancer.Variable).TransitionStarted = value;
break;
case (FSMTransitionDataBaseEventReferenceUsage.FSM):
_fsm.TransitionStarted = value;
break;
default:
base.Event = value;
break;
}
}
}
/// <summary>
/// Takes event from this FiniteStateMachine if `Usage` is set to `FSM`.
/// </summary>
[SerializeField]
private FiniteStateMachine _fsm = default(FiniteStateMachine);
/// <summary>
/// Takes event from this FiniteStateMachineInstancer if `Usage` is set to `FSM Instancer`.
/// </summary>
[SerializeField]
private FiniteStateMachineInstancer _fsmInstancer = default(FiniteStateMachineInstancer);
<%ENDIF%>
<%IF TYPE_IS_ATOMBASEVARIABLE%>
/// <summary>
/// Get or set the Event used by the Event Reference.
/// </summary>
/// <value>The event of type `E`.</value>
public override AtomBaseVariableEvent Event
{
get
{
switch (_usage)
{
case (AtomBaseVariableEventReferenceUsage.COLLECTION_ADDED_EVENT): return _collection != null ? _collection.Added : null;
case (AtomBaseVariableEventReferenceUsage.COLLECTION_REMOVED_EVENT): return _collection != null ? _collection.Removed : null;
case (AtomBaseVariableEventReferenceUsage.LIST_ADDED_EVENT): return _list != null ? _list.Added : null;
case (AtomBaseVariableEventReferenceUsage.LIST_REMOVED_EVENT): return _list != null ? _list.Removed : null;
case (AtomBaseVariableEventReferenceUsage.COLLECTION_INSTANCER_ADDED_EVENT): return _collectionInstancer != null ? _collectionInstancer.Added : null;
case (AtomBaseVariableEventReferenceUsage.COLLECTION_INSTANCER_REMOVED_EVENT): return _collectionInstancer != null ? _collectionInstancer.Removed : null;
case (AtomBaseVariableEventReferenceUsage.LIST_INSTANCER_ADDED_EVENT): return _listInstancer != null ? _listInstancer.Added : null;
case (AtomBaseVariableEventReferenceUsage.LIST_INSTANCER_REMOVED_EVENT): return _listInstancer != null ? _listInstancer.Removed : null;
case (AtomBaseVariableEventReferenceUsage.EVENT_INSTANCER): return _eventInstancer != null ? _eventInstancer.Event : null;
case (AtomBaseVariableEventReferenceUsage.EVENT):
default:
return _event;
}
}
set
{
switch (_usage)
{
case (AtomBaseVariableEventReferenceUsage.COLLECTION_ADDED_EVENT):
{
_collection.Added = value;
break;
}
case (AtomBaseVariableEventReferenceUsage.COLLECTION_REMOVED_EVENT):
{
_collection.Removed = value;
break;
}
case (AtomBaseVariableEventReferenceUsage.LIST_ADDED_EVENT):
{
_list.Added = value;
break;
}
case (AtomBaseVariableEventReferenceUsage.LIST_REMOVED_EVENT):
{
_list.Removed = value;
break;
}
case (AtomBaseVariableEventReferenceUsage.COLLECTION_INSTANCER_ADDED_EVENT):
{
_collectionInstancer.Added = value;
break;
}
case (AtomBaseVariableEventReferenceUsage.COLLECTION_INSTANCER_REMOVED_EVENT):
{
_collectionInstancer.Removed = value;
break;
}
case (AtomBaseVariableEventReferenceUsage.LIST_INSTANCER_ADDED_EVENT):
{
_listInstancer.Added = value;
break;
}
case (AtomBaseVariableEventReferenceUsage.LIST_INSTANCER_REMOVED_EVENT):
{
_listInstancer.Removed = value;
break;
}
case (AtomBaseVariableEventReferenceUsage.EVENT):
{
_event = value;
break;
}
default:
throw new NotSupportedException($"Event not reassignable for usage {_usage}.");
}
}
}
/// <summary>
/// Collection used if `Usage` is set to `COLLECTION_ADDED_EVENT` or `COLLECTION_REMOVED_EVENT`.
/// </summary>
[SerializeField]
private AtomCollection _collection = default(AtomCollection);
/// <summary>
/// List used if `Usage` is set to `LIST_ADDED_EVENT` or `LIST_REMOVED_EVENT`.
/// </summary>
[SerializeField]
private AtomList _list = default(AtomList);
/// <summary>
/// Collection Instancer used if `Usage` is set to `COLLECTION_INSTANCER_ADDED_EVENT` or `COLLECTION_INSTANCER_REMOVED_EVENT`.
/// </summary>
[SerializeField]
private AtomCollectionInstancer _collectionInstancer = default(AtomCollectionInstancer);
/// <summary>
/// List Instancer used if `Usage` is set to `LIST_INSTANCER_ADDED_EVENT` or `LIST_INSTANCER_REMOVED_EVENT`.
/// </summary>
[SerializeField]
private AtomListInstancer _listInstancer = default(AtomListInstancer);
<%ENDIF%>
<%IF TYPE_IS_VOID%>
/// <summary>
/// Get or set the Event used by the Event Reference.
/// </summary>
/// <value>The event of type `E`.</value>
public override VoidEvent Event
{
get
{
switch (_usage)
{
case (VoidBaseEventReferenceUsage.COLLECTION_CLEARED_EVENT): return _collection != null ? _collection.Cleared : null;
case (VoidBaseEventReferenceUsage.LIST_CLEARED_EVENT): return _list != null ? _list.Cleared : null;
case (VoidBaseEventReferenceUsage.COLLECTION_INSTANCER_CLEARED_EVENT): return _collectionInstancer != null ? _collectionInstancer.Cleared : null;
case (VoidBaseEventReferenceUsage.LIST_INSTANCER_CLEARED_EVENT): return _listInstancer != null ? _listInstancer.Cleared : null;
case (VoidBaseEventReferenceUsage.EVENT_INSTANCER): return _eventInstancer != null ? _eventInstancer.Event : null;
case (VoidBaseEventReferenceUsage.EVENT):
default:
return _event;
}
}
set
{
switch (_usage)
{
case (VoidBaseEventReferenceUsage.COLLECTION_CLEARED_EVENT):
{
_collection.Cleared = value;
break;
}
case (VoidBaseEventReferenceUsage.LIST_CLEARED_EVENT):
{
_list.Cleared = value;
break;
}
case (VoidBaseEventReferenceUsage.COLLECTION_INSTANCER_CLEARED_EVENT):
{
_collectionInstancer.Cleared = value;
break;
}
case (VoidBaseEventReferenceUsage.LIST_INSTANCER_CLEARED_EVENT):
{
_listInstancer.Cleared = value;
break;
}
case (VoidBaseEventReferenceUsage.EVENT):
{
_event = value;
break;
}
default:
throw new NotSupportedException($"Event not reassignable for usage {_usage}.");
}
}
}
/// <summary>
/// Collection used if `Usage` is set to `COLLECTION_CLEARED_EVENT`.
/// </summary>
[SerializeField]
private AtomCollection _collection = default(AtomCollection);
/// <summary>
/// List used if `Usage` is set to `LIST_CLEARED_EVENT`.
/// </summary>
[SerializeField]
private AtomList _list = default(AtomList);
/// <summary>
/// Collection Instancer used if `Usage` is set to `COLLECTION_INSTANCER_CLEARED_EVENT`.
/// </summary>
[SerializeField]
private AtomCollectionInstancer _collectionInstancer = default(AtomCollectionInstancer);
/// <summary>
/// List Instancer used if `Usage` is set to `LIST_INSTANCER_CLEARED_EVENT`.
/// </summary>
[SerializeField]
private AtomListInstancer _listInstancer = default(AtomListInstancer);
<%ENDIF%>
}
}

@@ -15,3 +15,11 @@ using UnityEngine;

[CreateAssetMenu(menuName = "Unity Atoms/Events/{VALUE_TYPE_NAME}", fileName = "{VALUE_TYPE_NAME}Event")]
public sealed class {VALUE_TYPE_NAME}Event : AtomEvent<{VALUE_TYPE}> { }
public sealed class {VALUE_TYPE_NAME}Event : AtomEvent<{VALUE_TYPE}>
{
<%IF TYPE_IS_VOID%>
public override void Raise()
{
Raise(new Void());
}
<%ENDIF%>
}
}
using System;
using UnityAtoms.BaseAtoms;
<%IF TYPE_HAS_NAMESPACE%>using {TYPE_NAMESPACE};<%ENDIF%>
<%IF TYPE_HAS_NAMESPACE%>
using {TYPE_NAMESPACE};
<%ENDIF%>

@@ -29,2 +31,15 @@ <%IF HAS_SUB_UA_NAMESPACE%>

public bool Equals({VALUE_TYPE_NAME}Reference other) { return base.Equals(other); }
<%IF TYPE_IS_COLOR%>
/// <summary>
/// Set Alpha of Color by value.
/// </summary>
/// <param name="value">New alpha value.</param>
public void SetAlpha(float value) => Value = new Color(Value.r, Value.g, Value.b, value);
/// <summary>
/// Set Alpha of Color by Variable value.
/// </summary>
/// <param name="variable">New alpha Variable value.</param>
public void SetAlpha(AtomBaseVariable<float> variable) => SetAlpha(variable.Value);
<%ENDIF%>
}

@@ -51,6 +66,14 @@ <%ELSE%>

{
<%IF IS_COLLIDER%>
return (this.Value == null && other == null) || this.Value != null && other != null && this.Value == other;
<%ELSE%>
<%IF TYPE_IS_GAMEOBJECT%>
return (this.Value == null && other == null) || this.Value != null && other != null && this.Value.GetInstanceID() == other.GetInstanceID();
<%ELSE%>
throw new NotImplementedException();
}
<%ENDIF%>
<%ENDIF%>
}
}
<%ENDIF%>
}

@@ -17,3 +17,92 @@ using UnityEngine;

[CreateAssetMenu(menuName = "Unity Atoms/Variables/{VALUE_TYPE_NAME}", fileName = "{VALUE_TYPE_NAME}Variable")]
public sealed class {VALUE_TYPE_NAME}Variable : EquatableAtomVariable<{VALUE_TYPE}, {VALUE_TYPE_NAME}Pair, {VALUE_TYPE_NAME}Event, {VALUE_TYPE_NAME}PairEvent, {VALUE_TYPE_NAME}{VALUE_TYPE_NAME}Function> { }
public <%IF !TYPE_IS_STRING%>sealed <%ENDIF%>class {VALUE_TYPE_NAME}Variable : EquatableAtomVariable<{VALUE_TYPE}, {VALUE_TYPE_NAME}Pair, {VALUE_TYPE_NAME}Event, {VALUE_TYPE_NAME}PairEvent, {VALUE_TYPE_NAME}{VALUE_TYPE_NAME}Function>
{
<%IF TYPE_IS_COLOR%>
/// <summary>
/// Set Alpha of Color by value.
/// </summary>
/// <param name="value">New alpha value.</param>
public void SetAlpha(float value) => Value = new Color(Value.r, Value.g, Value.b, value);
/// <summary>
/// Set Alpha of Color by Variable value.
/// </summary>
/// <param name="variable">New alpha Variable value.</param>
public void SetAlpha(AtomBaseVariable<float> variable) => SetAlpha(variable.Value);
<%ENDIF%>
<%IF IS_NUMERIC%>
/// <summary>
/// Add value to Variable.
/// </summary>
/// <param name="value">Value to add.</param>
public void Add({VALUE_TYPE} value) => Value += value;
/// <summary>
/// Add variable value to Variable.
/// </summary>
/// <param name="variable">Variable with value to add.</param>
public void Add(AtomBaseVariable<{VALUE_TYPE}> variable) => Add(variable.Value);
/// <summary>
/// Subtract value from Variable.
/// </summary>
/// <param name="value">Value to subtract.</param>
public void Subtract({VALUE_TYPE} value) => Value -= value;
/// <summary>
/// Subtract variable value from Variable.
/// </summary>
/// <param name="variable">Variable with value to subtract.</param>
public void Subtract(AtomBaseVariable<{VALUE_TYPE}> variable) => Subtract(variable.Value);
/// <summary>
/// Multiply variable by value.
/// </summary>
/// <param name="value">Value to multiple by.</param>
public void MultiplyBy({VALUE_TYPE} value) => Value *= value;
/// <summary>
/// Multiply variable by Variable value.
/// </summary>
/// <param name="variable">Variable with value to multiple by.</param>
public void MultiplyBy(AtomBaseVariable<{VALUE_TYPE}> variable) => MultiplyBy(variable.Value);
/// <summary>
/// Divide Variable by value.
/// </summary>
/// <param name="value">Value to divide by.</param>
public void DivideBy({VALUE_TYPE} value) => Value /= value;
/// <summary>
/// Divide Variable by Variable value.
/// </summary>
/// <param name="variable">Variable value to divide by.</param>
public void DivideBy(AtomBaseVariable<{VALUE_TYPE}> variable) => DivideBy(variable.Value);
<%ENDIF%>
<%IF IS_VECTOR%>
/// <summary>
/// Multiply variable by value.
/// </summary>
/// <param name="value">Value to multiple by.</param>
public void MultiplyBy(float value) => Value *= value;
/// <summary>
/// Multiply variable by Variable value.
/// </summary>
/// <param name="variable">Variable with value to multiple by.</param>
public void MultiplyBy(AtomBaseVariable<float> variable) => MultiplyBy(variable.Value);
/// <summary>
/// Divide Variable by value.
/// </summary>
/// <param name="value">Value to divide by.</param>
public void DivideBy(float value) => Value /= value;
/// <summary>
/// Divide Variable by Variable value.
/// </summary>
/// <param name="variable">Variable value to divide by.</param>
public void DivideBy(AtomBaseVariable<float> variable) => DivideBy(variable.Value);
<%ENDIF%>
}
<%ELSE%>

@@ -29,3 +118,11 @@ /// <summary>

{
<%IF IS_COLLIDER%>
return (_value == null && other == null) || _value != null && other != null && _value == other;
<%ELSE%>
<%IF TYPE_IS_GAMEOBJECT%>
return (_value == null && other == null) || _value != null && other != null && _value.GetInstanceID() == other.GetInstanceID();
<%ELSE%>
throw new NotImplementedException();
<%ENDIF%>
<%ENDIF%>
}

@@ -32,0 +129,0 @@ }

2

package.json
{
"name": "com.mambojambostudios.unity-atoms-core",
"displayName": "Unity Atoms Core",
"version": "4.2.1",
"version": "4.3.0",
"unity": "2018.3",

@@ -6,0 +6,0 @@ "description": "Tiny modular pieces utilizing the power of Scriptable Objects",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc