First commit

This commit is contained in:
Adam Ramberg 2018-10-30 20:05:06 +01:00
commit 63b4bf99e7
264 changed files with 4756 additions and 0 deletions

37
.gitignore vendored Normal file
View File

@ -0,0 +1,37 @@
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*
# Visual Studio 2015 cache directory
/.vs/
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
# Unity3D generated meta files
*.pidb.meta
# Unity3D Generated File On Crash Reports
sysinfo.txt
# Builds
*.apk
*.unitypackage
# VS Code Settings
.vscode

8
Assets/Scenes.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 131a6b21c8605f84396be9f6751fb6e3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,188 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 10
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &519420028
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 519420032}
- component: {fileID: 519420031}
- component: {fileID: 519420029}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &519420029
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
--- !u!20 &519420031
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 1
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 0
m_HDR: 1
m_AllowMSAA: 0
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 0
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &519420032
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2cda990e2423bbf4892e6590ba056729
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/UnityAtoms.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: efcad9197646b4edea139b64e41bad22
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5a005666929044374a4cce42e2137dc8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Constants/Bool")]
public class BoolConstant : ScriptableObjectVariableBase<bool> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f734323dda6dd408b97878f8bc770bac
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Constants/Color")]
public class ColorConstant : ScriptableObjectVariableBase<Color> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a4329236db16543af8a3fdc66ddeb4ee
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Constants/Float")]
public class FloatConstant : ScriptableObjectVariableBase<float> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 383053a236f004aeab4b83d8ef98f157
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Constants/Int")]
public class IntConstant : ScriptableObjectVariableBase<int> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1179a197d01af4c9fb1825e9235f392a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Constants/String")]
public class StringConstant : ScriptableObjectVariableBase<string> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: add218cf21da940eb9ad37ad7e972cf8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Constants/Vector2")]
public class Vector2Constant : ScriptableObjectVariableBase<Vector2> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 237709d10eab7471c83592388ef1f408
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Constants/Vector3")]
public class Vector3Constant : ScriptableObjectVariableBase<Vector3> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4b0e7b3be568f4c30b48ab7c1842156b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2ffc2318e4d5149f0810fc4bb6e64aa2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,23 @@
using UnityEngine;
namespace UnityAtoms
{
public static class Vector2Extensions
{
public static Vector3 ToVector3(this Vector2 v2, float z = 0f)
{
return new Vector3(v2.x, v2.y, z);
}
public static Vector3 ToWorldPos(this Vector2 v2)
{
return Camera.main.ScreenToWorldPoint(v2);
}
public static Vector2 TowardsTarget(this Vector2 v2, Vector2 target, float maxDistance)
{
var distance = target - v2;
return v2 + (distance.normalized * maxDistance);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 201318a5ae06548e2bc1b99f2c3449ce
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,18 @@
using UnityEngine;
namespace UnityAtoms
{
public static class Vector3Extensions
{
public static Vector2 ToVector2(this Vector2 v3)
{
return new Vector2(v3.x, v3.y);
}
public static Vector3 TowardsTarget(this Vector3 v3, Vector3 target, float maxDistance)
{
var distance = target - v3;
return v3 + (distance.normalized * maxDistance);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c4645a7be4d6d40ee9b7bb8d7706f25e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ae80c11fe46534d49a5ade3f3223b22a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,4 @@
namespace UnityAtoms
{
public abstract class BoolAction : GameAction<bool> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ef57afbf1dd624182b94670d16bc8fc7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,6 @@
using UnityEngine;
namespace UnityAtoms
{
public abstract class Collider2DAction : GameAction<Collider2D> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8f1fb8cb50d164aea9d6925ddffdd487
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,6 @@
using UnityEngine;
namespace UnityAtoms
{
public abstract class Collider2DEventAction : GameAction<Collider2DEvent> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1d4b42e2c0b244137ad88785678382ad
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,6 @@
using UnityEngine;
namespace UnityAtoms
{
public abstract class Collider2DGameObjectAction : GameAction<Collider2D, GameObject> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6bb9390c39976416e8aa3d428b7e9698
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,6 @@
using UnityEngine;
namespace UnityAtoms
{
public abstract class Collider2DGameObjectEventAction : GameAction<Collider2DEvent, GameObject> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9b3c2d8fb96d74c1aaa60e68c552de82
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,6 @@
using UnityEngine;
namespace UnityAtoms
{
public abstract class ColorAction : GameAction<Color> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cd4db781cde534e1dabc5e346891c488
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,4 @@
namespace UnityAtoms
{
public abstract class FloatAction : GameAction<float> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: df3be4aed2bae4dbd97a966788ea0663
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,6 @@
using UnityEngine;
namespace UnityAtoms
{
public abstract class GameObjectAction : GameAction<GameObject> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8fff9a2eb751d448e9d6c27aef63de36
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,4 @@
namespace UnityAtoms
{
public abstract class GameObjectListAction : GameAction<GameObjectList> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c5f22b742cdf84e90915894f010a89b4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,4 @@
namespace UnityAtoms
{
public abstract class IntAction : GameAction<int> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 710add4913ab9499b867fbe4305e3f02
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace UnityAtoms
{
public abstract class GameAction : ScriptableObject
{
public abstract void Do();
}
public abstract class GameAction<T1> : ScriptableObject
{
public abstract void Do(T1 t1);
}
public abstract class GameAction<T1, T2> : ScriptableObject
{
public abstract void Do(T1 t1, T2 t2);
}
public abstract class GameAction<T1, T2, T3> : ScriptableObject
{
public abstract void Do(T1 t1, T2 t2, T3 t3);
}
public abstract class GameAction<T1, T2, T3, T4> : ScriptableObject
{
public abstract void Do(T1 t1, T2 t2, T3 t3, T4 t4);
}
public abstract class GameAction<T1, T2, T3, T4, T5> : ScriptableObject
{
public abstract void Do(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 36ac910c3225e4df095bd8b94a9ea5b7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e1c9856ef98eb420c9d483b73e3ec610
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Game Actions/Set Variable Value/Bool")]
public class SetBoolVariableValue : SetVariableValue<bool, BoolVariable, BoolReference, BoolEvent, BoolBoolEvent> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 53e0bc832129f428f9ab1436e9ce5ea9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Game Actions/Set Variable Value/Int")]
public class SetIntVariableValue : SetVariableValue<int, IntVariable, IntReference, IntEvent, IntIntEvent> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 539a8189c31354a17be5a7fffc9a79c1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,19 @@
using UnityEngine;
namespace UnityAtoms
{
public abstract class SetVariableValue<T, V, R, E1, E2> : VoidAction where E1 : GameEvent<T> where E2 : GameEvent<T, T> where V : ScriptableObjectVariable<T, E1, E2> where R : ScriptableObjectReference<T, V, E1, E2>
{
[SerializeField]
private V Variable;
[SerializeField]
private R Value;
public override void Do()
{
Variable.Value = Value.Value;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8ca3cfc9cbb4b4a50ac810892cde9d5b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,6 @@
using UnityEngine;
namespace UnityAtoms
{
public abstract class Vector2Action : GameAction<Vector2> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6714240c3b4ff42ed87f6570fc48b0cc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,6 @@
using UnityEngine;
namespace UnityAtoms
{
public abstract class Vector3Action : GameAction<Vector3> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d327124f859e341ba9036be56fc5e4d3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,12 @@
namespace UnityAtoms
{
public abstract class VoidAction : GameAction<Void>
{
public override void Do(Void _)
{
Do();
}
public abstract void Do();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 56eb192a58b83417db455bd20e0c1fb6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,6 @@
using UnityEngine;
namespace UnityAtoms
{
public abstract class VoidGameObjectAction : GameAction<Void, GameObject> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ce6910fcc088a429cb805ea7f3a91059
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b6931a91a73da4b52a887f290260d402
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
using System;
using System.Collections.Generic;
using UnityEngine.Events;
using UnityEngine;
namespace UnityAtoms
{
public class BoolListener : GameEventListener<bool, BoolAction, BoolEvent, UnityBoolEvent> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dfb9d99d0bd5c4ba3b0a5ae85d126de7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace UnityAtoms
{
public class Collider2DGameObjectListener : GameEventListener<Collider2D, GameObject, Collider2DGameObjectAction, Collider2DGameObjectEvent, UnityCollider2DGameObjectEvent> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e4e363ffbd7034feab35a82bfc193a56
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace UnityAtoms
{
public class Collider2DListener : GameEventListener<Collider2D, Collider2DAction, Collider2DEvent, UnityCollider2DEvent> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b66f39837a85c44548ae3d7bce0ba9f5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace UnityAtoms
{
public class ColorListener : GameEventListener<Color, ColorAction, ColorEvent, UnityColorEvent> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ccfe22d2098fd4d7d84085b658196c02
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
using System;
using System.Collections.Generic;
using UnityEngine.Events;
using UnityEngine;
namespace UnityAtoms
{
public class FloatListener : GameEventListener<float, FloatAction, FloatEvent, UnityFloatEvent> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6d9a93524d8b64dddbfc7169824799f6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,75 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace UnityAtoms
{
public abstract class GameEventListener<T, GA, E, UER> : MonoBehaviour, IGameEventListener<T> where GA : GameAction<T> where E : GameEvent<T> where UER : UnityEvent<T>
{
[SerializeField]
private E Event;
public E GameEvent { get { return Event; } set { Event = value; } }
[SerializeField]
private UER UnityEventResponse;
[SerializeField]
private List<GA> GameActionResponses = new List<GA>();
private void OnEnable()
{
if (Event == null) return;
GameEvent.RegisterListener(this);
}
private void OnDisable()
{
GameEvent.UnregisterListener(this);
}
public void OnEventRaised(T item)
{
if (UnityEventResponse != null) { UnityEventResponse.Invoke(item); }
for (int i = 0; GameActionResponses != null && i < GameActionResponses.Count; ++i)
{
GameActionResponses[i].Do(item);
}
}
}
public abstract class GameEventListener<T1, T2, GA, E, UER> : MonoBehaviour, IGameEventListener<T1, T2> where GA : GameAction<T1, T2> where E : GameEvent<T1, T2> where UER : UnityEvent<T1, T2>
{
[SerializeField]
private E Event;
public E GameEvent { get { return Event; } set { Event = value; } }
[SerializeField]
private UER UnityEventResponse;
[SerializeField]
private List<GA> GameActionResponses = new List<GA>();
private void OnEnable()
{
if (Event == null) return;
GameEvent.RegisterListener(this);
}
private void OnDisable()
{
if (Event == null) return;
GameEvent.UnregisterListener(this);
}
public void OnEventRaised(T1 first, T2 second)
{
if (UnityEventResponse != null) { UnityEventResponse.Invoke(first, second); }
for (int i = 0; GameActionResponses != null && i < GameActionResponses.Count; ++i)
{
GameActionResponses[i].Do(first, second);
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 000f07bf50da14864b79d6283216c146
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace UnityAtoms
{
public class GameObjectListener : GameEventListener<GameObject, GameObjectAction, GameObjectEvent, UnityGameObjectEvent> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4d87cec123cbf4991996eac0f92ba55d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,12 @@
namespace UnityAtoms
{
public interface IGameEventListener<T>
{
void OnEventRaised(T item);
}
public interface IGameEventListener<T1, T2>
{
void OnEventRaised(T1 first, T2 second);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ea2dd93fc28a54471be8efc91f5cd111
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
using System;
using System.Collections.Generic;
using UnityEngine.Events;
using UnityEngine;
namespace UnityAtoms
{
public class IntListener : GameEventListener<int, IntAction, IntEvent, UnityIntEvent> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 91b5aee566a354311b8e8c09dbd33fc2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace UnityAtoms
{
public class Vector2Listener : GameEventListener<Vector2, Vector2Action, Vector2Event, UnityVector2Event> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fdc8a4db9daf748c89a0f03c5d042d73
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace UnityAtoms
{
public class Vector3Listener : GameEventListener<Vector3, Vector3Action, Vector3Event, UnityVector3Event> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e76d1a324f8cb42f4b1a37468254c009
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
using System;
using UnityEngine;
namespace UnityAtoms
{
public class VoidGameObjectListener : GameEventListener<Void, GameObject, VoidGameObjectAction, VoidGameObjectEvent, UnityVoidGameObjectEvent> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: aad1503be60e04f61aceeb760aeea171
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
using System;
using System.Collections.Generic;
using UnityEngine.Events;
using UnityEngine;
namespace UnityAtoms
{
public class VoidListener : GameEventListener<Void, VoidAction, VoidEvent, UnityVoidEvent> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 99fb4feb2c3ac4b65a0919d569bf6362
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f81562da9bcee48729913ada71c0862a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Game Events/Bool Bool")]
public class BoolBoolEvent : GameEvent<bool, bool> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 10942683d8ff9455aada9fffe9607f38
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Game Events/Bool")]
public class BoolEvent : GameEvent<bool> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 60a4d62820cb849339f957c2918b6a15
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Game Events/Collider2D")]
public class Collider2DEvent : GameEvent<Collider2D> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: aea4b076fcc20470fbbe626354b90f5f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Game Events/Collider2D GameObject")]
public class Collider2DGameObjectEvent : GameEvent<Collider2D, GameObject> { }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cc83d7261fcc443a9adeb2348cc3909b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Game Events/Color Color")]
public class ColorColorEvent : GameEvent<Color, Color> { }
}

Some files were not shown because too many files have changed in this diff Show More