From cf272b33bd537402d7c79f030ef13eb63ada5b3e Mon Sep 17 00:00:00 2001 From: MystikalPooka Date: Mon, 10 Dec 2018 21:01:03 -0700 Subject: [PATCH 01/16] Inprocess of changing Parallel to stream tick --- Assets/TestScene.unity | 111 +++++++++-------- .../Visual Behavior Tree/Editor/BaseEditor.cs | 5 + .../BehaviorExtensions.cs | 2 +- .../Editor/TypeDependantDrawer.cs | 44 ------- .../New BehaviorTreeManagerAsset 3.asset | 31 ++--- .../Visual Behavior Tree/Examples/test2.asset | 2 +- .../Scripts/AI/BehaviorManager.cs | 86 ++++++------- .../Scripts/AI/BehaviorTreeElement.cs | 39 ++---- .../Scripts/AI/BehaviorTreeManagerAsset.cs | 2 +- .../AI/Components/BehaviorComponent.cs | 5 +- .../Scripts/AI/Components/ParallelRunner.cs | 84 ++++--------- .../Scripts/AI/Components/Selector.cs | 2 +- .../Scripts/AI/Components/Sequencer.cs | 2 +- .../AI/Decorators/BehaviorDecorator.cs | 8 +- .../Scripts/AI/Decorators/Inverter.cs | 4 +- .../Scripts/AI/Nodes/BehaviorNode.cs | 6 - .../Scripts/AI/Nodes/DebugOutNode.cs | 8 +- .../AI/Nodes/MoveEnemyIfCloseToPlayer.cs | 3 +- .../Scripts/AI/Nodes/SwapPrefabsOnTime.cs | 38 ++++++ .../AI/Nodes/SwapPrefabsOnTime.cs.meta | 11 ++ Packages/manifest.json | 74 ++++++----- UIElementsSchema/UIElements.xsd | 3 +- .../UnityEditor.Experimental.UIElements.xsd | 2 +- .../UnityEditor.PackageManager.UI.xsd | 116 ++++++++++++++++++ .../UnityEngine.Experimental.UIElements.xsd | 2 +- 25 files changed, 370 insertions(+), 320 deletions(-) create mode 100644 Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs create mode 100644 Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs.meta create mode 100644 UIElementsSchema/UnityEditor.PackageManager.UI.xsd diff --git a/Assets/TestScene.unity b/Assets/TestScene.unity index 1711260..1cbd18a 100644 --- a/Assets/TestScene.unity +++ b/Assets/TestScene.unity @@ -13,7 +13,7 @@ OcclusionCullingSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 8 + serializedVersion: 9 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -39,6 +39,7 @@ RenderSettings: m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} m_IndirectSpecularColor: {r: 0.44657844, g: 0.49641222, b: 0.57481694, a: 1} + m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 @@ -54,11 +55,10 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 9 + serializedVersion: 10 m_Resolution: 2 m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 + m_AtlasSize: 1024 m_AO: 0 m_AOMaxDistance: 1 m_CompAOExponent: 1 @@ -116,9 +116,9 @@ NavMeshSettings: --- !u!1 &132278577 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 132278582} - component: {fileID: 132278581} @@ -135,7 +135,7 @@ GameObject: --- !u!114 &132278578 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 132278577} m_Enabled: 1 @@ -144,14 +144,14 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: BehaviorTreeFile: {fileID: 11400000, guid: f4cb4c96e175fa243baf0700d4057360, type: 2} - SecondsBetweenTicks: 0.5 + MilliSecondsBetweenTicks: 10000 TimesToTick: -1 spliceNewIntoTree: 0 SpliceList: [] --- !u!23 &132278579 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 132278577} m_Enabled: 1 @@ -161,6 +161,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 m_Materials: - {fileID: 2100000, guid: e57457a42a153bd4894a06d8105866c5, type: 2} m_StaticBatchInfo: @@ -185,7 +186,7 @@ MeshRenderer: --- !u!65 &132278580 BoxCollider: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 132278577} m_Material: {fileID: 0} @@ -197,14 +198,14 @@ BoxCollider: --- !u!33 &132278581 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 132278577} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &132278582 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 132278577} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -217,9 +218,9 @@ Transform: --- !u!1 &271199282 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 271199288} - component: {fileID: 271199287} @@ -236,27 +237,31 @@ GameObject: --- !u!81 &271199284 AudioListener: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 271199282} m_Enabled: 1 --- !u!124 &271199285 Behaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 271199282} m_Enabled: 1 --- !u!20 &271199287 Camera: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 271199282} m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 2 m_BackGroundColor: {r: 0.15084341, g: 0.18082586, b: 0.22794116, a: 0} + m_projectionMatrixMode: 1 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 m_NormalizedViewPortRect: serializedVersion: 2 x: 0 @@ -286,7 +291,7 @@ Camera: --- !u!4 &271199288 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 271199282} m_LocalRotation: {x: 0.2164396, y: -0, z: -0, w: 0.97629607} @@ -299,7 +304,7 @@ Transform: --- !u!114 &271199289 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 271199282} m_Enabled: 1 @@ -311,9 +316,9 @@ MonoBehaviour: --- !u!1 &374731282 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 374731286} - component: {fileID: 374731285} @@ -330,7 +335,7 @@ GameObject: --- !u!23 &374731283 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 374731282} m_Enabled: 1 @@ -340,6 +345,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 m_Materials: - {fileID: 2100000, guid: e57457a42a153bd4894a06d8105866c5, type: 2} m_StaticBatchInfo: @@ -364,7 +370,7 @@ MeshRenderer: --- !u!65 &374731284 BoxCollider: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 374731282} m_Material: {fileID: 0} @@ -376,14 +382,14 @@ BoxCollider: --- !u!33 &374731285 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 374731282} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &374731286 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 374731282} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -396,7 +402,7 @@ Transform: --- !u!114 &374731287 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 374731282} m_Enabled: 1 @@ -405,16 +411,16 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: BehaviorTreeFile: {fileID: 11400000, guid: f4cb4c96e175fa243baf0700d4057360, type: 2} - SecondsBetweenTicks: 0.5 + MilliSecondsBetweenTicks: 1000 TimesToTick: -1 spliceNewIntoTree: 0 SpliceList: [] --- !u!1 &761835721 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 761835725} - component: {fileID: 761835724} @@ -431,7 +437,7 @@ GameObject: --- !u!23 &761835722 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 761835721} m_Enabled: 1 @@ -441,6 +447,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 m_Materials: - {fileID: 2100000, guid: e57457a42a153bd4894a06d8105866c5, type: 2} m_StaticBatchInfo: @@ -465,7 +472,7 @@ MeshRenderer: --- !u!143 &761835723 CharacterController: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 761835721} m_Material: {fileID: 0} @@ -482,14 +489,14 @@ CharacterController: --- !u!33 &761835724 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 761835721} m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &761835725 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 761835721} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -503,7 +510,7 @@ Transform: --- !u!114 &761835727 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 761835721} m_Enabled: 1 @@ -516,9 +523,9 @@ MonoBehaviour: --- !u!1 &1302823949 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1302823950} - component: {fileID: 1302823951} @@ -532,7 +539,7 @@ GameObject: --- !u!4 &1302823950 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1302823949} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -545,7 +552,7 @@ Transform: --- !u!114 &1302823951 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1302823949} m_Enabled: 1 @@ -556,9 +563,9 @@ MonoBehaviour: --- !u!1 &1669096001 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1669096003} - component: {fileID: 1669096002} @@ -572,7 +579,7 @@ GameObject: --- !u!108 &1669096002 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1669096001} m_Enabled: 1 @@ -599,6 +606,7 @@ Light: serializedVersion: 2 m_Bits: 4294967295 m_Lightmapping: 1 + m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 @@ -608,7 +616,7 @@ Light: --- !u!4 &1669096003 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1669096001} m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} @@ -621,9 +629,9 @@ Transform: --- !u!1 &1735717988 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1735717992} - component: {fileID: 1735717991} @@ -639,7 +647,7 @@ GameObject: --- !u!23 &1735717989 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1735717988} m_Enabled: 1 @@ -649,6 +657,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 m_Materials: - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: @@ -673,7 +682,7 @@ MeshRenderer: --- !u!65 &1735717990 BoxCollider: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1735717988} m_Material: {fileID: 0} @@ -685,14 +694,14 @@ BoxCollider: --- !u!33 &1735717991 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1735717988} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &1735717992 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1735717988} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -705,9 +714,9 @@ Transform: --- !u!1 &1865069242 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1865069244} m_Layer: 0 @@ -720,7 +729,7 @@ GameObject: --- !u!4 &1865069244 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1865069242} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} diff --git a/Assets/Visual Behavior Tree/Editor/BaseEditor.cs b/Assets/Visual Behavior Tree/Editor/BaseEditor.cs index eb09d5d..97686b3 100644 --- a/Assets/Visual Behavior Tree/Editor/BaseEditor.cs +++ b/Assets/Visual Behavior Tree/Editor/BaseEditor.cs @@ -59,6 +59,11 @@ protected void DrawDefaultInspectors(GUIContent label, T target) var fieldProp = serializedObject.FindProperty(field.Name); EditorList.Show(fieldProp, EditorListOption.Buttons | EditorListOption.ElementLabels); } + else if(field.FieldType == typeof(GameObject[])) + { + var fieldProp = serializedObject.FindProperty(field.Name); + EditorList.Show(fieldProp, EditorListOption.Buttons | EditorListOption.ElementLabels); + } else if(serializedObject != null) { //Debug.Log("Trying to draw: " + field.Name); diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BehaviorExtensions.cs b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BehaviorExtensions.cs index cc9c7d2..987cdb4 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BehaviorExtensions.cs +++ b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BehaviorExtensions.cs @@ -103,7 +103,7 @@ public static void SaveBehaviorAsset(this BehaviorManager behaviorManager, strin if(behaviorManager != null) { behaviorManager.Reinitialize(); - asset.SecondsBetweenTicks = behaviorManager.SecondsBetweenTicks; + asset.MilliSecondsBetweenTicks =behaviorManager.MilliSecondsBetweenTicks; asset.TimesToTick = behaviorManager.TimesToTick; TreeElementUtility.TreeToList(behaviorManager.Runner, runnerElementList); diff --git a/Assets/Visual Behavior Tree/Editor/TypeDependantDrawer.cs b/Assets/Visual Behavior Tree/Editor/TypeDependantDrawer.cs index 7c43f97..e923285 100644 --- a/Assets/Visual Behavior Tree/Editor/TypeDependantDrawer.cs +++ b/Assets/Visual Behavior Tree/Editor/TypeDependantDrawer.cs @@ -17,43 +17,6 @@ public static void DrawAllFields(dynamic element, Rect rect) DrawFieldsFlowLayout(new GUIContent(""), element, rect); } - private static void DrawFields(GUIContent label, dynamic target, Rect rect) - { - Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(target.ElementType); - FieldInfo[] fields = type.GetFields(); - - GUILayout.BeginArea(rect); - foreach (FieldInfo field in fields) - { - if (field.IsPublic) - { - if (field.FieldType == typeof(int)) - { - field.SetValue(target, EditorGUILayout.IntField( - MakeLabel(field), (int)field.GetValue(target), GUILayout.ExpandWidth(false))); - } - else if (field.FieldType == typeof(float)) - { - field.SetValue(target, EditorGUILayout.FloatField( - MakeLabel(field), (float)field.GetValue(target), GUILayout.ExpandWidth(false))); - } - else if (field.FieldType == typeof(string)) - { - field.SetValue(target, EditorGUILayout.TextField( - MakeLabel(field), (string)field.GetValue(target), GUILayout.ExpandWidth(false))); - } - else - { - Debug.LogError( - "DrawFields does not support fields of type " + - field.FieldType); - } - } - - } - GUILayout.EndArea(); - } - private static GUIContent MakeLabel(FieldInfo field) { GUIContent guiContent = new GUIContent(); @@ -90,7 +53,6 @@ private static void DrawFieldsFlowLayout(GUIContent label, dynamic target, Rect { using (new GUILayout.AreaScope(boxes[i],"", EditorStyles.boldLabel)) { - //EditorGUILayout.LabelField(items[i]); if (fields[i].FieldType == typeof(int)) { fields[i].SetValue(target, EditorGUILayout.IntField( @@ -106,12 +68,6 @@ private static void DrawFieldsFlowLayout(GUIContent label, dynamic target, Rect fields[i].SetValue(target, EditorGUILayout.TextField( MakeLabel(fields[i]), (string)fields[i].GetValue(target))); } - else - { - //Debug.LogError( - // "DrawFields does not support fields of type " + - // fields[i].FieldType); - } } } } diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 3.asset b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 3.asset index b8f47f3..676affc 100644 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 3.asset +++ b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 3.asset @@ -11,32 +11,17 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ccda9b5dedb28eb4788e2d2d8c20a954, type: 3} m_Name: New BehaviorTreeManagerAsset 3 m_EditorClassIdentifier: - TimesToTick: 0 - SecondsBetweenTicks: 0.1 + TimesToTick: -1 + SecondsBetweenTicks: 1 RunnerElementsJSON: "[\r\n {\r\n \"NumberOfFailuresBeforeFail\": 0,\r\n \"NumberOfSuccessBeforeSucceed\": 0,\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.ParallelRunner\",\r\n \ \"Depth\": -1,\r\n \"HasChildren\": true,\r\n \"Name\": \"root\",\r\n \ \"ID\": -1\r\n },\r\n {\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": - \"Assets.Scripts.AI.Components.Selector\",\r\n \"Depth\": 0,\r\n \"HasChildren\": - true,\r\n \"Name\": \"Selector 0\",\r\n \"ID\": 0\r\n },\r\n {\r\n \"Initialized\": - false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": 0,\r\n \"HasValue\": - true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Decorators.Inverter\",\r\n - \ \"Depth\": 1,\r\n \"HasChildren\": true,\r\n \"Name\": \"Inverter 4\",\r\n - \ \"ID\": 4\r\n },\r\n {\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": - {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": - \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n \"Depth\": 2,\r\n \"HasChildren\": - false,\r\n \"Name\": \"DebugOutNode 5\",\r\n \"ID\": 5\r\n },\r\n {\r\n - \ \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Sequencer\",\r\n - \ \"Depth\": 1,\r\n \"HasChildren\": true,\r\n \"Name\": \"Sequencer 3\",\r\n - \ \"ID\": 3\r\n },\r\n {\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": - {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": - \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"Depth\": 2,\r\n \"HasChildren\": - true,\r\n \"Name\": \"Inverter 1\",\r\n \"ID\": 1\r\n },\r\n {\r\n \"MoveSpeed\": - 1.0,\r\n \"UpdatePlayersTickInterval\": 20,\r\n \"UpdateSelfPositionTickInterval\": - 5,\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.MoveEnemyIfCloseToPlayer\",\r\n - \ \"Depth\": 3,\r\n \"HasChildren\": false,\r\n \"Name\": \"MoveEnemyIfCloseToPlayer - 2\",\r\n \"ID\": 2\r\n }\r\n]" + \"Assets.Scripts.AI.Components.Sequencer\",\r\n \"Depth\": 0,\r\n \"HasChildren\": + true,\r\n \"Name\": \"Sequencer 6\",\r\n \"ID\": 6\r\n },\r\n {\r\n \"prefabsToSwapBetween\": + null,\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": + 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Visual_Behavior_Tree.Scripts.AI.Nodes.SwapPrefabsOnTime\",\r\n + \ \"Depth\": 1,\r\n \"HasChildren\": false,\r\n \"Name\": \"SwapPrefabsOnTime + 7\",\r\n \"ID\": 7\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/test2.asset b/Assets/Visual Behavior Tree/Examples/test2.asset index 5f337e8..ee0cb2c 100644 --- a/Assets/Visual Behavior Tree/Examples/test2.asset +++ b/Assets/Visual Behavior Tree/Examples/test2.asset @@ -12,7 +12,7 @@ MonoBehaviour: m_Name: test2 m_EditorClassIdentifier: TimesToTick: 135 - SecondsBetweenTicks: 0.5 + MilliSecondsBetweenTicks: 1000 RunnerElementsJSON: "[\r\n {\r\n \"NumberOfFailuresBeforeFail\": 0,\r\n \"NumberOfSuccessBeforeSucceed\": 0,\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.ParallelRunner\",\r\n diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs index cf1577e..98fab02 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs @@ -9,6 +9,7 @@ using Assets.Scripts.AI.Tree; using System.Linq; using Assets.Scripts.AI.Behavior_Logger; +using UniRx.Diagnostics; namespace Assets.Scripts.AI { @@ -45,8 +46,9 @@ private set /// Seconds between every tick. At "0" this will tick every frame (basically an update loop) /// [SerializeField] + [Description("Seconds between every tick. At 0 this will tick every frame")] - public float SecondsBetweenTicks = 0.1f; + public double MilliSecondsBetweenTicks = 100; /// /// Number of times to tick the full tree. Set to a negative number to make an infinitely running behavior tree. @@ -65,11 +67,6 @@ private set private bool initialized = false; - void OnEnable() - { - InitIfNeeded(); - } - public void InitIfNeeded() { if (initialized == false) @@ -78,7 +75,8 @@ public void InitIfNeeded() } } - public IObservable TreeStream { get; private set; } + public Subject TreeSubject { get; private set; } + List treeList = new List(); public void Reinitialize() { //TODO: Change to runner extension @@ -86,39 +84,25 @@ public void Reinitialize() if(spliceNewIntoTree) SpliceIntoRunner(); - List treeList = new List(); - TreeElementUtility.TreeToList(Runner, treeList); - var treeQuery = from el in treeList - select el; - - TreeStream = - treeQuery - .ToObservable() - .Do(xr => - { - xr.ObserveEveryValueChanged(x => x.NumberOfTicksReceived) - .Do(x => - { - var logEntry = new BehaviorLogEntry( - loggerName: BehaviorLogger.Name, - logType: LogType.Log, - timestamp: DateTime.Now, - message: "Ticked!", - behaviorID: xr.ID, - newState: xr.CurrentState, - ticknum: xr.NumberOfTicksReceived.Value, - context: this, - state: xr); - BehaviorLogger.Raw(logEntry); - }) - - .Subscribe() - .AddTo(this); - }); - - TreeStream.Subscribe().AddTo(this); + var treeQuery = treeList.AsEnumerable(); + TreeSubject = new Subject(); + TreeSubject.Subscribe(xr => + { + var logEntry = new BehaviorLogEntry( + loggerName: BehaviorLogger.Name, + logType: LogType.Log, + timestamp: DateTime.Now, + message: "Ticked!", + behaviorID: xr.ID, + newState: xr.CurrentState, + ticknum: xr.NumberOfTicksReceived.Value, + context: this, + state: xr); + BehaviorLogger.Raw(logEntry); + Debug.Log("xr debug initialize"); + }).AddTo(this); initialized = true; } @@ -128,18 +112,22 @@ public void Reinitialize() /// /// //TODO: CHANGE TO Zip() instead of loop - IEnumerator Start() + void Start() { - while(TimesToTick != 0) - { - yield return Runner.Tick() - .ToObservable(true) - .Subscribe(_ => { }, e => Debug.LogError("Error: " + e)) - .AddTo(this); - TreeStream.Subscribe().AddTo(this); - yield return new WaitForSeconds(SecondsBetweenTicks); - if (TimesToTick >= 1) --TimesToTick; - } + InitIfNeeded(); + + var timeStep = Observable.Interval(TimeSpan.FromMilliseconds(MilliSecondsBetweenTicks)) + .TakeWhile((_) => TimesToTick != 0) + .Do(cx => + { + if (TimesToTick > 0) --TimesToTick; + Debug.Log(TimesToTick); + Runner.Tick(); + TreeSubject.OnNext(Runner); + }) + .Debug("") + .Subscribe() + .AddTo(this); } /// diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs index 9b94f03..d41b5a4 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs @@ -9,29 +9,14 @@ namespace Assets.Scripts.AI { [Serializable] - public class BehaviorTreeElement : TreeElement, IDisposable + public abstract class BehaviorTreeElement : TreeElement, IDisposable { + //is this needed? public LongReactiveProperty NumberOfTicksReceived { get; private set; } + //used for reflection upon JSON loading public string ElementType { get; set; } - [Newtonsoft.Json.JsonIgnore] - [SerializeField] - private BehaviorManager _BehaviorTreeManager; - [Newtonsoft.Json.JsonIgnore] - public BehaviorManager BehaviorTreeManager - { - get - { - return _BehaviorTreeManager; - } - - set - { - _BehaviorTreeManager = value; - } - } - public BehaviorTreeElement(string name, int depth, int id) : base(name, depth, id) { @@ -45,25 +30,21 @@ public BehaviorTreeElement(string name, int depth, int id) public BehaviorState CurrentState; public bool Initialized = false; - public virtual IEnumerator Tick(WaitForSeconds delayStart = null) - { - if (!Initialized) Initialize(); - if (delayStart != null) - { - yield return delayStart; - } - NumberOfTicksReceived.SetValueAndForceNotify(NumberOfTicksReceived.Value + 1); - } + + /// + /// The primary method of action + /// + /// observable stream of states from this behavior + public abstract IObservable Tick(); public virtual void Initialize() { + if (Initialized) return; var allChildrenToRun = from x in Children select x as BehaviorTreeElement; foreach(var ch in allChildrenToRun) { - //TODO: will be changed to an actual debugger instead of just unity logs. Issue #3 - //Subscribes to updates to state changes from all children ch.ObserveEveryValueChanged(x => x.CurrentState) .Subscribe() .AddTo(Disposables); diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs index d0ebe1c..2df9b6a 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs @@ -12,7 +12,7 @@ namespace Assets.Scripts.AI public class BehaviorTreeManagerAsset : ScriptableObject { public int TimesToTick; - public float SecondsBetweenTicks = 0.1f; + public double MilliSecondsBetweenTicks = 100; public string RunnerElementsJSON; } diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/BehaviorComponent.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/BehaviorComponent.cs index 91e1dff..15de38f 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/BehaviorComponent.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/BehaviorComponent.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using UniRx; using UnityEngine; namespace Assets.Scripts.AI.Components @@ -19,9 +20,9 @@ public virtual void AddChild(BehaviorTreeElement element) Children.Add(element); } - public override IEnumerator Tick(WaitForSeconds delayStart = null) + public override System.IObservable Tick() { - return base.Tick(delayStart); + return Observable.Empty(); } } diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs index e8c7a6e..6b9b6dc 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs @@ -8,13 +8,13 @@ namespace Assets.Scripts.AI.Components { [Serializable] - [Description("Runs all children at same time. Fails if NumFailures are >0 and children failed reach that number. Succeeds otherwise.")] + [Description("Runs all children at same time. Fails early if NumFailures are >0 and total children failed reach that number. Succeeds otherwise.")] public class ParallelRunner : BehaviorComponent { /// /// Number of times the children return fail before the parallel runner returns in a fail state. /// 0 means ignore number of failures. - /// 0 for both succeed and fail means loops infinitely + /// 0 for both succeed and fail means run this once /// [SerializeField] public int NumberOfFailuresBeforeFail = 0; protected IntReactiveProperty NumberOfFailures = new IntReactiveProperty(0); @@ -22,7 +22,7 @@ public class ParallelRunner : BehaviorComponent /// /// Number of times the children return success before the parallel runner returns in a success state. /// 0 means ignore number of sucesses. - /// 0 for both succeed and fail means loops infinitely + /// 0 for both succeed and fail means this will only run once /// [SerializeField] public int NumberOfSuccessBeforeSucceed = 0; protected IntReactiveProperty NumberOfSuccesses = new IntReactiveProperty(0); @@ -30,71 +30,39 @@ public class ParallelRunner : BehaviorComponent public ParallelRunner(string name, int depth, int id) : base(name, depth, id) { } - public override IEnumerator Tick(WaitForSeconds delayStart = null) + public override IObservable Tick() { - //Initialize and start tick - base.Tick().ToObservable() - //.Do(_ => BehaviorLogger.Log("Subscribed to ParallelRunner at start (base.tick()")) - .Subscribe(); - CurrentState = BehaviorState.Running; - if (Children == null || Children.Count == 0) { Debug.LogWarning("Children Null in parallel runner"); - CurrentState = BehaviorState.Fail; - yield break; + return Observable.Return(BehaviorState.Fail); } - foreach(var ch in Children) - { - ((BehaviorTreeElement)ch).Tick() - .ToObservable() - .Do(_ => - { - if (NumberOfFailures.Value >= NumberOfFailuresBeforeFail && NumberOfFailuresBeforeFail > 0) - { - CurrentState = BehaviorState.Fail; - return; - } + var allChildren = Children.ToObservable() + .SelectMany(child => ((BehaviorTreeElement)child).Tick()) + .Do(state => { + if (state == BehaviorState.Fail) + NumberOfFailures.SetValueAndForceNotify(NumberOfFailures.Value + 1); + if (state == BehaviorState.Success) + NumberOfSuccesses.SetValueAndForceNotify(NumberOfSuccesses.Value + 1); + }) + .TakeWhile(_ => NumberOfSuccesses.Value < NumberOfSuccessBeforeSucceed && + NumberOfFailures.Value < NumberOfFailuresBeforeFail) + .Publish() + .RefCount(); - if (NumberOfSuccesses.Value >= NumberOfSuccessBeforeSucceed && NumberOfSuccessBeforeSucceed > 0) - { - CurrentState = BehaviorState.Success; - return; - } - }) - .Subscribe().AddTo(Disposables); - } - if (CurrentState == BehaviorState.Running) CurrentState = BehaviorState.Success; - } + var failedChildren = allChildren.Where(state => state == BehaviorState.Fail) + .Do(_ => NumberOfFailures.SetValueAndForceNotify(NumberOfFailures.Value + 1)) + .Subscribe(); + + var succeedChildren = allChildren.Where(state => state == BehaviorState.Success) + .Do(_ => NumberOfSuccesses.SetValueAndForceNotify(NumberOfFailures.Value + 1)) + .Subscribe(); - public override void Initialize() - { - var allChildrenToRun = from x in Children - select x as BehaviorTreeElement; - foreach (var ch in allChildrenToRun) - { - //TODO: will be changed to an actual debugger instead of just unity logs. Issue #3 - ch.ObserveEveryValueChanged(x => x.CurrentState) - .Do(x => - { - //BehaviorLogger.Warning(ElementType + " state changed: " + x); - if (x == BehaviorState.Fail) - { - NumberOfFailures.SetValueAndForceNotify(NumberOfFailures.Value + 1); - } - else if (x == BehaviorState.Success) - { - NumberOfSuccesses.SetValueAndForceNotify(NumberOfSuccesses.Value + 1); - } - }) - .Subscribe() - .AddTo(Disposables); - } - Initialized = true; - } + + } } } diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs index 246aa20..3e37a0c 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs @@ -18,7 +18,7 @@ public Selector(string name, int depth, int id) : base(name, depth, id) { } - public override IEnumerator Tick(WaitForSeconds delayStart = null) + public override IEnumerator Tick() { base.Tick().ToObservable().Subscribe(); diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs index 1e1f41c..aa4e1d2 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs @@ -17,7 +17,7 @@ public Sequencer(string name, int depth, int id) { } - public override IEnumerator Tick(WaitForSeconds delayStart = null) + public override IEnumerator Tick() { base.Tick().ToObservable().Subscribe(); diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/BehaviorDecorator.cs b/Assets/Visual Behavior Tree/Scripts/AI/Decorators/BehaviorDecorator.cs index 9c11ffa..c9169b6 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/BehaviorDecorator.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Decorators/BehaviorDecorator.cs @@ -1,4 +1,5 @@ -using System.Collections; +using System; +using System.Collections; using System.Collections.Generic; namespace Assets.Scripts.AI.Decorators @@ -10,10 +11,5 @@ public BehaviorDecorator(string name, int depth, int id) { Children = new List(); } - - public override IEnumerator Tick(UnityEngine.WaitForSeconds delayStart = null) - { - return base.Tick(delayStart); - } } } diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs b/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs index 5c06c9e..7e389c9 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs @@ -11,9 +11,9 @@ public Inverter(string name, int depth, int id) : base(name, depth, id) { } - public override IEnumerator Tick(WaitForSeconds delayStart = null) + public override IEnumerator Tick() { - base.Tick(delayStart).ToObservable() + base.Tick().ToObservable() //.Do(_ => Debug.Log("OnNext Inverter at start (base.tick()")) .Subscribe(); diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/BehaviorNode.cs b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/BehaviorNode.cs index 1b91f1b..4684ee4 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/BehaviorNode.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/BehaviorNode.cs @@ -7,11 +7,5 @@ public abstract class BehaviorNode : BehaviorTreeElement { public BehaviorNode(string name, int depth, int id) : base(name, depth, id) {} - - public override IEnumerator Tick(WaitForSeconds delayStart = null) - { - base.Tick(); - yield return null; - } } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs index 9c55850..94b3ece 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs @@ -12,14 +12,16 @@ public DebugOutNode(string name, int depth, int id) { } - public override IEnumerator Tick(WaitForSeconds delayStart = null) + public override BehaviorState Tick() { - base.Tick(); + base.Initialize(); CurrentState = BehaviorState.Running; //Forces an update on the state between succeeds. + //DO STUFF HERE Debug.Log("Debug Out Node " + Name + " Doing stuff"); + //DOM MORE STUFF?! CurrentState = BehaviorState.Success; - yield break; + return CurrentState; } } } diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/MoveEnemyIfCloseToPlayer.cs b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/MoveEnemyIfCloseToPlayer.cs index b4c36bb..f802091 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/MoveEnemyIfCloseToPlayer.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/MoveEnemyIfCloseToPlayer.cs @@ -36,8 +36,9 @@ public class MoveEnemyIfCloseToPlayer : BehaviorNode public MoveEnemyIfCloseToPlayer(string name, int depth, int id) : base(name, depth, id) { } - public override IEnumerator Tick(WaitForSeconds delayStart = null) + public override IEnumerator Tick() { + base.Tick(); ++numTicks; diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs new file mode 100644 index 0000000..f46a085 --- /dev/null +++ b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs @@ -0,0 +1,38 @@ +using Assets.Scripts.AI; +using Assets.Scripts.AI.Nodes; +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UniRx; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Scripts.AI.Nodes +{ + /// + /// waits a specified time (or a number of frames) then swaps from one given prefab to the next + /// + [Serializable] + class SwapPrefabsOnTime : BehaviorNode + { + [SerializeField] + [Description("prefabs to select from in sequence.")] + public GameObject[] prefabsToSwapBetween; + + [SerializeField] + [Description("Number of received ticks before prefab goes to the next in the list.")] + public int changeEveryTickNum = 10; + + public SwapPrefabsOnTime(string name, int depth, int id) : base(name, depth, id) + { + } + + public override BehaviorState Tick() + { + return base.Tick(); + } + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs.meta b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs.meta new file mode 100644 index 0000000..8567753 --- /dev/null +++ b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 879961ece0cf83142814dcb81be124ae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/manifest.json b/Packages/manifest.json index 33e0a98..6f69980 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,39 +1,37 @@ { - "dependencies": { - "com.unity.ads": "2.0.8", - "com.unity.analytics": "3.2.2", - "com.unity.package-manager-ui": "1.9.11", - "com.unity.purchasing": "2.0.3", - "com.unity.textmeshpro": "1.3.0", - "com.unity.modules.ai": "1.0.0", - "com.unity.modules.animation": "1.0.0", - "com.unity.modules.assetbundle": "1.0.0", - "com.unity.modules.audio": "1.0.0", - "com.unity.modules.cloth": "1.0.0", - "com.unity.modules.director": "1.0.0", - "com.unity.modules.imageconversion": "1.0.0", - "com.unity.modules.imgui": "1.0.0", - "com.unity.modules.jsonserialize": "1.0.0", - "com.unity.modules.particlesystem": "1.0.0", - "com.unity.modules.physics": "1.0.0", - "com.unity.modules.physics2d": "1.0.0", - "com.unity.modules.screencapture": "1.0.0", - "com.unity.modules.terrain": "1.0.0", - "com.unity.modules.terrainphysics": "1.0.0", - "com.unity.modules.tilemap": "1.0.0", - "com.unity.modules.ui": "1.0.0", - "com.unity.modules.uielements": "1.0.0", - "com.unity.modules.umbra": "1.0.0", - "com.unity.modules.unityanalytics": "1.0.0", - "com.unity.modules.unitywebrequest": "1.0.0", - "com.unity.modules.unitywebrequestassetbundle": "1.0.0", - "com.unity.modules.unitywebrequestaudio": "1.0.0", - "com.unity.modules.unitywebrequesttexture": "1.0.0", - "com.unity.modules.unitywebrequestwww": "1.0.0", - "com.unity.modules.vehicles": "1.0.0", - "com.unity.modules.video": "1.0.0", - "com.unity.modules.vr": "1.0.0", - "com.unity.modules.wind": "1.0.0", - "com.unity.modules.xr": "1.0.0" - } -} \ No newline at end of file + "dependencies": { + "com.unity.analytics": "2.0.16", + "com.unity.package-manager-ui": "1.9.11", + "com.unity.textmeshpro": "1.3.0", + "com.unity.modules.ai": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.cloth": "1.0.0", + "com.unity.modules.director": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.physics2d": "1.0.0", + "com.unity.modules.screencapture": "1.0.0", + "com.unity.modules.terrain": "1.0.0", + "com.unity.modules.terrainphysics": "1.0.0", + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.uielements": "1.0.0", + "com.unity.modules.umbra": "1.0.0", + "com.unity.modules.unityanalytics": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.unitywebrequesttexture": "1.0.0", + "com.unity.modules.unitywebrequestwww": "1.0.0", + "com.unity.modules.vehicles": "1.0.0", + "com.unity.modules.video": "1.0.0", + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.wind": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } +} diff --git a/UIElementsSchema/UIElements.xsd b/UIElementsSchema/UIElements.xsd index 69d5b00..450fd87 100644 --- a/UIElementsSchema/UIElements.xsd +++ b/UIElementsSchema/UIElements.xsd @@ -1,5 +1,6 @@  - + + \ No newline at end of file diff --git a/UIElementsSchema/UnityEditor.Experimental.UIElements.xsd b/UIElementsSchema/UnityEditor.Experimental.UIElements.xsd index 2e39491..318e4ce 100644 --- a/UIElementsSchema/UnityEditor.Experimental.UIElements.xsd +++ b/UIElementsSchema/UnityEditor.Experimental.UIElements.xsd @@ -1,5 +1,5 @@  - + diff --git a/UIElementsSchema/UnityEditor.PackageManager.UI.xsd b/UIElementsSchema/UnityEditor.PackageManager.UI.xsd new file mode 100644 index 0000000..7dfcab5 --- /dev/null +++ b/UIElementsSchema/UnityEditor.PackageManager.UI.xsd @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/UIElementsSchema/UnityEngine.Experimental.UIElements.xsd b/UIElementsSchema/UnityEngine.Experimental.UIElements.xsd index d73f326..9a5f2d9 100644 --- a/UIElementsSchema/UnityEngine.Experimental.UIElements.xsd +++ b/UIElementsSchema/UnityEngine.Experimental.UIElements.xsd @@ -1,5 +1,5 @@  - + From d7f408d35fb10dd0f8299b88d2db336118aeae19 Mon Sep 17 00:00:00 2001 From: MystikalPooka Date: Mon, 10 Dec 2018 21:03:55 -0700 Subject: [PATCH 02/16] Begin marble diagramming for visual help --- .../MarbleDiagrams/ParallelMarbleDiagram.xml | 1 + 1 file changed, 1 insertion(+) create mode 100644 Assets/Visual Behavior Tree/MarbleDiagrams/ParallelMarbleDiagram.xml diff --git a/Assets/Visual Behavior Tree/MarbleDiagrams/ParallelMarbleDiagram.xml b/Assets/Visual Behavior Tree/MarbleDiagrams/ParallelMarbleDiagram.xml new file mode 100644 index 0000000..eee6fc8 --- /dev/null +++ b/Assets/Visual Behavior Tree/MarbleDiagrams/ParallelMarbleDiagram.xml @@ -0,0 +1 @@ +7Ztdb5swFIZ/TS5bAebzskm7VVonTerFLicHHKB1MAWnSfbrZ4IdwGFakwGmSXITOLaP4Ty2eW3DBMyWm68ZTKPvJEB4YmjBZgLuJ4ahux5gf4VlW1os2ykNYRYHPFNleI5/I27UuHUVByhvZKSEYBqnTaNPkgT5tGGDWUbWzWwLgpu1pjBEB4ZnH+JD6884oFFpdS2tsj+iOIxEzbrGU5ZQZOaGPIIBWddM4GECZhkhtDxabmYIF8ETcSnLfflL6v7CMpTQjxR4fHm7uc8fv/2KnYdllj45IVje6Ebp5h3iFb9jfrV0K0KAkuCuiCQ7S0jCjNMA5hEq3OrsJKJLzA/Loig4CGl1jfr+zlmTQWSJaLZlWdZVbEVoo1pYhS1DGNL4vekecsTh3t2+hh8kZhUbGm+OgLvhbdFzb62mi5ysMh/xUvVYSo4c81+eKMxCRA88sYPafVemHasjuLVhszGL1nRBdhda8bPfVkQk3OS7DnbHMgAt3VSJ7Cjk/zsvc2G4ExZ2mXM5F7OV1Qmz3HIwZv20aDHrKKboOYV+kbJmQ0Wz4cA8LTvvIt4UDWu6iDGeEUyynSMQQOQufGbPaUZeUS3F9l00X+wrf0cZRZtjWx8vYDehOmZ5+sG22dYMG9iPZaxbV8jdQwamOS7K9pVy95TloV45ZfeyKC9cH/mtlOeuZbIwd0LZGhllIfWOU1O1sJbREkLT/gSSygZOA4FunCipZEfOwIJKPwXdmQhh3QVdKeEWV32TG0wLT0cxtA7zANUdqV9bnuKxFVwxd4/Z1LSRYTavmHuQw645MsyDzW1HgtlCbmC2YXaNObDtjnqzo48Mc9vk9rwFsSWtIu1Xso9VVrIj3ZYc9a2rvFPYnYkiNmyvK0Xc4qpncqBtGtrL4Dobx+A6jCIWK3WCq2mpHVzBYBOfi8A8GqyDTXRGgnUQaWTr0qisHHPbROe8pZHtSAw877RH7IEjU3LU9wPWuWBpBGy9K2nU4qpvcoPtw4xkcFUijYDoIMoG17a5yxXzf0oj5VjNS5vYKJFG6jGftBd3VtIIePqtVvtJDk8VSsCUHPX8uDXbpqgSyTyCaXGI4+S1ifEFUbrlr4TCFSXMRDIakZAkED8Rkn4+3IKDoZ0G1JEWBQ8c9Q30ugs3wGar+hH4ugs3wGaresyXtgunZLNVPebBXjEdCWYlm63qMbetSp3xO6ZKPgpQT/nC3iRW81WAesyDrWBdEuaDtWzVmK3BVrTGgVnNdwE9Yman1Sec5Sy7+hAWPPwB \ No newline at end of file From 5b34f214ef036075d4883b161bc64e1474e6904a Mon Sep 17 00:00:00 2001 From: MystikalPooka Date: Wed, 12 Dec 2018 00:53:20 -0700 Subject: [PATCH 03/16] source concat for sequential runners --- .../Scripts/AI/Components/ParallelRunner.cs | 18 ++------- .../Scripts/AI/Components/Selector.cs | 38 ++++++++---------- .../Scripts/AI/Components/Sequencer.cs | 40 +++++++++---------- 3 files changed, 37 insertions(+), 59 deletions(-) diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs index 6b9b6dc..f6ef384 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs @@ -38,8 +38,9 @@ public override IObservable Tick() return Observable.Return(BehaviorState.Fail); } - var allChildren = Children.ToObservable() - .SelectMany(child => ((BehaviorTreeElement)child).Tick()) + return Children.ToObservable() + .Select(child => ((BehaviorTreeElement)child).Tick()) //inject all my children streams into a stream of streams + .Merge() //merge children streams into one stream ("concurrent"ly) .Do(state => { if (state == BehaviorState.Fail) NumberOfFailures.SetValueAndForceNotify(NumberOfFailures.Value + 1); @@ -50,19 +51,6 @@ public override IObservable Tick() NumberOfFailures.Value < NumberOfFailuresBeforeFail) .Publish() .RefCount(); - - var failedChildren = allChildren.Where(state => state == BehaviorState.Fail) - .Do(_ => NumberOfFailures.SetValueAndForceNotify(NumberOfFailures.Value + 1)) - .Subscribe(); - - var succeedChildren = allChildren.Where(state => state == BehaviorState.Success) - .Do(_ => NumberOfSuccesses.SetValueAndForceNotify(NumberOfFailures.Value + 1)) - .Subscribe(); - - - - - } } } diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs index 3e37a0c..d225b22 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.ComponentModel; +using System.Linq; using UniRx; using UnityEngine; @@ -18,31 +19,24 @@ public Selector(string name, int depth, int id) : base(name, depth, id) { } - public override IEnumerator Tick() + public override IObservable Tick() { - base.Tick().ToObservable().Subscribe(); - - CurrentState = (BehaviorState.Running); - foreach (BehaviorTreeElement behavior in Children) + if (Children == null || Children.Count == 0) { - if (CurrentState != BehaviorState.Running) yield break; - - yield return - behavior.Tick().ToObservable() - .Do(_ => - { - if (behavior.CurrentState == BehaviorState.Success) - { - CurrentState = BehaviorState.Success; - return; - } - }) - .Subscribe() - .AddTo(Disposables); + Debug.LogWarning("Children Null in " + this.Name); + return Observable.Return(BehaviorState.Fail); } - //if it gets here, it went through all subbehaviors and had no successes - if (CurrentState == BehaviorState.Running) CurrentState = BehaviorState.Fail; - yield break; + + var source = from child in Children.ToObservable() + select child as BehaviorTreeElement; + + return source.Select(child => child.Tick()) + .Concat() //Sequentially subscribe + .TakeWhile(childState => childState != BehaviorState.Success) //take until "succeed". then stop and publish "OnComplete" + + .Publish() + .RefCount(); //automatically begin generating upon receiving first subscription, + //and automatically dispose upon last dispose } } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs index aa4e1d2..dab2cb7 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs @@ -1,4 +1,5 @@ -using System.Collections; +using System; +using System.Collections; using System.ComponentModel; using UniRx; using UnityEngine; @@ -17,30 +18,25 @@ public Sequencer(string name, int depth, int id) { } - public override IEnumerator Tick() + public override IObservable Tick() { - base.Tick().ToObservable().Subscribe(); - - yield return delayStart; - CurrentState = BehaviorState.Running; - foreach (BehaviorTreeElement behavior in Children) + if (Children == null || Children.Count == 0) { - if (CurrentState != BehaviorState.Running) yield break; - yield return behavior.Tick().ToObservable() - .Do(_ => - { - if (behavior.CurrentState == BehaviorState.Fail) - { - CurrentState = BehaviorState.Fail; - return; - } - }) - .Subscribe() - .AddTo(Disposables); + Debug.LogWarning("Children Null in " + this.Name); + return Observable.Return(BehaviorState.Fail); } - //if it gets here, it went through all subbehaviors and had no failures - if (CurrentState == BehaviorState.Running) CurrentState = BehaviorState.Success; - yield break; + + var source = from child in Children.ToObservable() + select child as BehaviorTreeElement; + + return source.Select(child => child.Tick()) + .Concat() //Sequentially subscribe + .TakeWhile(childState => childState != BehaviorState.Fail) //take until "fail". then stop and publish "OnComplete" + + .Publish() + .RefCount(); //automatically begin generating upon receiving first subscription, + //and automatically dispose upon last dispose } } +} } \ No newline at end of file From 8af314cf4ad6c0446761cfff424cb51deb50d0d4 Mon Sep 17 00:00:00 2001 From: MystikalPooka Date: Sun, 23 Dec 2018 13:54:24 -0700 Subject: [PATCH 04/16] Update uniRX, selector and sequencer streams and tests added --- Assets/Plugins/UniRx.meta | 2 - Assets/Plugins/UniRx/Examples.meta | 2 - .../UniRx/Examples/Sample01_ObservableWWW.cs | 8 + .../Examples/Sample01_ObservableWWW.cs.meta | 2 +- .../Sample02_ObservableTriggers.cs.meta | 2 +- .../Sample03_GameObjectAsObservable.cs.meta | 2 +- .../Sample04_ConvertFromUnityCallback.cs.meta | 2 +- .../Examples/Sample05_ConvertFromCoroutine.cs | 8 +- .../Sample05_ConvertFromCoroutine.cs.meta | 2 +- .../Examples/Sample06_ConvertToCoroutine.cs | 7 +- .../Sample06_ConvertToCoroutine.cs.meta | 2 +- .../Sample07_OrchestratIEnumerator.cs.meta | 2 +- .../Sample08_DetectDoubleClick.cs.meta | 2 +- .../Examples/Sample09_EventHandling.cs.meta | 2 +- .../Sample10_MainThreadDispatcher.cs.meta | 2 +- .../UniRx/Examples/Sample11_Logger.cs.meta | 2 +- .../UniRx/Examples/Sample12Scene.unity.meta | 2 +- .../Sample12_ReactiveProperty.cs.meta | 2 +- .../UniRx/Examples/Sample13Scene.unity.meta | 2 +- .../UniRx/Examples/Sample13_ToDoApp.cs.meta | 2 +- .../Examples/Sample13_ToDoItem.prefab.meta | 2 +- Assets/Plugins/UniRx/ReadMe.txt | 2 +- Assets/Plugins/UniRx/ReadMe.txt.meta | 2 +- Assets/Plugins/UniRx/Scripts.meta | 2 - Assets/Plugins/UniRx/Scripts/Async.meta | 2 - .../Plugins/UniRx/Scripts/Async/AsyncUnit.cs | 2 +- .../CancellationTokenEqualityComparer.cs | 5 +- .../Async/CancellationTokenExtensions.cs | 48 +- .../CancellationTokenSourceExtensions.cs | 14 +- .../UniRx/Scripts/Async/CompilerServices.meta | 2 - .../AsyncMethodBuilderAttribute.cs | 2 +- .../AsyncUniTaskMethodBuilder.cs | 2 +- .../AsyncUniTaskVoidMethodBuilder.cs | 2 +- .../Async/CompilerServices/MoveNextRunner.cs | 4 +- .../Scripts/Async/DiagnosticsExtensions.cs | 6 +- .../Plugins/UniRx/Scripts/Async/Editor.meta | 2 - .../Scripts/Async/Editor/SplitterGUILayout.cs | 2 +- .../Async/Editor/UniTaskTrackerTreeView.cs | 2 +- .../Async/Editor/UniTaskTrackerWindow.cs | 2 +- .../Async/EnumeratorAsyncExtensions.cs | 2 +- .../Plugins/UniRx/Scripts/Async/IAwaiter.cs | 2 +- .../Plugins/UniRx/Scripts/Async/Internal.meta | 2 - .../UniRx/Scripts/Async/Internal/ArrayPool.cs | 2 +- .../Scripts/Async/Internal/ArrayPool.cs.meta | 2 +- .../Scripts/Async/Internal/ArrayPoolUtil.cs | 36 +- .../Async/Internal/ArrayPoolUtil.cs.meta | 2 +- .../UniRx/Scripts/Async/Internal/ArrayUtil.cs | 23 +- .../Scripts/Async/Internal/ArrayUtil.cs.meta | 2 +- .../Async/Internal/CancellationTokenHelper.cs | 2 +- .../Async/Internal/ContinuationQueue.cs | 2 +- .../UniRx/Scripts/Async/Internal/Error.cs | 2 +- .../Scripts/Async/Internal/Error.cs.meta | 2 +- .../Scripts/Async/Internal/LazyPromise.cs | 2 +- .../Scripts/Async/Internal/MinimumQueue.cs | 4 +- .../Async/Internal/PlayerLoopRunner.cs | 2 +- .../Scripts/Async/Internal/ReusablePromise.cs | 11 +- .../Internal/RuntimeHelpersAbstraction.cs | 2 +- .../RuntimeHelpersAbstraction.cs.meta | 2 +- .../Scripts/Async/Internal/TaskTracker.cs | 2 +- .../Scripts/Async/Internal/WeakDictionary.cs | 2 +- .../UniRx/Scripts/Async/PlayerLoopHelper.cs | 2 +- .../Plugins/UniRx/Scripts/Async/Triggers.meta | 2 - .../Async/Triggers/AsyncAnimatorTrigger.cs | 2 +- .../Async/Triggers/AsyncAwakeTrigger.cs | 2 +- .../Async/Triggers/AsyncBeginDragTrigger.cs | 2 +- .../Async/Triggers/AsyncCancelTrigger.cs | 2 +- .../AsyncCanvasGroupChangedTrigger.cs | 2 +- .../Async/Triggers/AsyncCollision2DTrigger.cs | 2 +- .../Async/Triggers/AsyncCollisionTrigger.cs | 2 +- .../Async/Triggers/AsyncDeselectTrigger.cs | 2 +- .../Async/Triggers/AsyncDestroyTrigger.cs | 14 +- .../Async/Triggers/AsyncDragTrigger.cs | 2 +- .../Async/Triggers/AsyncDropTrigger.cs | 2 +- .../Triggers/AsyncEnableDisableTrigger.cs | 2 +- .../Async/Triggers/AsyncEndDragTrigger.cs | 2 +- .../Async/Triggers/AsyncEventTrigger.cs | 2 +- .../Async/Triggers/AsyncFixedUpdateTrigger.cs | 2 +- .../AsyncInitializePotentialDragTrigger.cs | 2 +- .../Async/Triggers/AsyncJointTrigger.cs | 2 +- .../Async/Triggers/AsyncLateUpdateTrigger.cs | 2 +- .../Async/Triggers/AsyncMouseTrigger.cs | 2 +- .../Async/Triggers/AsyncMoveTrigger.cs | 2 +- .../Async/Triggers/AsyncParticleTrigger.cs | 2 +- .../Triggers/AsyncPointerClickTrigger.cs | 2 +- .../Async/Triggers/AsyncPointerDownTrigger.cs | 2 +- .../Triggers/AsyncPointerEnterTrigger.cs | 2 +- .../Async/Triggers/AsyncPointerExitTrigger.cs | 2 +- .../Async/Triggers/AsyncPointerUpTrigger.cs | 2 +- .../Triggers/AsyncRectTransformTrigger.cs | 2 +- .../Async/Triggers/AsyncScrollTrigger.cs | 2 +- .../Async/Triggers/AsyncSelectTrigger.cs | 2 +- .../Async/Triggers/AsyncStartTrigger.cs | 2 +- .../Async/Triggers/AsyncSubmitTrigger.cs | 2 +- .../Triggers/AsyncTransformChangedTrigger.cs | 2 +- .../Async/Triggers/AsyncTrigger2DTrigger.cs | 2 +- .../Async/Triggers/AsyncTriggerBase.cs | 37 +- .../Async/Triggers/AsyncTriggerExtensions.cs | 2 +- .../Async/Triggers/AsyncTriggerTrigger.cs | 2 +- .../Triggers/AsyncUpdateSelectedTrigger.cs | 2 +- .../Async/Triggers/AsyncUpdateTrigger.cs | 2 +- .../Async/Triggers/AsyncVisibleTrigger.cs | 2 +- .../UniRx/Scripts/Async/UniTask.Bridge.cs | 2 +- .../UniRx/Scripts/Async/UniTask.Delay.cs | 2 +- .../UniRx/Scripts/Async/UniTask.Factory.cs | 2 +- .../UniRx/Scripts/Async/UniTask.Run.cs | 2 +- .../UniRx/Scripts/Async/UniTask.Threading.cs | 2 +- .../UniRx/Scripts/Async/UniTask.WaitUntil.cs | 2 +- .../Async/UniTask.WhenAll.Generated.cs | 2 +- .../UniRx/Scripts/Async/UniTask.WhenAll.cs | 2 +- .../Async/UniTask.WhenAny.Generated.cs | 2 +- .../UniRx/Scripts/Async/UniTask.WhenAny.cs | 2 +- Assets/Plugins/UniRx/Scripts/Async/UniTask.cs | 2 +- .../Scripts/Async/UniTaskCompletionSource.cs | 34 +- .../Async/UniTaskExtensions.Shorthand.cs | 2 +- .../UniRx/Scripts/Async/UniTaskExtensions.cs | 6 +- .../UniRx/Scripts/Async/UniTaskScheduler.cs | 2 +- .../UniRx/Scripts/Async/UniTaskVoid.cs | 2 +- .../Async/UnityAsyncExtensions.Jobs.cs | 2 +- .../Scripts/Async/UnityAsyncExtensions.cs | 18 +- .../Async/UnityAsyncExtensions.uGUI.cs | 203 ++- .../Scripts/Async/UnityEqualityComparer.cs | 5 +- .../Plugins/UniRx/Scripts/Asynchronous.meta | 2 - .../Asynchronous/WebRequestExtensions.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Disposables.meta | 2 - .../Disposables/BooleanDisposable.cs.meta | 2 +- .../CancellationDisposable.cs.meta | 2 +- .../Disposables/CompositeDisposable.cs.meta | 2 +- .../Disposables/DictionaryDisposable.cs.meta | 2 +- .../Scripts/Disposables/Disposable.cs.meta | 2 +- .../Disposables/DisposableExtensions.cs.meta | 2 +- .../Scripts/Disposables/ICancelable.cs.meta | 2 +- .../MultipleAssignmentDisposable.cs.meta | 2 +- .../Disposables/RefCountDisposable.cs.meta | 2 +- .../Disposables/ScheduledDisposable.cs.meta | 2 +- .../Disposables/SerialDisposable.cs.meta | 2 +- .../SingleAssignmentDisposable.cs.meta | 2 +- .../StableCompositeDisposable.cs.meta | 2 +- .../UniRx/Scripts/EventPattern.cs.meta | 2 +- .../Plugins/UniRx/Scripts/InternalUtil.meta | 2 - .../Scripts/InternalUtil/AscynLock.cs.meta | 2 +- .../InternalUtil/ExceptionExtensions.cs.meta | 2 +- .../InternalUtil/ImmutableList.cs.meta | 2 +- .../Scripts/InternalUtil/ListObserver.cs.meta | 2 +- .../InternalUtil/MicroCoroutine.cs.meta | 2 +- .../InternalUtil/PriorityQueue.cs.meta | 2 +- .../InternalUtil/ReflectionAccessor.cs | 114 -- .../InternalUtil/ReflectionAccessor.cs.meta | 12 - .../InternalUtil/ScheduledItem.cs.meta | 2 +- .../ThreadSafeQueueWorker.cs.meta | 2 +- .../Plugins/UniRx/Scripts/New GUISkin.guiskin | 1427 ----------------- .../UniRx/Scripts/Notification.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Notifiers.meta | 2 - .../Scripts/Notifiers/BooleanNotifier.cs.meta | 2 +- .../Scripts/Notifiers/CountNotifier.cs.meta | 2 +- .../Scripts/Notifiers/MessageBroker.cs.meta | 2 +- .../Notifiers/ScheduledNotifier.cs.meta | 2 +- .../Scripts/Observable.Aggregate.cs.meta | 2 +- .../UniRx/Scripts/Observable.Awaiter.cs.meta | 2 +- .../UniRx/Scripts/Observable.Binding.cs.meta | 2 +- .../UniRx/Scripts/Observable.Blocking.cs.meta | 2 +- .../Scripts/Observable.Concatenate.cs.meta | 2 +- .../Scripts/Observable.Concurrency.cs.meta | 2 +- .../Scripts/Observable.Conversions.cs.meta | 2 +- .../UniRx/Scripts/Observable.Creation.cs.meta | 2 +- .../Scripts/Observable.ErrorHandling.cs.meta | 2 +- .../UniRx/Scripts/Observable.Events.cs.meta | 2 +- .../Scripts/Observable.FromAsync.cs.meta | 2 +- .../UniRx/Scripts/Observable.Joins.cs.meta | 2 +- .../UniRx/Scripts/Observable.Paging.cs.meta | 2 +- .../UniRx/Scripts/Observable.Time.cs.meta | 2 +- .../Plugins/UniRx/Scripts/Observable.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Observer.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Operators.meta | 2 - .../UniRx/Scripts/Operators/Aggregate.cs.meta | 2 +- .../UniRx/Scripts/Operators/Amb.cs.meta | 2 +- .../Scripts/Operators/AsObservable.cs.meta | 2 +- .../Operators/AsSingleUnitObservable.cs.meta | 2 +- .../Operators/AsUnitObservable.cs.meta | 2 +- .../UniRx/Scripts/Operators/Buffer.cs.meta | 2 +- .../UniRx/Scripts/Operators/Cast.cs.meta | 2 +- .../UniRx/Scripts/Operators/Catch.cs.meta | 2 +- .../Scripts/Operators/CombineLatest.cs.meta | 2 +- .../UniRx/Scripts/Operators/Concat.cs.meta | 2 +- .../Scripts/Operators/ContinueWith.cs.meta | 2 +- .../UniRx/Scripts/Operators/Create.cs.meta | 2 +- .../Scripts/Operators/DefaultIfEmpty.cs.meta | 2 +- .../UniRx/Scripts/Operators/Defer.cs.meta | 2 +- .../UniRx/Scripts/Operators/Delay.cs.meta | 2 +- .../Operators/DelaySubscription.cs.meta | 2 +- .../Scripts/Operators/Dematerialize.cs.meta | 2 +- .../UniRx/Scripts/Operators/Distinct.cs.meta | 2 +- .../Operators/DistinctUntilChanged.cs.meta | 2 +- .../UniRx/Scripts/Operators/Do.cs.meta | 2 +- .../UniRx/Scripts/Operators/Empty.cs.meta | 2 +- .../UniRx/Scripts/Operators/Finally.cs.meta | 2 +- .../UniRx/Scripts/Operators/First.cs.meta | 2 +- .../Scripts/Operators/ForEachAsync.cs.meta | 2 +- .../UniRx/Scripts/Operators/FromEvent.cs.meta | 2 +- .../UniRx/Scripts/Operators/GroupBy.cs.meta | 2 +- .../Scripts/Operators/IgnoreElements.cs.meta | 2 +- .../UniRx/Scripts/Operators/Last.cs.meta | 2 +- .../Scripts/Operators/Materialize.cs.meta | 2 +- .../UniRx/Scripts/Operators/Merge.cs.meta | 2 +- .../UniRx/Scripts/Operators/Never.cs.meta | 2 +- .../UniRx/Scripts/Operators/ObserveOn.cs.meta | 2 +- .../UniRx/Scripts/Operators/OfType.cs.meta | 2 +- .../Operators/OperatorObservableBase.cs.meta | 2 +- .../Operators/OperatorObserverBase.cs.meta | 2 +- .../UniRx/Scripts/Operators/PairWise.cs.meta | 2 +- .../UniRx/Scripts/Operators/Range.cs.meta | 2 +- .../UniRx/Scripts/Operators/RefCount.cs.meta | 2 +- .../UniRx/Scripts/Operators/Repeat.cs.meta | 2 +- .../Scripts/Operators/RepeatSafe.cs.meta | 2 +- .../UniRx/Scripts/Operators/Return.cs.meta | 2 +- .../UniRx/Scripts/Operators/Sample.cs.meta | 2 +- .../UniRx/Scripts/Operators/Scan.cs.meta | 2 +- .../UniRx/Scripts/Operators/Select.cs.meta | 2 +- .../Scripts/Operators/SelectMany.cs.meta | 2 +- .../Scripts/Operators/SelectWhere.cs.meta | 2 +- .../UniRx/Scripts/Operators/Single.cs.meta | 2 +- .../UniRx/Scripts/Operators/Skip.cs.meta | 2 +- .../UniRx/Scripts/Operators/SkipUntil.cs.meta | 2 +- .../UniRx/Scripts/Operators/SkipWhile.cs.meta | 2 +- .../UniRx/Scripts/Operators/Start.cs.meta | 2 +- .../UniRx/Scripts/Operators/StartWith.cs.meta | 2 +- .../Scripts/Operators/SubscribeOn.cs.meta | 2 +- .../UniRx/Scripts/Operators/Switch.cs.meta | 2 +- .../Scripts/Operators/Synchronize.cs.meta | 2 +- .../Operators/SynchronizedObserver.cs.meta | 2 +- .../UniRx/Scripts/Operators/Take.cs.meta | 2 +- .../UniRx/Scripts/Operators/TakeLast.cs.meta | 2 +- .../UniRx/Scripts/Operators/TakeUntil.cs.meta | 2 +- .../UniRx/Scripts/Operators/TakeWhile.cs.meta | 2 +- .../UniRx/Scripts/Operators/Throttle.cs.meta | 2 +- .../Scripts/Operators/ThrottleFirst.cs.meta | 2 +- .../UniRx/Scripts/Operators/Throw.cs.meta | 2 +- .../Scripts/Operators/TimeInterval.cs.meta | 2 +- .../UniRx/Scripts/Operators/Timeout.cs.meta | 2 +- .../UniRx/Scripts/Operators/Timer.cs.meta | 2 +- .../UniRx/Scripts/Operators/Timestamp.cs.meta | 2 +- .../UniRx/Scripts/Operators/ToArray.cs.meta | 2 +- .../UniRx/Scripts/Operators/ToList.cs.meta | 2 +- .../Scripts/Operators/ToObservable.cs.meta | 2 +- .../UniRx/Scripts/Operators/Wait.cs.meta | 2 +- .../UniRx/Scripts/Operators/WhenAll.cs.meta | 2 +- .../UniRx/Scripts/Operators/Where.cs.meta | 2 +- .../Scripts/Operators/WhereSelect.cs.meta | 2 +- .../Scripts/Operators/WithLatestFrom.cs.meta | 2 +- .../UniRx/Scripts/Operators/Zip.cs.meta | 2 +- .../UniRx/Scripts/Operators/ZipLatest.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Pair.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Schedulers.meta | 2 - .../Schedulers/CurrentThreadScheduler.cs.meta | 2 +- .../Scripts/Schedulers/IScheduler.cs.meta | 2 +- .../Schedulers/ImmediateScheduler.cs.meta | 2 +- .../Scripts/Schedulers/Scheduler.cs.meta | 2 +- .../Schedulers/ThreadPoolScheduler.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Subjects.meta | 2 - .../Scripts/Subjects/AsyncSubject.cs.meta | 2 +- .../Scripts/Subjects/BehaviorSubject.cs.meta | 2 +- .../Subjects/ConnectableObservable.cs.meta | 2 +- .../UniRx/Scripts/Subjects/ISubject.cs.meta | 2 +- .../Scripts/Subjects/ReplaySubject.cs.meta | 2 +- .../UniRx/Scripts/Subjects/Subject.cs.meta | 2 +- .../Subjects/SubjectExtensions.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/System.meta | 2 - .../UniRx/Scripts/System/IObservable.cs.meta | 2 +- .../UniRx/Scripts/System/IObserver.cs.meta | 2 +- .../System/IOptimizedObservable.cs.meta | 2 +- .../UniRx/Scripts/System/IProgress.cs.meta | 2 +- .../UniRx/Scripts/System/Tuple.cs.meta | 2 +- .../Plugins/UniRx/Scripts/System/Unit.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Tasks.meta | 2 - .../Tasks/TaskObservableExtensions.cs.meta | 2 +- .../Tasks/UniTaskObservableExtensions.cs | 6 +- .../UniRx/Scripts/TimeInterval.cs.meta | 2 +- .../Plugins/UniRx/Scripts/Timestamped.cs.meta | 2 +- .../UniRx/Scripts/UnityEngineBridge.meta | 2 - .../UnityEngineBridge/AotSafeExtensions.cs | 21 - .../AotSafeExtensions.cs.meta | 12 - .../AsyncOperationExtensions.cs.meta | 2 +- .../CancellationToken.cs.meta | 2 +- .../UnityEngineBridge/CoroutineAsyncBridge.cs | 10 +- .../CoroutineAsyncBridge.cs.meta | 2 +- .../UnityEngineBridge/Diagnostics.meta | 2 - .../Diagnostics/LogEntry.cs.meta | 2 +- .../Diagnostics/LogEntryExtensions.cs.meta | 2 +- .../Diagnostics/Logger.cs.meta | 2 +- .../ObservableDebugExtensions.cs.meta | 2 +- .../Diagnostics/ObservableLogger.cs.meta | 2 +- .../Diagnostics/UnityDebugSink.cs.meta | 2 +- .../UnityEngineBridge/FrameInterval.cs.meta | 2 +- .../InspectableReactiveProperty.cs.meta | 2 +- .../InspectorDisplayDrawer.cs.meta | 2 +- .../Scripts/UnityEngineBridge/LazyTask.cs | 143 -- .../LifetimeDisposableExtensions.cs.meta | 2 +- .../UnityEngineBridge/MainThreadDispatcher.cs | 12 + .../MainThreadDispatcher.cs.meta | 2 +- .../MainThreadScheduler.cs.meta | 2 +- .../UnityEngineBridge/Observable.Unity.cs | 6 + .../Observable.Unity.cs.meta | 2 +- .../ObservableMonoBehaviour.cs | 885 ---------- .../UnityEngineBridge/ObservableWWW.cs | 13 +- .../UnityEngineBridge/ObservableWWW.cs.meta | 2 +- .../ObserveExtensions.cs.meta | 2 +- .../Scripts/UnityEngineBridge/Operators.meta | 2 - .../Operators/BatchFrame.cs.meta | 2 +- .../Operators/DelayFrame.cs.meta | 2 +- .../Operators/DelayFrameSubscription.cs.meta | 2 +- .../Operators/FrameInterval.cs.meta | 2 +- .../Operators/FrameTimeInterval.cs.meta | 2 +- .../Operators/FromCoroutine.cs.meta | 2 +- .../Operators/RepeatUntil.cs.meta | 2 +- .../Operators/SampleFrame.cs.meta | 2 +- .../Operators/SubscribeOnMainThread.cs.meta | 2 +- .../Operators/ThrottleFirstFrame.cs.meta | 2 +- .../Operators/ThrottleFrame.cs.meta | 2 +- .../Operators/TimeoutFrame.cs.meta | 2 +- .../UnityEngineBridge/PresenterBase.cs | 234 --- .../UnityEngineBridge/PresenterBase.cs.meta | 12 - .../ReactiveCollection.cs.meta | 2 +- .../UnityEngineBridge/ReactiveCommand.cs | 44 +- .../UnityEngineBridge/ReactiveCommand.cs.meta | 2 +- .../ReactiveDictionary.cs.meta | 2 +- .../UnityEngineBridge/ReactiveProperty.cs | 39 +- .../ReactiveProperty.cs.meta | 2 +- .../ReactivePropertyReusablePromise.cs | 10 +- .../ScenePlaybackDetector.cs.meta | 2 +- .../Scripts/UnityEngineBridge/Toolkit.meta | 2 - .../Toolkit/ObjectPool.cs.meta | 2 +- .../Scripts/UnityEngineBridge/Triggers.meta | 2 - .../ObservableAnimatorTrigger.cs.meta | 2 +- .../ObservableBeginDragTrigger.cs.meta | 2 +- .../Triggers/ObservableCancelTrigger.cs.meta | 2 +- ...bservableCanvasGroupChangedTrigger.cs.meta | 2 +- .../ObservableCollision2DTrigger.cs.meta | 2 +- .../ObservableCollisionTrigger.cs.meta | 2 +- .../ObservableDeselectTrigger.cs.meta | 2 +- .../Triggers/ObservableDestroyTrigger.cs.meta | 2 +- .../Triggers/ObservableDragTrigger.cs.meta | 2 +- .../Triggers/ObservableDropTrigger.cs.meta | 2 +- .../Triggers/ObservableEnableTrigger.cs.meta | 2 +- .../Triggers/ObservableEndDragTrigger.cs.meta | 2 +- .../Triggers/ObservableEventTrigger.cs.meta | 2 +- .../ObservableFixedUpdateTrigger.cs.meta | 2 +- ...ableInitializePotentialDragTrigger.cs.meta | 2 +- .../ObservableLateUpdateTrigger.cs.meta | 2 +- .../Triggers/ObservableMouseTrigger.cs.meta | 2 +- .../Triggers/ObservableMoveTrigger.cs.meta | 2 +- .../ObservableParticleTrigger.cs.meta | 2 +- .../ObservablePointerClickTrigger.cs.meta | 2 +- .../ObservablePointerDownTrigger.cs.meta | 2 +- .../ObservablePointerEnterTrigger.cs.meta | 2 +- .../ObservablePointerExitTrigger.cs.meta | 2 +- .../ObservablePointerUpTrigger.cs.meta | 2 +- .../ObservableRectTransformTrigger.cs.meta | 2 +- .../Triggers/ObservableScrollTrigger.cs.meta | 2 +- .../Triggers/ObservableSelectTrigger.cs.meta | 2 +- .../ObservableStateMachineTrigger.cs.meta | 2 +- .../Triggers/ObservableSubmitTrigger.cs.meta | 2 +- .../ObservableTransformChangedTrigger.cs.meta | 2 +- .../ObservableTrigger2DTrigger.cs.meta | 2 +- .../Triggers/ObservableTriggerBase.cs.meta | 2 +- ...ervableTriggerExtensions.Component.cs.meta | 2 +- .../ObservableTriggerExtensions.cs.meta | 2 +- .../Triggers/ObservableTriggerTrigger.cs.meta | 2 +- .../ObservableUpdateSelectedTrigger.cs.meta | 2 +- .../Triggers/ObservableUpdateTrigger.cs.meta | 2 +- .../Triggers/ObservableVisibleTrigger.cs.meta | 2 +- .../UnityEngineBridge/TypedMonoBehaviour.cs | 205 --- .../TypedMonoBehaviour.cs.meta | 12 - .../UniRxSynchronizationContext.cs | 60 - .../UniRxSynchronizationContext.cs.meta | 12 - .../UnityEqualityComparer.cs | 136 -- .../UnityEqualityComparer.cs.meta | 12 - .../UnityEventExtensions.cs.meta | 2 +- .../UnityGraphicExtensions.cs.meta | 2 +- .../UnityUIComponentExtensions.cs.meta | 2 +- .../YieldInstructionCache.cs.meta | 2 +- .../UniRx/Scripts/UnityWinRTBridge.meta | 2 - .../Scripts/UnityWinRTBridge/Thread.cs.meta | 2 +- .../ThreadPoolScheduler_UnityWinRT.cs.meta | 2 +- .../BackendData/MultiColumnBTreeWindow.cs | 2 +- .../Editor/uVBT-Editor.asmdef | 18 + .../Editor/uVBT-Editor.asmdef.meta} | 5 +- .../Visual Behavior Tree/MarbleDiagrams.meta | 8 + .../ParallelMarbleDiagram.xml.meta | 7 + .../Scripts/AI/BehaviorManager.cs | 2 +- .../Scripts/AI/BehaviorTreeElement.cs | 2 +- .../Scripts/AI/BehaviorTreeManagerAsset.cs | 1 - .../AI/Components/BehaviorComponent.cs | 2 +- .../Scripts/AI/Components/ParallelRunner.cs | 46 +- .../Scripts/AI/Components/Selector.cs | 31 +- .../Scripts/AI/Components/Sequencer.cs | 32 +- .../Scripts/AI/Decorators/Inverter.cs | 61 +- .../Scripts/AI/Nodes/DebugOutNode.cs | 9 +- .../AI/Nodes/MoveEnemyIfCloseToPlayer.cs | 104 -- .../Scripts/AI/Nodes/SwapPrefabsOnTime.cs | 38 - .../Scripts/BehaviorReactiveExtensions.cs | 37 + ...eta => BehaviorReactiveExtensions.cs.meta} | 2 +- Assets/Visual Behavior Tree/Tests.meta | 8 + .../Tests/Components.meta | 8 + .../Tests/SelectorTests.cs | 74 + .../SelectorTests.cs.meta} | 4 +- .../Tests/SequencerTests.cs | 72 + .../Tests/SequencerTests.cs.meta} | 5 +- .../Tests/TestingResources.cs | 49 + .../Tests/TestingResources.cs.meta} | 5 +- .../Tests/uVBT-Tests.asmdef | 19 + .../Tests/uVBT-Tests.asmdef.meta | 7 + Assets/uVBT.asmdef | 14 + Assets/uVBT.asmdef.meta | 7 + Logs/Packages-Update.log | 11 + Packages/manifest.json | 5 +- ProjectSettings/GraphicsSettings.asset | 2 + ProjectSettings/ProjectSettings.asset | 99 +- ProjectSettings/ProjectVersion.txt | 2 +- ProjectSettings/UnityConnectSettings.asset | 16 +- ProjectSettings/VFXManager.asset | Bin 4148 -> 4148 bytes .../AI/Components/SelectorTests.cs | 54 + 420 files changed, 1332 insertions(+), 4144 deletions(-) delete mode 100644 Assets/Plugins/UniRx/Scripts/InternalUtil/ReflectionAccessor.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/InternalUtil/ReflectionAccessor.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/New GUISkin.guiskin delete mode 100644 Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AotSafeExtensions.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AotSafeExtensions.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LazyTask.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableMonoBehaviour.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/UnityEngineBridge/PresenterBase.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/UnityEngineBridge/PresenterBase.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/UnityEngineBridge/TypedMonoBehaviour.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/UnityEngineBridge/TypedMonoBehaviour.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UniRxSynchronizationContext.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UniRxSynchronizationContext.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEqualityComparer.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEqualityComparer.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/uVBT-Editor.asmdef rename Assets/{Plugins/UniRx/Scripts/New GUISkin.guiskin.meta => Visual Behavior Tree/Editor/uVBT-Editor.asmdef.meta} (52%) create mode 100644 Assets/Visual Behavior Tree/MarbleDiagrams.meta create mode 100644 Assets/Visual Behavior Tree/MarbleDiagrams/ParallelMarbleDiagram.xml.meta delete mode 100644 Assets/Visual Behavior Tree/Scripts/AI/Nodes/MoveEnemyIfCloseToPlayer.cs delete mode 100644 Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs create mode 100644 Assets/Visual Behavior Tree/Scripts/BehaviorReactiveExtensions.cs rename Assets/Visual Behavior Tree/Scripts/{AI/Nodes/SwapPrefabsOnTime.cs.meta => BehaviorReactiveExtensions.cs.meta} (83%) create mode 100644 Assets/Visual Behavior Tree/Tests.meta create mode 100644 Assets/Visual Behavior Tree/Tests/Components.meta create mode 100644 Assets/Visual Behavior Tree/Tests/SelectorTests.cs rename Assets/Visual Behavior Tree/{Scripts/AI/Nodes/MoveEnemyIfCloseToPlayer.cs.meta => Tests/SelectorTests.cs.meta} (71%) create mode 100644 Assets/Visual Behavior Tree/Tests/SequencerTests.cs rename Assets/{Plugins/UniRx/Scripts/UnityEngineBridge/LazyTask.cs.meta => Visual Behavior Tree/Tests/SequencerTests.cs.meta} (68%) create mode 100644 Assets/Visual Behavior Tree/Tests/TestingResources.cs rename Assets/{Plugins/UniRx/Scripts/UnityEngineBridge/ObservableMonoBehaviour.cs.meta => Visual Behavior Tree/Tests/TestingResources.cs.meta} (68%) create mode 100644 Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef create mode 100644 Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef.meta create mode 100644 Assets/uVBT.asmdef create mode 100644 Assets/uVBT.asmdef.meta create mode 100644 Tests/Visual Behavior Tree/AI/Components/SelectorTests.cs diff --git a/Assets/Plugins/UniRx.meta b/Assets/Plugins/UniRx.meta index ec7fc72..cedc486 100644 --- a/Assets/Plugins/UniRx.meta +++ b/Assets/Plugins/UniRx.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: 77c238e95b576944d9d2bc06124ef16b folderAsset: yes -timeCreated: 1522374661 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Examples.meta b/Assets/Plugins/UniRx/Examples.meta index 46fee29..1c2dfc3 100644 --- a/Assets/Plugins/UniRx/Examples.meta +++ b/Assets/Plugins/UniRx/Examples.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: d276faead1c49354fa2b575652b45cc0 folderAsset: yes -timeCreated: 1522374661 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs b/Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs index 0c8b069..0c629da 100644 --- a/Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs +++ b/Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs @@ -1,5 +1,9 @@ #if !(UNITY_METRO || UNITY_WP8) +#if UNITY_2018_3_OR_NEWER +#pragma warning disable CS0618 +#endif + using UnityEngine; namespace UniRx.Examples @@ -79,4 +83,8 @@ from bing in ObservableWWW.Get("http://bing.com/") } } +#endif + +#if UNITY_2018_3_OR_NEWER +#pragma warning restore CS0618 #endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs.meta b/Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs.meta index 7d6e662..bfc52d8 100644 --- a/Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs.meta +++ b/Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: bf3770fc51ac89f45987dbde37ae81bd timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Examples/Sample02_ObservableTriggers.cs.meta b/Assets/Plugins/UniRx/Examples/Sample02_ObservableTriggers.cs.meta index af1e429..1ca1c6a 100644 --- a/Assets/Plugins/UniRx/Examples/Sample02_ObservableTriggers.cs.meta +++ b/Assets/Plugins/UniRx/Examples/Sample02_ObservableTriggers.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: cb5e978d683e94f4d9c2c81be80f93a7 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Examples/Sample03_GameObjectAsObservable.cs.meta b/Assets/Plugins/UniRx/Examples/Sample03_GameObjectAsObservable.cs.meta index e6cd393..9e027f8 100644 --- a/Assets/Plugins/UniRx/Examples/Sample03_GameObjectAsObservable.cs.meta +++ b/Assets/Plugins/UniRx/Examples/Sample03_GameObjectAsObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 005e349e5ccdd2b47bddc813b81afe40 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Examples/Sample04_ConvertFromUnityCallback.cs.meta b/Assets/Plugins/UniRx/Examples/Sample04_ConvertFromUnityCallback.cs.meta index 939ce3f..4c68f0a 100644 --- a/Assets/Plugins/UniRx/Examples/Sample04_ConvertFromUnityCallback.cs.meta +++ b/Assets/Plugins/UniRx/Examples/Sample04_ConvertFromUnityCallback.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 73e69fd4bbb724045a4e06050fbc5af3 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs b/Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs index 32833b5..8c5a37a 100644 --- a/Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs +++ b/Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs @@ -2,6 +2,9 @@ using System.Collections; using System.Threading; using UnityEngine; +#if UNITY_2018_3_OR_NEWER +#pragma warning disable CS0618 +#endif namespace UniRx.Examples { @@ -36,4 +39,7 @@ static IEnumerator GetWWWCore(string url, IObserver observer, Cancellati } } } -} \ No newline at end of file +} +#if UNITY_2018_3_OR_NEWER +#pragma warning restore CS0618 +#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs.meta b/Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs.meta index 4814aca..1a8a8b4 100644 --- a/Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs.meta +++ b/Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 41f3df73f7da66b4980f6d9a86927796 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs b/Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs index fc50fab..e7ec1da 100644 --- a/Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs +++ b/Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs @@ -31,6 +31,9 @@ IEnumerator ComplexCoroutineTest() // You can use ToYieldInstruction. #if !(UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2) +#if UNITY_2018_3_OR_NEWER +#pragma warning disable CS0618 +#endif IEnumerator TestNewCustomYieldInstruction() { @@ -50,7 +53,9 @@ IEnumerator TestNewCustomYieldInstruction() // other sample(wait until transform.position.y >= 100) yield return this.ObserveEveryValueChanged(x => x.transform).FirstOrDefault(x => x.position.y >= 100).ToYieldInstruction(); } - +#if UNITY_2018_3_OR_NEWER +#pragma warning restore CS0618 +#endif #endif } diff --git a/Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs.meta b/Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs.meta index 70a1bb7..30b592b 100644 --- a/Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs.meta +++ b/Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 5da8247fbc4a4c84e96a727b44903214 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Examples/Sample07_OrchestratIEnumerator.cs.meta b/Assets/Plugins/UniRx/Examples/Sample07_OrchestratIEnumerator.cs.meta index 8ed0986..9a1ae43 100644 --- a/Assets/Plugins/UniRx/Examples/Sample07_OrchestratIEnumerator.cs.meta +++ b/Assets/Plugins/UniRx/Examples/Sample07_OrchestratIEnumerator.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d437607dfffa8ff428bda3366354078d timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Examples/Sample08_DetectDoubleClick.cs.meta b/Assets/Plugins/UniRx/Examples/Sample08_DetectDoubleClick.cs.meta index 84cf0d1..5b9112f 100644 --- a/Assets/Plugins/UniRx/Examples/Sample08_DetectDoubleClick.cs.meta +++ b/Assets/Plugins/UniRx/Examples/Sample08_DetectDoubleClick.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: eb801bbfb1ffcd64389e90c8f2435b79 timeCreated: 1455373902 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Examples/Sample09_EventHandling.cs.meta b/Assets/Plugins/UniRx/Examples/Sample09_EventHandling.cs.meta index 5da8ac7..73b2354 100644 --- a/Assets/Plugins/UniRx/Examples/Sample09_EventHandling.cs.meta +++ b/Assets/Plugins/UniRx/Examples/Sample09_EventHandling.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 95140e49213aa6f49a470a81873b87c0 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Examples/Sample10_MainThreadDispatcher.cs.meta b/Assets/Plugins/UniRx/Examples/Sample10_MainThreadDispatcher.cs.meta index fbbee22..7335916 100644 --- a/Assets/Plugins/UniRx/Examples/Sample10_MainThreadDispatcher.cs.meta +++ b/Assets/Plugins/UniRx/Examples/Sample10_MainThreadDispatcher.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 6a0b959735346af48b772254afc8afdd timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Examples/Sample11_Logger.cs.meta b/Assets/Plugins/UniRx/Examples/Sample11_Logger.cs.meta index 0e5f69f..d5fa22b 100644 --- a/Assets/Plugins/UniRx/Examples/Sample11_Logger.cs.meta +++ b/Assets/Plugins/UniRx/Examples/Sample11_Logger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f5aa72c61e2548a4bac4d65f93c63bf1 timeCreated: 1455373902 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Examples/Sample12Scene.unity.meta b/Assets/Plugins/UniRx/Examples/Sample12Scene.unity.meta index 31b9df7..43d6aba 100644 --- a/Assets/Plugins/UniRx/Examples/Sample12Scene.unity.meta +++ b/Assets/Plugins/UniRx/Examples/Sample12Scene.unity.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4a4aea8df1ad11c47a1db84432dd30f8 timeCreated: 1455373896 -licenseType: Store +licenseType: Pro DefaultImporter: userData: assetBundleName: diff --git a/Assets/Plugins/UniRx/Examples/Sample12_ReactiveProperty.cs.meta b/Assets/Plugins/UniRx/Examples/Sample12_ReactiveProperty.cs.meta index a56cee3..66c4ceb 100644 --- a/Assets/Plugins/UniRx/Examples/Sample12_ReactiveProperty.cs.meta +++ b/Assets/Plugins/UniRx/Examples/Sample12_ReactiveProperty.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 18e34490a83a27e44adf93dd4ffd1f22 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Examples/Sample13Scene.unity.meta b/Assets/Plugins/UniRx/Examples/Sample13Scene.unity.meta index 21bef33..42dc203 100644 --- a/Assets/Plugins/UniRx/Examples/Sample13Scene.unity.meta +++ b/Assets/Plugins/UniRx/Examples/Sample13Scene.unity.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: b879645f640b02b43a8e78e210c1da1f timeCreated: 1455373896 -licenseType: Store +licenseType: Pro DefaultImporter: userData: assetBundleName: diff --git a/Assets/Plugins/UniRx/Examples/Sample13_ToDoApp.cs.meta b/Assets/Plugins/UniRx/Examples/Sample13_ToDoApp.cs.meta index aaef626..ca18a37 100644 --- a/Assets/Plugins/UniRx/Examples/Sample13_ToDoApp.cs.meta +++ b/Assets/Plugins/UniRx/Examples/Sample13_ToDoApp.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 022ecfa555367154c8cf87d61465f7e2 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Examples/Sample13_ToDoItem.prefab.meta b/Assets/Plugins/UniRx/Examples/Sample13_ToDoItem.prefab.meta index a80d47b..cbe92f5 100644 --- a/Assets/Plugins/UniRx/Examples/Sample13_ToDoItem.prefab.meta +++ b/Assets/Plugins/UniRx/Examples/Sample13_ToDoItem.prefab.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 173222196f3e1f0448b383f260df7d44 timeCreated: 1455373909 -licenseType: Store +licenseType: Pro NativeFormatImporter: userData: assetBundleName: diff --git a/Assets/Plugins/UniRx/ReadMe.txt b/Assets/Plugins/UniRx/ReadMe.txt index e42fee3..3057658 100644 --- a/Assets/Plugins/UniRx/ReadMe.txt +++ b/Assets/Plugins/UniRx/ReadMe.txt @@ -1,4 +1,4 @@ -UniRx - Reactive Extensions for Unity / Ver 6.2.0 +UniRx - Reactive Extensions for Unity / Ver 6.2.2 === Created by Yoshifumi Kawai(neuecc) diff --git a/Assets/Plugins/UniRx/ReadMe.txt.meta b/Assets/Plugins/UniRx/ReadMe.txt.meta index cc7c516..13251e7 100644 --- a/Assets/Plugins/UniRx/ReadMe.txt.meta +++ b/Assets/Plugins/UniRx/ReadMe.txt.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 52d665ea30c2a3a49a6fa4b3b5a0349a timeCreated: 1455373909 -licenseType: Store +licenseType: Pro TextScriptImporter: userData: assetBundleName: diff --git a/Assets/Plugins/UniRx/Scripts.meta b/Assets/Plugins/UniRx/Scripts.meta index fd387bb..ce2a6dd 100644 --- a/Assets/Plugins/UniRx/Scripts.meta +++ b/Assets/Plugins/UniRx/Scripts.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: fa640d68fc4eb2042bbb273d3e3e0d09 folderAsset: yes -timeCreated: 1522374661 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/Async.meta b/Assets/Plugins/UniRx/Scripts/Async.meta index 4dd4e9a..bd70662 100644 --- a/Assets/Plugins/UniRx/Scripts/Async.meta +++ b/Assets/Plugins/UniRx/Scripts/Async.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: aa48969b4eb9be74589b999b5517b1d6 folderAsset: yes -timeCreated: 1534816541 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/Async/AsyncUnit.cs b/Assets/Plugins/UniRx/Scripts/Async/AsyncUnit.cs index dbae84e..1a8f09d 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/AsyncUnit.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/AsyncUnit.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenEqualityComparer.cs b/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenEqualityComparer.cs index 119a1b3..72cdea2 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenEqualityComparer.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenEqualityComparer.cs @@ -1,5 +1,6 @@ -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + using System.Collections.Generic; using System.Threading; diff --git a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenExtensions.cs index ffe3527..8bfe4be 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenExtensions.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenExtensions.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; @@ -18,7 +18,7 @@ public static (UniTask, CancellationTokenRegistration) ToUniTask(this Cancellati } var promise = new UniTaskCompletionSource(); - return (promise.Task, cts.Register(cancellationTokenCallback, promise, false)); + return (promise.Task, cts.RegisterWithoutCaptureExecutionContext(cancellationTokenCallback, promise)); } static void Callback(object state) @@ -26,6 +26,50 @@ static void Callback(object state) var promise = (UniTaskCompletionSource)state; promise.TrySetResult(AsyncUnit.Default); } + + public static CancellationTokenRegistration RegisterWithoutCaptureExecutionContext(this CancellationToken cancellationToken, Action callback) + { + var restoreFlow = false; + if (!ExecutionContext.IsFlowSuppressed()) + { + ExecutionContext.SuppressFlow(); + restoreFlow = true; + } + + try + { + return cancellationToken.Register(callback, false); + } + finally + { + if (restoreFlow) + { + ExecutionContext.RestoreFlow(); + } + } + } + + public static CancellationTokenRegistration RegisterWithoutCaptureExecutionContext(this CancellationToken cancellationToken, Action callback, object state) + { + var restoreFlow = false; + if (!ExecutionContext.IsFlowSuppressed()) + { + ExecutionContext.SuppressFlow(); + restoreFlow = true; + } + + try + { + return cancellationToken.Register(callback, state, false); + } + finally + { + if (restoreFlow) + { + ExecutionContext.RestoreFlow(); + } + } + } } } diff --git a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenSourceExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenSourceExtensions.cs index 53f67c3..17618d7 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenSourceExtensions.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenSourceExtensions.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Threading; @@ -12,20 +12,24 @@ public static class CancellationTokenSourceExtensions { public static void CancelAfterSlim(this CancellationTokenSource cts, int millisecondsDelay, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update) { - var delay = UniTask.Delay(millisecondsDelay, ignoreTimeScale, delayTiming); + var delay = UniTask.Delay(millisecondsDelay, ignoreTimeScale, delayTiming, cts.Token); CancelAfterCore(cts, delay).Forget(); } public static void CancelAfterSlim(this CancellationTokenSource cts, TimeSpan delayTimeSpan, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update) { - var delay = UniTask.Delay(delayTimeSpan, ignoreTimeScale, delayTiming); + var delay = UniTask.Delay(delayTimeSpan, ignoreTimeScale, delayTiming, cts.Token); CancelAfterCore(cts, delay).Forget(); } static async UniTaskVoid CancelAfterCore(CancellationTokenSource cts, UniTask delayTask) { - await delayTask; - cts.Cancel(); + var alreadyCanceled = await delayTask.SuppressCancellationThrow(); + if (!alreadyCanceled) + { + cts.Cancel(); + cts.Dispose(); + } } public static void RegisterRaiseCancelOnDestroy(this CancellationTokenSource cts, Component component) diff --git a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices.meta b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices.meta index 6315a36..92dc576 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices.meta +++ b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: 522257e0538442a4b8de8de73b45a855 folderAsset: yes -timeCreated: 1534816541 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncMethodBuilderAttribute.cs b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncMethodBuilderAttribute.cs index c55f2b3..b9658c9 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncMethodBuilderAttribute.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncMethodBuilderAttribute.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member diff --git a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskMethodBuilder.cs b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskMethodBuilder.cs index 9f91c5f..586f859 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskMethodBuilder.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskMethodBuilder.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member diff --git a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs index acc7b68..2fcd55f 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member diff --git a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/MoveNextRunner.cs b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/MoveNextRunner.cs index 865fc44..ddf7a03 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/MoveNextRunner.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/MoveNextRunner.cs @@ -1,7 +1,8 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +using System.Diagnostics; using System.Runtime.CompilerServices; namespace UniRx.Async.CompilerServices @@ -11,6 +12,7 @@ internal class MoveNextRunner { public TStateMachine StateMachine; + [DebuggerHidden] public void Run() { StateMachine.MoveNext(); diff --git a/Assets/Plugins/UniRx/Scripts/Async/DiagnosticsExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/DiagnosticsExtensions.cs index e62b913..041b0c3 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/DiagnosticsExtensions.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/DiagnosticsExtensions.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; @@ -236,6 +236,10 @@ static bool IgnoreLine(MethodBase methodInfo) { return true; } + else if (declareType.StartsWith("UniRx.Async.CompilerServices")) + { + return true; + } else if (declareType == "System.Threading.Tasks.AwaitTaskContinuation") { return true; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Editor.meta b/Assets/Plugins/UniRx/Scripts/Async/Editor.meta index 9843e8c..40bc442 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Editor.meta +++ b/Assets/Plugins/UniRx/Scripts/Async/Editor.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: b137462cdaca62241abbbe13cdf5c8ec folderAsset: yes -timeCreated: 1534816541 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Editor/SplitterGUILayout.cs b/Assets/Plugins/UniRx/Scripts/Async/Editor/SplitterGUILayout.cs index 3590574..bca6a95 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Editor/SplitterGUILayout.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Editor/SplitterGUILayout.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerTreeView.cs b/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerTreeView.cs index 567ec0a..7e03931 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerTreeView.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerTreeView.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using UnityEngine; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerWindow.cs b/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerWindow.cs index e074835..5acb2c4 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerWindow.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerWindow.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using UnityEngine; diff --git a/Assets/Plugins/UniRx/Scripts/Async/EnumeratorAsyncExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/EnumeratorAsyncExtensions.cs index e6ba9cc..5f3411e 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/EnumeratorAsyncExtensions.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/EnumeratorAsyncExtensions.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/IAwaiter.cs b/Assets/Plugins/UniRx/Scripts/Async/IAwaiter.cs index 8a4a31a..6450ea5 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/IAwaiter.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/IAwaiter.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 using System.Runtime.CompilerServices; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal.meta index 266de1e..969dff2 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal.meta +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: 6e46ed1732c4cff4991621cfd4743590 folderAsset: yes -timeCreated: 1534816541 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs index 7793e27..75bc2f9 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs.meta index 03c22a2..693816c 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f83ebad81fb89fb4882331616ca6d248 timeCreated: 1532361008 -licenseType: Store +licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs index 765ab63..5f9ae6a 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; @@ -7,7 +7,7 @@ namespace UniRx.Async.Internal { - internal static class ArrayPoolUtil + public static class ArrayPoolUtil { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void EnsureCapacity(ref T[] array, int index, ArrayPool pool) @@ -44,6 +44,10 @@ public static RentArray Materialize(IEnumerable source) if (source is ICollection coll) { defaultCount = coll.Count; + var pool = ArrayPool.Shared; + var buffer = pool.Rent(defaultCount); + coll.CopyTo(buffer, 0); + return new RentArray(buffer, coll.Count, pool); } else if (source is IReadOnlyCollection rcoll) { @@ -55,17 +59,19 @@ public static RentArray Materialize(IEnumerable source) return new RentArray(Array.Empty(), 0, null); } - var pool = ArrayPool.Shared; - - var index = 0; - var buffer = pool.Rent(defaultCount); - foreach (var item in source) { - EnsureCapacity(ref buffer, index, pool); - buffer[index++] = item; - } + var pool = ArrayPool.Shared; + + var index = 0; + var buffer = pool.Rent(defaultCount); + foreach (var item in source) + { + EnsureCapacity(ref buffer, index, pool); + buffer[index++] = item; + } - return new RentArray(buffer, index, pool); + return new RentArray(buffer, index, pool); + } } public struct RentArray : IDisposable @@ -82,11 +88,15 @@ public RentArray(T[] array, int length, ArrayPool pool) } public void Dispose() + { + DisposeManually(!RuntimeHelpersAbstraction.IsWellKnownNoReferenceContainsType()); + } + + public void DisposeManually(bool clearArray) { if (pool != null) { - // clear manually(length optimize) - if (!RuntimeHelpersAbstraction.IsWellKnownNoReferenceContainsType()) + if (clearArray) { System.Array.Clear(Array, 0, Length); } diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs.meta index edc7397..e06ec65 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 424cc208fb61d4e448b08fcfa0eee25e timeCreated: 1532361007 -licenseType: Store +licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs index db37806..114a103 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; @@ -7,7 +7,7 @@ namespace UniRx.Async.Internal { - internal static class ArrayUtil + public static class ArrayUtil { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void EnsureCapacity(ref T[] array, int index) @@ -43,6 +43,9 @@ public static (T[] array, int length) Materialize(IEnumerable source) if (source is ICollection coll) { defaultCount = coll.Count; + var buffer = new T[defaultCount]; + coll.CopyTo(buffer, 0); + return (buffer, defaultCount); } else if (source is IReadOnlyCollection rcoll) { @@ -54,15 +57,17 @@ public static (T[] array, int length) Materialize(IEnumerable source) return (Array.Empty(), 0); } - var index = 0; - var buffer = new T[defaultCount]; - foreach (var item in source) { - EnsureCapacity(ref buffer, index); - buffer[index++] = item; - } + var index = 0; + var buffer = new T[defaultCount]; + foreach (var item in source) + { + EnsureCapacity(ref buffer, index); + buffer[index++] = item; + } - return (buffer, index); + return (buffer, index); + } } } } diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs.meta index 911303f..645fc4e 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 23146a82ec99f2542a87971c8d3d7988 timeCreated: 1532361007 -licenseType: Store +licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/CancellationTokenHelper.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/CancellationTokenHelper.cs index f60b5f4..93b3f52 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/CancellationTokenHelper.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/CancellationTokenHelper.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Threading; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ContinuationQueue.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/ContinuationQueue.cs index 3877cc8..41bb5be 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ContinuationQueue.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/ContinuationQueue.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs index 7c69c8c..378af62 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs.meta index d1e3838..2e5d219 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 5f39f495294d4604b8082202faf98554 timeCreated: 1532361007 -licenseType: Store +licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/LazyPromise.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/LazyPromise.cs index c899565..e62fd59 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/LazyPromise.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/LazyPromise.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/MinimumQueue.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/MinimumQueue.cs index d1fa87e..0cc40cd 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/MinimumQueue.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/MinimumQueue.cs @@ -1,4 +1,6 @@ -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +#endif using System; using System.Runtime.CompilerServices; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/PlayerLoopRunner.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/PlayerLoopRunner.cs index fc7d10d..86da337 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/PlayerLoopRunner.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/PlayerLoopRunner.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) using System; using UnityEngine; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ReusablePromise.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/ReusablePromise.cs index 3dda198..f8fd318 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ReusablePromise.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/ReusablePromise.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; @@ -155,6 +155,13 @@ public abstract class ReusablePromise : IAwaiter // can override for control 'start/reset' timing. public virtual bool IsCompleted => status.IsCompleted(); + protected T RawResult => result; + + protected void ForceSetResult(T result) + { + this.result = result; + } + public virtual T GetResult() { switch (status) @@ -227,7 +234,7 @@ public virtual bool TrySetResult(T result) return false; } - void TryInvokeContinuation() + protected void TryInvokeContinuation() { if (continuation == null) return; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs index 8e5d406..2bf4ceb 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs.meta index 62e4649..4254391 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 94975e4d4e0c0ea4ba787d3872ce9bb4 timeCreated: 1532361007 -licenseType: Store +licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/TaskTracker.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/TaskTracker.cs index b1df1be..4585c27 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/TaskTracker.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/TaskTracker.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/WeakDictionary.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/WeakDictionary.cs index d0e4f47..e4b395e 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/WeakDictionary.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Internal/WeakDictionary.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/PlayerLoopHelper.cs b/Assets/Plugins/UniRx/Scripts/Async/PlayerLoopHelper.cs index d389e7e..c7ab469 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/PlayerLoopHelper.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/PlayerLoopHelper.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers.meta index e8185b5..5745b55 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers.meta +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: e58eeef192ba04048b140d02356c2225 folderAsset: yes -timeCreated: 1534816541 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAnimatorTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAnimatorTrigger.cs index 99c7a28..00b66cb 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAnimatorTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAnimatorTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAwakeTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAwakeTrigger.cs index 199b513..0710dcb 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAwakeTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAwakeTrigger.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using UnityEngine; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncBeginDragTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncBeginDragTrigger.cs index ad2cdf2..bef1037 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncBeginDragTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncBeginDragTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCancelTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCancelTrigger.cs index d69f2cd..f484e59 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCancelTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCancelTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCanvasGroupChangedTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCanvasGroupChangedTrigger.cs index 57d30c3..98fb776 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCanvasGroupChangedTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCanvasGroupChangedTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollision2DTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollision2DTrigger.cs index 5cc1b39..c3f0c9c 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollision2DTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollision2DTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollisionTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollisionTrigger.cs index 66885a6..3534c69 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollisionTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollisionTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDeselectTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDeselectTrigger.cs index 9fe7a14..18ac7d0 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDeselectTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDeselectTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDestroyTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDestroyTrigger.cs index e26030a..f5a6ed6 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDestroyTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDestroyTrigger.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Threading; @@ -33,18 +33,22 @@ void OnDestroy() called = true; promise?.TrySetResult(); cancellationTokenSource?.Cancel(); + cancellationTokenSource?.Dispose(); if (canellationTokenSourceOrQueue != null) { if (canellationTokenSourceOrQueue is CancellationTokenSource cts) { cts.Cancel(); + cts.Dispose(); } else { var q = (MinimumQueue)canellationTokenSourceOrQueue; while (q.Count != 0) { - q.Dequeue().Cancel(); + var c = q.Dequeue(); + c.Cancel(); + c.Dispose(); } } canellationTokenSourceOrQueue = null; @@ -61,7 +65,11 @@ public UniTask OnDestroyAsync() /// Add Cancellation Triggers on destroy public void AddCancellationTriggerOnDestory(CancellationTokenSource cts) { - if (called) cts.Cancel(); + if (called) + { + cts.Cancel(); + cts.Dispose(); + } if (canellationTokenSourceOrQueue == null) { diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDragTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDragTrigger.cs index ff30a30..46ad8d9 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDragTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDragTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDropTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDropTrigger.cs index b282248..8993952 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDropTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDropTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEnableDisableTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEnableDisableTrigger.cs index c6c8be6..092b97f 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEnableDisableTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEnableDisableTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEndDragTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEndDragTrigger.cs index b200b1a..cbaa823 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEndDragTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEndDragTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEventTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEventTrigger.cs index fdb5406..218fedc 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEventTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEventTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncFixedUpdateTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncFixedUpdateTrigger.cs index 8cd71d3..8cfc821 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncFixedUpdateTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncFixedUpdateTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncInitializePotentialDragTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncInitializePotentialDragTrigger.cs index 34a440e..59e04b4 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncInitializePotentialDragTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncInitializePotentialDragTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncJointTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncJointTrigger.cs index b3dc1ca..9321182 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncJointTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncJointTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncLateUpdateTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncLateUpdateTrigger.cs index 3c55827..e88dfd8 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncLateUpdateTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncLateUpdateTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMouseTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMouseTrigger.cs index 6ce346c..243fb00 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMouseTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMouseTrigger.cs @@ -1,7 +1,7 @@ #if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO) -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMoveTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMoveTrigger.cs index d286f62..cab098c 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMoveTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMoveTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncParticleTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncParticleTrigger.cs index 6ef0840..4e22b36 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncParticleTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncParticleTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerClickTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerClickTrigger.cs index 1397614..64b902d 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerClickTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerClickTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerDownTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerDownTrigger.cs index 33b8799..2e32bfc 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerDownTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerDownTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerEnterTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerEnterTrigger.cs index 309ac7e..36ed2e3 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerEnterTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerEnterTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerExitTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerExitTrigger.cs index 213e188..3cf2575 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerExitTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerExitTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerUpTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerUpTrigger.cs index 2d1557a..4f56fa9 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerUpTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerUpTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncRectTransformTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncRectTransformTrigger.cs index d2187e3..4fab679 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncRectTransformTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncRectTransformTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncScrollTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncScrollTrigger.cs index ab45556..7a28c64 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncScrollTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncScrollTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSelectTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSelectTrigger.cs index 2ba3759..093ec79 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSelectTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSelectTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncStartTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncStartTrigger.cs index 4a30e7e..4c65c8c 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncStartTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncStartTrigger.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using UnityEngine; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSubmitTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSubmitTrigger.cs index 278fa26..0dd4206 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSubmitTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSubmitTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTransformChangedTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTransformChangedTrigger.cs index 887e1bf..acad97e 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTransformChangedTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTransformChangedTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTrigger2DTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTrigger2DTrigger.cs index 5b70b02..dc33415 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTrigger2DTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTrigger2DTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerBase.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerBase.cs index 70a1081..ceb4f7f 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerBase.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerBase.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; @@ -15,7 +15,7 @@ public interface ICancelablePromise bool TrySetCanceled(); } - public class AsyncTriggerPromise : ReusablePromise, ICancelablePromise + public class AsyncTriggerPromise : ReusablePromise, IPromise, ICancelablePromise { public CancellationToken RegisteredCancellationToken { get; private set; } @@ -30,6 +30,24 @@ public AsyncTriggerPromise(CancellationToken cancellationToken) TaskTracker.TrackActiveTask(this); } + public override T GetResult() + { + if (Status == AwaiterStatus.Pending) return RawResult; + return base.GetResult(); + } + + public override bool TrySetResult(T result) + { + if (Status == AwaiterStatus.Pending) + { + // keep status as Pending. + this.ForceSetResult(result); + TryInvokeContinuation(); + return true; + } + return false; + } + public override bool TrySetCanceled() { if (Status == AwaiterStatus.Canceled) return false; @@ -157,14 +175,20 @@ protected UniTask GetOrAddPromise(ref AsyncTriggerPromise promise, ref } if (promises == null) promises = new AsyncTriggerPromiseDictionary(); - var cancellablePromise = new AsyncTriggerPromise(); + + if (promises.TryGetValue(cancellationToken, out var cancellablePromise)) + { + return cancellablePromise.Task; + } + + cancellablePromise = new AsyncTriggerPromise(); promises.Add(cancellationToken, cancellablePromise); if (!calledAwake) { PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, new AwakeMonitor(this)); } - var registrationToken = cancellationToken.Register(Callback, Tuple.Create(promises, cancellablePromise)); + var registrationToken = cancellationToken.RegisterWithoutCaptureExecutionContext(Callback, Tuple.Create((ICancellationTokenKeyDictionary)promises, (ICancelablePromise)cancellablePromise)); if (registeredCancellations == null) { registeredCancellations = ArrayPool.Shared.Rent(4); @@ -193,10 +217,7 @@ protected void TrySetResult(ReusablePromise promise, AsyncTriggerPromiseDi } if (promises != null) { - foreach (var item in promises.Values) - { - item.TrySetResult(value); - } + PromiseHelper.TrySetResultAll(promises.Values, value); } } diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerExtensions.cs index f425f37..8413968 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerExtensions.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerExtensions.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Threading; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerTrigger.cs index 50eeff0..22f3c94 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateSelectedTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateSelectedTrigger.cs index 49a1c98..5f7536e 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateSelectedTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateSelectedTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateTrigger.cs index 6d76c62..258eec9 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncVisibleTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncVisibleTrigger.cs index d3b79ed..df9596e 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncVisibleTrigger.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncVisibleTrigger.cs @@ -1,5 +1,5 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Bridge.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Bridge.cs index 60daca7..814bd02 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Bridge.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Bridge.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Delay.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Delay.cs index 08a9141..d828358 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Delay.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Delay.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Factory.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Factory.cs index cdbd94c..0150450 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Factory.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Factory.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Run.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Run.cs index ac56637..508be8d 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Run.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Run.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Threading.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Threading.cs index 8cdf905..8087e2d 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Threading.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Threading.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WaitUntil.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WaitUntil.cs index 32daf11..7326201 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WaitUntil.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WaitUntil.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.Generated.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.Generated.cs index 3b0816b..bda09db 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.Generated.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.Generated.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.cs index bf4269f..715e55b 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.Generated.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.Generated.cs index 8253ded..ebc0fe2 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.Generated.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.Generated.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.cs index 5b246ea..2c5049b 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.cs index 8bface1..25c533d 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTask.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskCompletionSource.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTaskCompletionSource.cs index 7ed23fb..c9a148d 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskCompletionSource.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTaskCompletionSource.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; @@ -37,7 +37,35 @@ public ExceptionDispatchInfo GetException() } } - public class UniTaskCompletionSource : IAwaiter + public interface IResolvePromise + { + bool TrySetResult(); + } + + public interface IResolvePromise + { + bool TrySetResult(T value); + } + + public interface IRejectPromise + { + bool TrySetException(Exception exception); + } + + public interface ICancelPromise + { + bool TrySetCanceled(); + } + + public interface IPromise : IResolvePromise, IRejectPromise, ICancelPromise + { + } + + public interface IPromise : IResolvePromise, IRejectPromise, ICancelPromise + { + } + + public class UniTaskCompletionSource : IAwaiter, IPromise { // State(= AwaiterStatus) const int Pending = 0; @@ -204,7 +232,7 @@ void INotifyCompletion.OnCompleted(Action continuation) } } - public class UniTaskCompletionSource : IAwaiter + public class UniTaskCompletionSource : IAwaiter, IPromise { // State(= AwaiterStatus) const int Pending = 0; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.Shorthand.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.Shorthand.cs index 94bbae9..235bcac 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.Shorthand.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.Shorthand.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Collections.Generic; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.cs index 2ee3b1a..0367d29 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; @@ -112,6 +112,7 @@ public static async UniTask Timeout(this UniTask task, TimeSpan timeout if (taskCancellationTokenSource != null) { taskCancellationTokenSource.Cancel(); + taskCancellationTokenSource.Dispose(); } throw new TimeoutException("Exceed Timeout:" + timeout); @@ -119,6 +120,7 @@ public static async UniTask Timeout(this UniTask task, TimeSpan timeout else { delayCancellationTokenSource.Cancel(); + delayCancellationTokenSource.Dispose(); } if (value.IsCanceled) @@ -156,6 +158,7 @@ public static async UniTask TimeoutWithoutException(this UniTask task, Tim if (taskCancellationTokenSource != null) { taskCancellationTokenSource.Cancel(); + taskCancellationTokenSource.Dispose(); } return (true, default(T)); @@ -163,6 +166,7 @@ public static async UniTask TimeoutWithoutException(this UniTask task, Tim else { delayCancellationTokenSource.Cancel(); + delayCancellationTokenSource.Dispose(); } if (value.IsCanceled) diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskScheduler.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTaskScheduler.cs index 887f01f..9331e24 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskScheduler.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTaskScheduler.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskVoid.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTaskVoid.cs index 9f1284a..f74de6c 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskVoid.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UniTaskVoid.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.Jobs.cs b/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.Jobs.cs index bd42e47..01185e3 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.Jobs.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.Jobs.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER && ENABLE_MANAGED_JOBS +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) && ENABLE_MANAGED_JOBS #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; diff --git a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.cs index 539641b..0005ca7 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; @@ -61,6 +61,10 @@ public static ResourceRequestAwaiter GetAwaiter(this ResourceRequest resourceReq #if ENABLE_WWW +#if UNITY_2018_3_OR_NEWER +#pragma warning disable CS0618 +#endif + public static IAwaiter GetAwaiter(this WWW www) { Error.ThrowArgumentNullException(www, nameof(www)); @@ -97,6 +101,10 @@ public static UniTask ToUniTask(this WWW www) return new UniTask(awaiter); } +#if UNITY_2018_3_OR_NEWER +#pragma warning restore CS0618 +#endif + #endif #if ENABLE_UNITYWEBREQUEST @@ -430,6 +438,10 @@ public void UnsafeOnCompleted(Action continuation) #if ENABLE_WWW +#if UNITY_2018_3_OR_NEWER +#pragma warning disable CS0618 +#endif + class WWWConfiguredAwaiter : IAwaiter, IPlayerLoopItem { WWW asyncOperation; @@ -520,6 +532,10 @@ public void UnsafeOnCompleted(Action continuation) } } +#if UNITY_2018_3_OR_NEWER +#pragma warning restore CS0618 +#endif + #endif #if ENABLE_UNITYWEBREQUEST diff --git a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.uGUI.cs b/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.uGUI.cs index 8befaf5..b0effcb 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.uGUI.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.uGUI.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; @@ -16,125 +16,174 @@ public static partial class UnityAsyncExtensions { public static AsyncUnityEventHandler GetAsyncEventHandler(this UnityEvent unityEvent, CancellationToken cancellationToken) { - return new AsyncUnityEventHandler(unityEvent, cancellationToken); + return new AsyncUnityEventHandler(unityEvent, cancellationToken, false); } - public static async UniTask OnInvokeAsync(this UnityEvent unityEvent, CancellationToken cancellationToken) + public static UniTask OnInvokeAsync(this UnityEvent unityEvent, CancellationToken cancellationToken) { - using (var handler = unityEvent.GetAsyncEventHandler(cancellationToken)) - { - await handler.OnInvokeAsync(); - } + return new AsyncUnityEventHandler(unityEvent, cancellationToken, true).OnInvokeAsync(); } public static IAsyncClickEventHandler GetAsyncClickEventHandler(this Button button) { - return new AsyncUnityEventHandler(button.onClick, button.GetCancellationTokenOnDestroy()); + return new AsyncUnityEventHandler(button.onClick, button.GetCancellationTokenOnDestroy(), false); } - public static async UniTask OnInvokeAsync(this Button button) + public static IAsyncClickEventHandler GetAsyncClickEventHandler(this Button button, CancellationToken cancellationToken) { - using (var handler = button.GetAsyncClickEventHandler()) - { - await handler.OnClickAsync(); - } + return new AsyncUnityEventHandler(button.onClick, cancellationToken, false); + } + + public static UniTask OnClickAsync(this Button button) + { + return new AsyncUnityEventHandler(button.onClick, button.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnClickAsync(this Button button, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(button.onClick, cancellationToken, true).OnInvokeAsync(); } public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Toggle toggle) { - return new AsyncUnityEventHandler(toggle.onValueChanged, toggle.GetCancellationTokenOnDestroy()); + return new AsyncUnityEventHandler(toggle.onValueChanged, toggle.GetCancellationTokenOnDestroy(), false); } - public static async UniTask OnValueChangedAsync(this Toggle toggle) + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Toggle toggle, CancellationToken cancellationToken) { - using (var handler = toggle.GetAsyncValueChangedEventHandler()) - { - return await handler.OnValueChangedAsync(); - } + return new AsyncUnityEventHandler(toggle.onValueChanged, cancellationToken, false); + } + + public static UniTask OnValueChangedAsync(this Toggle toggle) + { + return new AsyncUnityEventHandler(toggle.onValueChanged, toggle.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnValueChangedAsync(this Toggle toggle, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(toggle.onValueChanged, cancellationToken, true).OnInvokeAsync(); } public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Scrollbar scrollbar) { - return new AsyncUnityEventHandler(scrollbar.onValueChanged, scrollbar.GetCancellationTokenOnDestroy()); + return new AsyncUnityEventHandler(scrollbar.onValueChanged, scrollbar.GetCancellationTokenOnDestroy(), false); } - public static async UniTask OnValueChangedAsync(this Scrollbar scrollbar) + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Scrollbar scrollbar, CancellationToken cancellationToken) { - using (var handler = scrollbar.GetAsyncValueChangedEventHandler()) - { - return await handler.OnValueChangedAsync(); - } + return new AsyncUnityEventHandler(scrollbar.onValueChanged, cancellationToken, false); + } + + public static UniTask OnValueChangedAsync(this Scrollbar scrollbar) + { + return new AsyncUnityEventHandler(scrollbar.onValueChanged, scrollbar.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnValueChangedAsync(this Scrollbar scrollbar, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(scrollbar.onValueChanged, cancellationToken, true).OnInvokeAsync(); } public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this ScrollRect scrollRect) { - return new AsyncUnityEventHandler(scrollRect.onValueChanged, scrollRect.GetCancellationTokenOnDestroy()); + return new AsyncUnityEventHandler(scrollRect.onValueChanged, scrollRect.GetCancellationTokenOnDestroy(), false); } - public static async UniTask OnValueChangedAsync(this ScrollRect scrollRect) + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this ScrollRect scrollRect, CancellationToken cancellationToken) { - using (var handler = scrollRect.GetAsyncValueChangedEventHandler()) - { - return await handler.OnValueChangedAsync(); - } + return new AsyncUnityEventHandler(scrollRect.onValueChanged, cancellationToken, false); + } + + public static UniTask OnValueChangedAsync(this ScrollRect scrollRect) + { + return new AsyncUnityEventHandler(scrollRect.onValueChanged, scrollRect.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnValueChangedAsync(this ScrollRect scrollRect, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(scrollRect.onValueChanged, cancellationToken, true).OnInvokeAsync(); } public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Slider slider) { - return new AsyncUnityEventHandler(slider.onValueChanged, slider.GetCancellationTokenOnDestroy()); + return new AsyncUnityEventHandler(slider.onValueChanged, slider.GetCancellationTokenOnDestroy(), false); } - public static async UniTask OnValueChangedAsync(this Slider slider) + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Slider slider, CancellationToken cancellationToken) { - using (var handler = slider.GetAsyncValueChangedEventHandler()) - { - return await handler.OnValueChangedAsync(); - } + return new AsyncUnityEventHandler(slider.onValueChanged, cancellationToken, false); + } + + public static UniTask OnValueChangedAsync(this Slider slider) + { + return new AsyncUnityEventHandler(slider.onValueChanged, slider.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnValueChangedAsync(this Slider slider, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(slider.onValueChanged, cancellationToken, true).OnInvokeAsync(); } public static IAsyncEndEditEventHandler GetAsyncEndEditEventHandler(this InputField inputField) { - return new AsyncUnityEventHandler(inputField.onEndEdit, inputField.GetCancellationTokenOnDestroy()); + return new AsyncUnityEventHandler(inputField.onEndEdit, inputField.GetCancellationTokenOnDestroy(), false); } - public static async UniTask OnEndEditAsync(this InputField inputField) + public static IAsyncEndEditEventHandler GetAsyncEndEditEventHandler(this InputField inputField, CancellationToken cancellationToken) { - using (var handler = inputField.GetAsyncEndEditEventHandler()) - { - return await handler.OnEndEditAsync(); - } + return new AsyncUnityEventHandler(inputField.onEndEdit, cancellationToken, false); + } + + public static UniTask OnEndEditAsync(this InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onEndEdit, inputField.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnEndEditAsync(this InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onEndEdit, cancellationToken, true).OnInvokeAsync(); } public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Dropdown dropdown) { - return new AsyncUnityEventHandler(dropdown.onValueChanged, dropdown.GetCancellationTokenOnDestroy()); + return new AsyncUnityEventHandler(dropdown.onValueChanged, dropdown.GetCancellationTokenOnDestroy(), false); } - public static async UniTask OnValueChanged(this Dropdown dropdown) + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Dropdown dropdown, CancellationToken cancellationToken) { - using (var handler = dropdown.GetAsyncValueChangedEventHandler()) - { - return await handler.OnValueChangedAsync(); - } + return new AsyncUnityEventHandler(dropdown.onValueChanged, cancellationToken, false); + } + + public static UniTask OnValueChanged(this Dropdown dropdown) + { + return new AsyncUnityEventHandler(dropdown.onValueChanged, dropdown.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnValueChanged(this Dropdown dropdown, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(dropdown.onValueChanged, cancellationToken, true).OnInvokeAsync(); } } public interface IAsyncClickEventHandler : IDisposable { UniTask OnClickAsync(); + UniTask OnClickAsyncSuppressCancellationThrow(); } public interface IAsyncValueChangedEventHandler : IDisposable { UniTask OnValueChangedAsync(); + UniTask<(bool IsCanceled, T Result)> OnValueChangedAsyncSuppressCancellationThrow(); } public interface IAsyncEndEditEventHandler : IDisposable { UniTask OnEndEditAsync(); + UniTask<(bool IsCanceled, T Result)> OnEndEditAsyncSuppressCancellationThrow(); } - // event handler is reusable. + // event handler is reusable when callOnce = false. public class AsyncUnityEventHandler : IAwaiter, IDisposable, IAsyncClickEventHandler { static Action cancellationCallback = CancellationCallback; @@ -144,9 +193,13 @@ public class AsyncUnityEventHandler : IAwaiter, IDisposable, IAsyncClickEventHan Action continuation; CancellationTokenRegistration registration; bool isDisposed; + bool callOnce; + UniTask? suppressCancellationThrowTask; - public AsyncUnityEventHandler(UnityEvent unityEvent, CancellationToken cancellationToken) + public AsyncUnityEventHandler(UnityEvent unityEvent, CancellationToken cancellationToken, bool callOnce) { + this.callOnce = callOnce; + if (cancellationToken.IsCancellationRequested) { isDisposed = true; @@ -159,7 +212,7 @@ public AsyncUnityEventHandler(UnityEvent unityEvent, CancellationToken cancellat if (cancellationToken.CanBeCanceled) { - registration = cancellationToken.Register(cancellationCallback, this, false); + registration = cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallback, this); } TaskTracker.TrackActiveTask(this, 3); @@ -171,6 +224,15 @@ public UniTask OnInvokeAsync() return new UniTask(this); } + public UniTask OnInvokeAsyncSuppressCancellationThrow() + { + if (suppressCancellationThrowTask == null) + { + suppressCancellationThrowTask = OnInvokeAsync().SuppressCancellationThrow(); + } + return suppressCancellationThrowTask.Value; + } + void Invoke() { var c = continuation; @@ -207,6 +269,7 @@ public void Dispose() void IAwaiter.GetResult() { if (isDisposed) throw new OperationCanceledException(); + if (callOnce) Dispose(); } void INotifyCompletion.OnCompleted(Action action) @@ -226,9 +289,14 @@ UniTask IAsyncClickEventHandler.OnClickAsync() { return OnInvokeAsync(); } + + UniTask IAsyncClickEventHandler.OnClickAsyncSuppressCancellationThrow() + { + return OnInvokeAsyncSuppressCancellationThrow(); + } } - // event handler is reusable. + // event handler is reusable when callOnce = false. public class AsyncUnityEventHandler : IAwaiter, IDisposable, IAsyncValueChangedEventHandler, IAsyncEndEditEventHandler { static Action cancellationCallback = CancellationCallback; @@ -239,9 +307,13 @@ public class AsyncUnityEventHandler : IAwaiter, IDisposable, IAsyncValueCh CancellationTokenRegistration registration; bool isDisposed; T eventValue; + bool callOnce; + UniTask<(bool, T)>? suppressCancellationThrowTask; - public AsyncUnityEventHandler(UnityEvent unityEvent, CancellationToken cancellationToken) + public AsyncUnityEventHandler(UnityEvent unityEvent, CancellationToken cancellationToken, bool callOnce) { + this.callOnce = callOnce; + if (cancellationToken.IsCancellationRequested) { isDisposed = true; @@ -254,7 +326,7 @@ public AsyncUnityEventHandler(UnityEvent unityEvent, CancellationToken cancel if (cancellationToken.CanBeCanceled) { - registration = cancellationToken.Register(cancellationCallback, this, false); + registration = cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallback, this); } TaskTracker.TrackActiveTask(this, 3); @@ -266,6 +338,15 @@ public UniTask OnInvokeAsync() return new UniTask(this); } + public UniTask<(bool IsCanceled, T Result)> OnInvokeAsyncSuppressCancellationThrow() + { + if (suppressCancellationThrowTask == null) + { + suppressCancellationThrowTask = OnInvokeAsync().SuppressCancellationThrow(); + } + return suppressCancellationThrowTask.Value; + } + void Invoke(T value) { this.eventValue = value; @@ -305,12 +386,14 @@ public void Dispose() T IAwaiter.GetResult() { if (isDisposed) throw new OperationCanceledException(); + if (callOnce) Dispose(); return eventValue; } void IAwaiter.GetResult() { if (isDisposed) throw new OperationCanceledException(); + if (callOnce) Dispose(); } void INotifyCompletion.OnCompleted(Action action) @@ -331,10 +414,20 @@ UniTask IAsyncValueChangedEventHandler.OnValueChangedAsync() return OnInvokeAsync(); } + UniTask<(bool IsCanceled, T Result)> IAsyncValueChangedEventHandler.OnValueChangedAsyncSuppressCancellationThrow() + { + return OnInvokeAsyncSuppressCancellationThrow(); + } + UniTask IAsyncEndEditEventHandler.OnEndEditAsync() { return OnInvokeAsync(); } + + UniTask<(bool IsCanceled, T Result)> IAsyncEndEditEventHandler.OnEndEditAsyncSuppressCancellationThrow() + { + return OnInvokeAsyncSuppressCancellationThrow(); + } } } diff --git a/Assets/Plugins/UniRx/Scripts/Async/UnityEqualityComparer.cs b/Assets/Plugins/UniRx/Scripts/Async/UnityEqualityComparer.cs index 6756872..d69bf09 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UnityEqualityComparer.cs +++ b/Assets/Plugins/UniRx/Scripts/Async/UnityEqualityComparer.cs @@ -1,4 +1,6 @@ -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +#endif using System; using System.Collections.Generic; @@ -80,6 +82,7 @@ static object GetDefaultHelper(Type type) if (t.Equals(vector3Type)) return (object)UnityEqualityComparer.Vector3; if (t.Equals(vector4Type)) return (object)UnityEqualityComparer.Vector4; if (t.Equals(colorType)) return (object)UnityEqualityComparer.Color; + if (t.Equals(color32Type)) return (object)UnityEqualityComparer.Color32; if (t.Equals(rectType)) return (object)UnityEqualityComparer.Rect; if (t.Equals(boundsType)) return (object)UnityEqualityComparer.Bounds; if (t.Equals(quaternionType)) return (object)UnityEqualityComparer.Quaternion; diff --git a/Assets/Plugins/UniRx/Scripts/Asynchronous.meta b/Assets/Plugins/UniRx/Scripts/Asynchronous.meta index f54d72a..4de28ae 100644 --- a/Assets/Plugins/UniRx/Scripts/Asynchronous.meta +++ b/Assets/Plugins/UniRx/Scripts/Asynchronous.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: 683bdf552f52d19428a6f664d9f37bd2 folderAsset: yes -timeCreated: 1522374661 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/Asynchronous/WebRequestExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Asynchronous/WebRequestExtensions.cs.meta index 58d8718..5be850f 100644 --- a/Assets/Plugins/UniRx/Scripts/Asynchronous/WebRequestExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Asynchronous/WebRequestExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 457f0007b2c70e34e9929ec8f0e2c4e6 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables.meta b/Assets/Plugins/UniRx/Scripts/Disposables.meta index 666b547..f0479a7 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: 77ca67bba7f57874586fd7e17790b52b folderAsset: yes -timeCreated: 1522374661 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/BooleanDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/BooleanDisposable.cs.meta index 77fe320..4fe8917 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/BooleanDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/BooleanDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4ff95c6eb380ca248984d8c27c1244d0 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/CancellationDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/CancellationDisposable.cs.meta index 5750e92..9a05768 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/CancellationDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/CancellationDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 6c675907554bfa24d8bd411f386e410d timeCreated: 1475137543 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/CompositeDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/CompositeDisposable.cs.meta index ca51226..33e695a 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/CompositeDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/CompositeDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a0f9d923bd5f4cd47b39bdd83125de27 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/DictionaryDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/DictionaryDisposable.cs.meta index 2f6e4bc..67adf14 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/DictionaryDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/DictionaryDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 702939929fc84d544b12076b76aa73b5 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/Disposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/Disposable.cs.meta index 2549165..219760e 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/Disposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/Disposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 958f291bb8f434740a6d2c08ad5182a0 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/DisposableExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/DisposableExtensions.cs.meta index be386f7..b584f6b 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/DisposableExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/DisposableExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9c4757265ae105441bae71007cbd0184 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/ICancelable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/ICancelable.cs.meta index c9ddc40..6af4cb2 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/ICancelable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/ICancelable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: b5cd5b0b304c78345a49757b1f6f8ba8 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/MultipleAssignmentDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/MultipleAssignmentDisposable.cs.meta index 4e71cbf..40947a9 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/MultipleAssignmentDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/MultipleAssignmentDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: bb959083576ace749afd55c1e54b02d9 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/RefCountDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/RefCountDisposable.cs.meta index c388fe2..1dd30f6 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/RefCountDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/RefCountDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2fb5a2cdb138579498eb20d8b7818ad8 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/ScheduledDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/ScheduledDisposable.cs.meta index 5b873ad..6e70e61 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/ScheduledDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/ScheduledDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: db98ce742e859bd4e81db434c3ca3663 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/SerialDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/SerialDisposable.cs.meta index 3b6e544..e9a07a8 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/SerialDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/SerialDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 06fb064ad9e4d354ab15ff89f6343243 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/SingleAssignmentDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/SingleAssignmentDisposable.cs.meta index 6beb674..6fddafa 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/SingleAssignmentDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/SingleAssignmentDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7ec869f7548c62748ad57a5c86b2f6ba timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/StableCompositeDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/StableCompositeDisposable.cs.meta index 0c29a6b..85c914f 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/StableCompositeDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/StableCompositeDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3a9cd9fa22bc6a5439484581f5049cf8 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/EventPattern.cs.meta b/Assets/Plugins/UniRx/Scripts/EventPattern.cs.meta index 01992d1..ad6fa9a 100644 --- a/Assets/Plugins/UniRx/Scripts/EventPattern.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/EventPattern.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e4b797bfea1999a499309068b7d7a97e timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil.meta index f4b2c89..d12b789 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: 76ea4c3d60485a64ba51ea44ee237ef9 folderAsset: yes -timeCreated: 1522374661 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/AscynLock.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/AscynLock.cs.meta index fe6cc8b..11fcee4 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/AscynLock.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/AscynLock.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 23dbd656cfe9c5e47b02c3c263e476aa timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/ExceptionExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/ExceptionExtensions.cs.meta index 33c402c..aa5a411 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/ExceptionExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/ExceptionExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 94d5d10805124b34c8b488ebf3f893eb timeCreated: 1509016318 -licenseType: Store +licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/ImmutableList.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/ImmutableList.cs.meta index 0540370..bb4d1e9 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/ImmutableList.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/ImmutableList.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: dbafd8a41f556ec40b4bbd46fca2e85c timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/ListObserver.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/ListObserver.cs.meta index 1eeeef0..f73a979 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/ListObserver.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/ListObserver.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 889dc2f3c5f44d24a98a2c25510b4346 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/MicroCoroutine.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/MicroCoroutine.cs.meta index 938793b..e1f9e44 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/MicroCoroutine.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/MicroCoroutine.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 108be6d634275c94a95eeb2a39de0792 timeCreated: 1462599042 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/PriorityQueue.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/PriorityQueue.cs.meta index fc78ce6..142c4fb 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/PriorityQueue.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/PriorityQueue.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7956b408e24dc5a4884fe4f5a3d7c858 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/ReflectionAccessor.cs b/Assets/Plugins/UniRx/Scripts/InternalUtil/ReflectionAccessor.cs deleted file mode 100644 index 5f46e1a..0000000 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/ReflectionAccessor.cs +++ /dev/null @@ -1,114 +0,0 @@ -// no use - -#if false - -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Reflection; - -namespace UniRx.InternalUtil -{ - public interface IReflectionAccessor - { - object GetValue(object source); - } - - public static class ReflectionAccessor - { - public static IReflectionAccessor Create(MemberInfo memberInfo) - { - var propInfo = memberInfo as PropertyInfo; - if (propInfo != null) - { - return new PropertyInfoAccessor(propInfo); - } - - var fieldInfo = memberInfo as FieldInfo; - if (fieldInfo != null) - { - return new FieldInfoAccessor(fieldInfo); - } - - throw new ArgumentException("invalid member info:" + memberInfo.GetType()); - } - - public static IReflectionAccessor Create(MemberExpression rootExpression) - { - if (rootExpression == null) throw new ArgumentNullException("rootExpression"); - - var accessor = new RecursiveAccessor(rootExpression); - // minimum optimization - return (accessor.AccessorCount == 1) - ? accessor.GetFirstAccessor() - : accessor; - } - - class PropertyInfoAccessor : IReflectionAccessor - { - readonly MethodInfo methodInfo; - - public PropertyInfoAccessor(PropertyInfo propInfo) - { - methodInfo = propInfo.GetGetMethod(); - } - - public object GetValue(object source) - { - return methodInfo.Invoke(source, null); - } - } - - class FieldInfoAccessor : IReflectionAccessor - { - readonly FieldInfo fieldInfo; - - public FieldInfoAccessor(FieldInfo fieldInfo) - { - this.fieldInfo = fieldInfo; - } - - public object GetValue(object source) - { - return fieldInfo.GetValue(source); - } - } - - class RecursiveAccessor : IReflectionAccessor - { - readonly List accessors; - - public int AccessorCount { get { return accessors.Count; } } - public IReflectionAccessor GetFirstAccessor() - { - return accessors[0]; - } - - public RecursiveAccessor(Expression expression) - { - var reflectionAccessors = new List(); - while (expression is MemberExpression) - { - var memberExpression = (MemberExpression)expression; - reflectionAccessors.Add(ReflectionAccessor.Create(memberExpression.Member)); - expression = memberExpression.Expression; - } - - this.accessors = reflectionAccessors; - } - - public object GetValue(object source) - { - var result = source; - for (int i = accessors.Count - 1; i >= 0; i--) - { - var accessor = accessors[i]; - result = accessor.GetValue(result); - } - return result; - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/ReflectionAccessor.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/ReflectionAccessor.cs.meta deleted file mode 100644 index e1c5ea5..0000000 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/ReflectionAccessor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 88d8b380ac449bb4fa107a002f6e6ca7 -timeCreated: 1455373900 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/ScheduledItem.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/ScheduledItem.cs.meta index a15fa43..91514e6 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/ScheduledItem.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/ScheduledItem.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 45457ee4a77967347828238b7a52b851 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/ThreadSafeQueueWorker.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/ThreadSafeQueueWorker.cs.meta index f430ea0..a1b4b1e 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/ThreadSafeQueueWorker.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/ThreadSafeQueueWorker.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 768cbfcbe2a8e704a8953eea28cd33df timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/New GUISkin.guiskin b/Assets/Plugins/UniRx/Scripts/New GUISkin.guiskin deleted file mode 100644 index 7c2227e..0000000 --- a/Assets/Plugins/UniRx/Scripts/New GUISkin.guiskin +++ /dev/null @@ -1,1427 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 1 - m_Script: {fileID: 12001, guid: 0000000000000000e000000000000000, type: 0} - m_Name: New GUISkin - m_EditorClassIdentifier: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_box: - m_Name: box - m_Normal: - m_Background: {fileID: 11001, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0.79999995, g: 0.79999995, b: 0.79999995, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 6 - m_Right: 6 - m_Top: 6 - m_Bottom: 6 - m_Margin: - m_Left: 4 - m_Right: 4 - m_Top: 4 - m_Bottom: 4 - m_Padding: - m_Left: 4 - m_Right: 4 - m_Top: 4 - m_Bottom: 4 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 1 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 0 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_button: - m_Name: button - m_Normal: - m_Background: {fileID: 11006, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0.9, g: 0.9, b: 0.9, a: 1} - m_Hover: - m_Background: {fileID: 11003, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 1, g: 1, b: 1, a: 1} - m_Active: - m_Background: {fileID: 11002, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0.9, g: 0.9, b: 0.9, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 1, g: 1, b: 1, a: 1} - m_OnNormal: - m_Background: {fileID: 11005, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0.9019608, g: 0.9019608, b: 0.9019608, a: 1} - m_OnHover: - m_Background: {fileID: 11004, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 1, g: 1, b: 1, a: 1} - m_OnActive: - m_Background: {fileID: 11002, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0.9, g: 0.9, b: 0.9, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 6 - m_Right: 6 - m_Top: 6 - m_Bottom: 4 - m_Margin: - m_Left: 4 - m_Right: 4 - m_Top: 4 - m_Bottom: 4 - m_Padding: - m_Left: 6 - m_Right: 6 - m_Top: 3 - m_Bottom: 3 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 4 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 0 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_toggle: - m_Name: toggle - m_Normal: - m_Background: {fileID: 11018, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0.89112896, g: 0.89112896, b: 0.89112896, a: 1} - m_Hover: - m_Background: {fileID: 11014, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 1, g: 1, b: 1, a: 1} - m_Active: - m_Background: {fileID: 11013, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 1, g: 1, b: 1, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 11016, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0.8901961, g: 0.8901961, b: 0.8901961, a: 1} - m_OnHover: - m_Background: {fileID: 11015, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 1, g: 1, b: 1, a: 1} - m_OnActive: - m_Background: {fileID: 11017, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 1, g: 1, b: 1, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 14 - m_Right: 0 - m_Top: 14 - m_Bottom: 0 - m_Margin: - m_Left: 4 - m_Right: 4 - m_Top: 4 - m_Bottom: 4 - m_Padding: - m_Left: 15 - m_Right: 0 - m_Top: 3 - m_Bottom: 0 - m_Overflow: - m_Left: -1 - m_Right: 0 - m_Top: -4 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 0 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_label: - m_Name: label - m_Normal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0.9, g: 0.9, b: 0.9, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Margin: - m_Left: 4 - m_Right: 4 - m_Top: 4 - m_Bottom: 4 - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 3 - m_Bottom: 3 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 1 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 0 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_textField: - m_Name: textfield - m_Normal: - m_Background: {fileID: 11024, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0.79999995, g: 0.79999995, b: 0.79999995, a: 1} - m_Hover: - m_Background: {fileID: 11026, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0.9, g: 0.9, b: 0.9, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 11026, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 1, g: 1, b: 1, a: 1} - m_OnNormal: - m_Background: {fileID: 11025, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 1, g: 1, b: 1, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 4 - m_Right: 4 - m_Top: 4 - m_Bottom: 4 - m_Margin: - m_Left: 4 - m_Right: 4 - m_Top: 4 - m_Bottom: 4 - m_Padding: - m_Left: 3 - m_Right: 3 - m_Top: 3 - m_Bottom: 3 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 0 - m_TextClipping: 1 - m_ImagePosition: 3 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 0 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_textArea: - m_Name: textarea - m_Normal: - m_Background: {fileID: 11024, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0.9019608, g: 0.9019608, b: 0.9019608, a: 1} - m_Hover: - m_Background: {fileID: 11026, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0.79999995, g: 0.79999995, b: 0.79999995, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 11025, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 1, g: 1, b: 1, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 4 - m_Right: 4 - m_Top: 4 - m_Bottom: 4 - m_Margin: - m_Left: 4 - m_Right: 4 - m_Top: 4 - m_Bottom: 4 - m_Padding: - m_Left: 3 - m_Right: 3 - m_Top: 3 - m_Bottom: 3 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 1 - m_RichText: 0 - m_TextClipping: 1 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 0 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_window: - m_Name: window - m_Normal: - m_Background: {fileID: 11023, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 1, g: 1, b: 1, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 11022, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 1, g: 1, b: 1, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 8 - m_Right: 8 - m_Top: 18 - m_Bottom: 8 - m_Margin: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Padding: - m_Left: 10 - m_Right: 10 - m_Top: 20 - m_Bottom: 10 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 1 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: -18} - m_FixedWidth: 0 - m_FixedHeight: 0 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_horizontalSlider: - m_Name: horizontalslider - m_Normal: - m_Background: {fileID: 11009, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 3 - m_Right: 3 - m_Top: 0 - m_Bottom: 0 - m_Margin: - m_Left: 4 - m_Right: 4 - m_Top: 4 - m_Bottom: 4 - m_Padding: - m_Left: -1 - m_Right: -1 - m_Top: 0 - m_Bottom: 0 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: -2 - m_Bottom: -3 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 2 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 12 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_horizontalSliderThumb: - m_Name: horizontalsliderthumb - m_Normal: - m_Background: {fileID: 11011, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Hover: - m_Background: {fileID: 11012, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 11010, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 4 - m_Right: 4 - m_Top: 0 - m_Bottom: 0 - m_Margin: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Padding: - m_Left: 7 - m_Right: 7 - m_Top: 0 - m_Bottom: 0 - m_Overflow: - m_Left: -1 - m_Right: -1 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 2 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 12 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_verticalSlider: - m_Name: verticalslider - m_Normal: - m_Background: {fileID: 11021, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 0 - m_Right: 0 - m_Top: 3 - m_Bottom: 3 - m_Margin: - m_Left: 4 - m_Right: 4 - m_Top: 4 - m_Bottom: 4 - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: -1 - m_Bottom: -1 - m_Overflow: - m_Left: -2 - m_Right: -3 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 0 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 12 - m_FixedHeight: 0 - m_StretchWidth: 0 - m_StretchHeight: 1 - m_verticalSliderThumb: - m_Name: verticalsliderthumb - m_Normal: - m_Background: {fileID: 11011, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Hover: - m_Background: {fileID: 11012, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 11010, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Margin: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 7 - m_Bottom: 7 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: -1 - m_Bottom: -1 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 12 - m_FixedHeight: 0 - m_StretchWidth: 0 - m_StretchHeight: 1 - m_horizontalScrollbar: - m_Name: horizontalscrollbar - m_Normal: - m_Background: {fileID: 11008, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 9 - m_Right: 9 - m_Top: 0 - m_Bottom: 0 - m_Margin: - m_Left: 4 - m_Right: 4 - m_Top: 1 - m_Bottom: 4 - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 2 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 15 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_horizontalScrollbarThumb: - m_Name: horizontalscrollbarthumb - m_Normal: - m_Background: {fileID: 11007, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 6 - m_Right: 6 - m_Top: 6 - m_Bottom: 6 - m_Margin: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Padding: - m_Left: 6 - m_Right: 6 - m_Top: 0 - m_Bottom: 0 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: -1 - m_Bottom: 1 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 13 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_horizontalScrollbarLeftButton: - m_Name: horizontalscrollbarleftbutton - m_Normal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Margin: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 0 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_horizontalScrollbarRightButton: - m_Name: horizontalscrollbarrightbutton - m_Normal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Margin: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 0 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_verticalScrollbar: - m_Name: verticalscrollbar - m_Normal: - m_Background: {fileID: 11020, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 0 - m_Right: 0 - m_Top: 9 - m_Bottom: 9 - m_Margin: - m_Left: 1 - m_Right: 4 - m_Top: 4 - m_Bottom: 4 - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 1 - m_Bottom: 1 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 15 - m_FixedHeight: 0 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_verticalScrollbarThumb: - m_Name: verticalscrollbarthumb - m_Normal: - m_Background: {fileID: 11019, guid: 0000000000000000e000000000000000, type: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 6 - m_Right: 6 - m_Top: 6 - m_Bottom: 6 - m_Margin: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 6 - m_Bottom: 6 - m_Overflow: - m_Left: -1 - m_Right: -1 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 2 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 15 - m_FixedHeight: 0 - m_StretchWidth: 0 - m_StretchHeight: 1 - m_verticalScrollbarUpButton: - m_Name: verticalscrollbarupbutton - m_Normal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Margin: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 0 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_verticalScrollbarDownButton: - m_Name: verticalscrollbardownbutton - m_Normal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Margin: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 0 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_ScrollView: - m_Name: scrollview - m_Normal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Margin: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 1 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 0 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_CustomStyles: - - m_Name: - m_Normal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Hover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Active: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Focused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnNormal: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnHover: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnActive: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_OnFocused: - m_Background: {fileID: 0} - m_ScaledBackgrounds: [] - m_TextColor: {r: 0, g: 0, b: 0, a: 1} - m_Border: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Margin: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Overflow: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_Font: {fileID: 0} - m_FontSize: 0 - m_FontStyle: 0 - m_Alignment: 0 - m_WordWrap: 0 - m_RichText: 1 - m_TextClipping: 0 - m_ImagePosition: 0 - m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 0 - m_FixedHeight: 0 - m_StretchWidth: 1 - m_StretchHeight: 0 - m_Settings: - m_DoubleClickSelectsWord: 1 - m_TripleClickSelectsLine: 1 - m_CursorColor: {r: 1, g: 1, b: 1, a: 1} - m_CursorFlashSpeed: -1 - m_SelectionColor: {r: 1, g: 0.38403907, b: 0, a: 0.7} diff --git a/Assets/Plugins/UniRx/Scripts/Notification.cs.meta b/Assets/Plugins/UniRx/Scripts/Notification.cs.meta index e4addd2..75ed5fa 100644 --- a/Assets/Plugins/UniRx/Scripts/Notification.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Notification.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 169d02559aa6b3e459fbae10f2acecd8 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Notifiers.meta b/Assets/Plugins/UniRx/Scripts/Notifiers.meta index 261322d..10b7079 100644 --- a/Assets/Plugins/UniRx/Scripts/Notifiers.meta +++ b/Assets/Plugins/UniRx/Scripts/Notifiers.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: 2223439371f910b40901d01f22f92481 folderAsset: yes -timeCreated: 1522374661 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/Notifiers/BooleanNotifier.cs.meta b/Assets/Plugins/UniRx/Scripts/Notifiers/BooleanNotifier.cs.meta index ce54772..b2064e0 100644 --- a/Assets/Plugins/UniRx/Scripts/Notifiers/BooleanNotifier.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Notifiers/BooleanNotifier.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 5ee30c0abdddd7241acbe24df0637678 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Notifiers/CountNotifier.cs.meta b/Assets/Plugins/UniRx/Scripts/Notifiers/CountNotifier.cs.meta index 6f0d334..706bb83 100644 --- a/Assets/Plugins/UniRx/Scripts/Notifiers/CountNotifier.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Notifiers/CountNotifier.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 503af1c1dc279164e83011be5110633e timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Notifiers/MessageBroker.cs.meta b/Assets/Plugins/UniRx/Scripts/Notifiers/MessageBroker.cs.meta index 9b5001e..a678ef5 100644 --- a/Assets/Plugins/UniRx/Scripts/Notifiers/MessageBroker.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Notifiers/MessageBroker.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9dc5e3c48d083d4418ab67287f050267 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Notifiers/ScheduledNotifier.cs.meta b/Assets/Plugins/UniRx/Scripts/Notifiers/ScheduledNotifier.cs.meta index 4fb6aa3..00a3217 100644 --- a/Assets/Plugins/UniRx/Scripts/Notifiers/ScheduledNotifier.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Notifiers/ScheduledNotifier.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e6f53242e655cbe4e889538216dc9e17 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Aggregate.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Aggregate.cs.meta index cb3a93d..a314e4a 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Aggregate.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Aggregate.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 82339dddb2a9f944785f1555b83d667c timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Awaiter.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Awaiter.cs.meta index b987ebf..50e9759 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Awaiter.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Awaiter.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: ec3ea3f22d061964c8f06eb9ea78ec42 timeCreated: 1475137543 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Binding.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Binding.cs.meta index f530f86..b1e96a3 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Binding.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Binding.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: bb11a562e64264645b76ad3a8d15d966 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Blocking.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Blocking.cs.meta index a6e5153..7851640 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Blocking.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Blocking.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4a05ec8aabbdba24388b7b2ae6c4a474 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Concatenate.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Concatenate.cs.meta index dc7265e..bc8b9d2 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Concatenate.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Concatenate.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 18c56bbfaaeedf445874f4246d42b509 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Concurrency.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Concurrency.cs.meta index 3b10a55..06cdb26 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Concurrency.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Concurrency.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a31d38ad13dc4644180647afc28c6045 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Conversions.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Conversions.cs.meta index 2d19473..e3ef7b7 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Conversions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Conversions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e32bd7bbf28014b4ab2873cc8de3dea9 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Creation.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Creation.cs.meta index ce5f14a..d8ffc64 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Creation.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Creation.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e63036d2dba75f64382beed512fd086c timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.ErrorHandling.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.ErrorHandling.cs.meta index 642b290..f78d001 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.ErrorHandling.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.ErrorHandling.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f40cab35efe24e6448ac8455bc7a4eb9 timeCreated: 1455373902 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Events.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Events.cs.meta index 1c9535f..396fc27 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Events.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Events.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e591aafff0492c94590cf9702f6c408f timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.FromAsync.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.FromAsync.cs.meta index af6816b..e40ab88 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.FromAsync.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.FromAsync.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 601f5bb7bb302a14cb46df717729b8c7 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Joins.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Joins.cs.meta index ef655ac..561c3c0 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Joins.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Joins.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: dd92425c6c6dec24e9e52677cbc36aa0 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Paging.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Paging.cs.meta index cadbdd0..6017170 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Paging.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Paging.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f4c9428bf00006d408fcfe4c514ee798 timeCreated: 1455373902 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Time.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Time.cs.meta index 559bc75..a0484a3 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Time.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Time.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7da89fcf95f5c364ca62bbb874005d32 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.cs.meta index 1446e1f..50ff0a6 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a2dd1c80d4559fd4ca9ef62f20d031ab timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observer.cs.meta b/Assets/Plugins/UniRx/Scripts/Observer.cs.meta index b7e528e..efe223b 100644 --- a/Assets/Plugins/UniRx/Scripts/Observer.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observer.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 57d25c3f6fa1d334e89c384393252b8a timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators.meta b/Assets/Plugins/UniRx/Scripts/Operators.meta index 979dee3..1fec0b6 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: d51c184ac8c7a7a47815d18038fc4600 folderAsset: yes -timeCreated: 1522374661 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Aggregate.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Aggregate.cs.meta index 8b0311d..1f2cf37 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Aggregate.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Aggregate.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f777fc54ecf275349a3f007e760705b3 timeCreated: 1455373902 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Amb.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Amb.cs.meta index 70893f5..62e2c86 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Amb.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Amb.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: ad1a22922a735ee479baf0e179648532 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/AsObservable.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/AsObservable.cs.meta index 3fe746b..409ea15 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/AsObservable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/AsObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9e4851fd48b2b42469d71b311254877b timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/AsSingleUnitObservable.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/AsSingleUnitObservable.cs.meta index d08c6ed..5d981eb 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/AsSingleUnitObservable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/AsSingleUnitObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3b5e05dba2d3aca4e9c3a6312bef8690 timeCreated: 1462636004 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/AsUnitObservable.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/AsUnitObservable.cs.meta index bbe2c91..14ea875 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/AsUnitObservable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/AsUnitObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 236f5f407bf92c949844fcaf450af450 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Buffer.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Buffer.cs.meta index e2006a5..b30149a 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Buffer.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Buffer.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4137aec9640d3ea41a740d677026aa8c timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Cast.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Cast.cs.meta index d1d27c2..87b7a43 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Cast.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Cast.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e70ae559c9b927742acbff91d50b3b22 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Catch.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Catch.cs.meta index 664ef44..c3259ae 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Catch.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Catch.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 404a684db151ca34f8258c6fb373db8d timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/CombineLatest.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/CombineLatest.cs.meta index 78b2946..be62b73 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/CombineLatest.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/CombineLatest.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 64910ffa78510ee48b3a395ee5b2cfe1 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Concat.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Concat.cs.meta index 3ac2145..ea2836f 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Concat.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Concat.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 740c2691a7e434f439abfdcac75ea809 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ContinueWith.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ContinueWith.cs.meta index f691d07..0b7c80f 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ContinueWith.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ContinueWith.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: bea59b3eb246d244a99183eeb7f3bad4 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Create.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Create.cs.meta index 33ab300..1bf20a9 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Create.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Create.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: cae9e62bf5eb3dc4e9d93cf6ff606052 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/DefaultIfEmpty.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/DefaultIfEmpty.cs.meta index 17fe003..736b984 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/DefaultIfEmpty.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/DefaultIfEmpty.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 551075cda284fbc489824d153743b1e6 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Defer.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Defer.cs.meta index ee6047f..681f93e 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Defer.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Defer.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 15ca418b98836d943864b1e8b82f6658 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Delay.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Delay.cs.meta index 67f9cb4..1563740 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Delay.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Delay.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2af9c507ce062994a904e4b5565b49c0 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/DelaySubscription.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/DelaySubscription.cs.meta index bb9dc06..3232eb3 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/DelaySubscription.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/DelaySubscription.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4f532fc776d5298439cb8f03d52e1211 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Dematerialize.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Dematerialize.cs.meta index 1a0cfc0..01c30f8 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Dematerialize.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Dematerialize.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 80682be7e41afb44581208534f226d38 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Distinct.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Distinct.cs.meta index 330e124..6bbb0bd 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Distinct.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Distinct.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 376a7ed430bff5c4b860af4d23ab6b79 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/DistinctUntilChanged.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/DistinctUntilChanged.cs.meta index e43b286..f26ca6f 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/DistinctUntilChanged.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/DistinctUntilChanged.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a09c4b58f60c22342871c30eaf589f6c timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Do.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Do.cs.meta index 3b5f603..e4162a9 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Do.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Do.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8f99ae8870195e34b8618451a95818e0 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Empty.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Empty.cs.meta index b6a8884..6625cb8 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Empty.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Empty.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9e9a7050a289d3a4aa17cba89e085135 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Finally.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Finally.cs.meta index d7ab893..772d478 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Finally.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Finally.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9ce919d8f2acf2b47a932e850e399d3a timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/First.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/First.cs.meta index c1e9944..a6c3f8e 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/First.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/First.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8e3093220aeb1d54faa3fca9fe0af6c0 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ForEachAsync.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ForEachAsync.cs.meta index 76086d0..3ca9296 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ForEachAsync.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ForEachAsync.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 5b66ecd2e5290bc4eb8c78a1ccc2d009 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/FromEvent.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/FromEvent.cs.meta index 5284fd9..97fdf21 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/FromEvent.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/FromEvent.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 05fcc5083e94e704ca8f059e4e535ffa timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/GroupBy.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/GroupBy.cs.meta index 1f2d951..1d7b46a 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/GroupBy.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/GroupBy.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7345fc4a6df05ca47ab89ec819bccde6 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/IgnoreElements.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/IgnoreElements.cs.meta index f36f8ce..f829b3c 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/IgnoreElements.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/IgnoreElements.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d6c8ca210619da74b92cbdb3e8c58127 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Last.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Last.cs.meta index 8165fba..1c33d43 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Last.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Last.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 696780c8759162d4b996683ec13d7e0b timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Materialize.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Materialize.cs.meta index a949074..aa04020 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Materialize.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Materialize.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 09d3ba9e6d5fe4643bbf0df943652908 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Merge.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Merge.cs.meta index 936c75d..50d7fca 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Merge.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Merge.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 94158fab525468d4e896a62f633257e6 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Never.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Never.cs.meta index 50371e6..8e92ea5 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Never.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Never.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: b5db8d5c73883214abaf3715002da256 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ObserveOn.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ObserveOn.cs.meta index 684cfc2..a4dde12 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ObserveOn.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ObserveOn.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 39df784f492c7404286d05b09a840705 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/OfType.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/OfType.cs.meta index 3d89902..4cb3e09 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/OfType.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/OfType.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 981fd4bf7704404459a0deed254a03e5 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/OperatorObservableBase.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/OperatorObservableBase.cs.meta index 25d2cee..385c56f 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/OperatorObservableBase.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/OperatorObservableBase.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1b94a1a0ae5d509488c6242454216bdb timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/OperatorObserverBase.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/OperatorObserverBase.cs.meta index 9854d9d..a58903d 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/OperatorObserverBase.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/OperatorObserverBase.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 258901a4513be8f4a8bfcca91e70bb12 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/PairWise.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/PairWise.cs.meta index 76d9aa3..17b6aa0 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/PairWise.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/PairWise.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f66e4871304e6e74d8548d597457e53c timeCreated: 1455373902 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Range.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Range.cs.meta index 39c12d8..f49b0a7 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Range.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Range.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2249fbe589c8d3042ac201c1ab4be76f timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/RefCount.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/RefCount.cs.meta index 9343721..66a6675 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/RefCount.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/RefCount.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 17a77b422aa699d4d8cfbf6de804d238 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Repeat.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Repeat.cs.meta index 345d90a..6e484c5 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Repeat.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Repeat.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 63930706f2ea6e847866fc6d914b0d2e timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/RepeatSafe.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/RepeatSafe.cs.meta index b9b4318..85c808c 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/RepeatSafe.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/RepeatSafe.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 6458fa5124443dc4bb95ad3d0b743934 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Return.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Return.cs.meta index 16d6217..df54f05 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Return.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Return.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 25648117feeec6043bd39468bfab62b7 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Sample.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Sample.cs.meta index f727436..dfdce6c 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Sample.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Sample.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 414e918f6a4dfc549b2a8c916a6325e1 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Scan.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Scan.cs.meta index 47c6262..87a736e 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Scan.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Scan.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 461fecd0ef4d48c4d95aae68c2ca2c1c timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Select.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Select.cs.meta index ccf8119..9a78495 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Select.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Select.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 997e36ad7b02b804ea1f03d05e60bed5 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/SelectMany.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/SelectMany.cs.meta index 298569f..35bc2f6 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/SelectMany.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/SelectMany.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 6496e8557f6066e4380c32935b6f37c3 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/SelectWhere.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/SelectWhere.cs.meta index 5f8a882..e6f2cac 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/SelectWhere.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/SelectWhere.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 6a7561d10967d6b4d9c2a67ffc3b9d85 timeCreated: 1468748731 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Single.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Single.cs.meta index 4e94dbd..88c862f 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Single.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Single.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9a50aee929f403f4ea076fc11f71fc53 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Skip.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Skip.cs.meta index 235a4c2..02833c7 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Skip.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Skip.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1ffcb45c02e14e94bb37c6513b04bb7c timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/SkipUntil.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/SkipUntil.cs.meta index 963abf3..0e639d2 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/SkipUntil.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/SkipUntil.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 52314487e375f3d44a49bc5ceb90adab timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/SkipWhile.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/SkipWhile.cs.meta index eaf6409..113e94b 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/SkipWhile.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/SkipWhile.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4bc7a1e818d05654694d51e883739cca timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Start.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Start.cs.meta index 3efa698..9c42432 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Start.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Start.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2b99cac67f8c387439619e01a480c465 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/StartWith.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/StartWith.cs.meta index c17e3a9..498a564 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/StartWith.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/StartWith.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 05df6719453543e458dc3e0d29ac7fa8 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/SubscribeOn.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/SubscribeOn.cs.meta index f039a2e..cf05344 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/SubscribeOn.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/SubscribeOn.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: bff34f363b1797c4396815b5b3a4be1c timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Switch.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Switch.cs.meta index fe3ef6b..b68dd17 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Switch.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Switch.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 5e16cdc638ec3bf41bbd380b75991734 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Synchronize.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Synchronize.cs.meta index 73cd1e5..c194498 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Synchronize.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Synchronize.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 31ddcb8477b384b4c9867568f6dc8359 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/SynchronizedObserver.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/SynchronizedObserver.cs.meta index 26e7ec0..abbaeeb 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/SynchronizedObserver.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/SynchronizedObserver.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4fd465af6ee05a64f9115b45b58360b7 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Take.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Take.cs.meta index a887e33..bc171a0 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Take.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Take.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 5275fc8bb6611984781d8ccd56b9b572 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/TakeLast.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/TakeLast.cs.meta index 50d31bb..25a0927 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/TakeLast.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/TakeLast.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8ea2ac59577a3214f9fb66ccc62f2ffd timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/TakeUntil.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/TakeUntil.cs.meta index eb6f28f..e81affb 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/TakeUntil.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/TakeUntil.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 163e3eab299b735418c94e634fecd811 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/TakeWhile.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/TakeWhile.cs.meta index 51f7197..beb13c9 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/TakeWhile.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/TakeWhile.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d6f2da76023d9734ebb4ed1883fda2bc timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Throttle.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Throttle.cs.meta index 379ddf3..9e6e728 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Throttle.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Throttle.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: dc296a61927394b4b908b385087f23d0 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ThrottleFirst.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ThrottleFirst.cs.meta index ba66ab0..0fe0524 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ThrottleFirst.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ThrottleFirst.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 32b6a6efbab897b41a055d830a4d9755 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Throw.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Throw.cs.meta index 6c275d5..5a6be2e 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Throw.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Throw.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1e5623719e9b1f1418aa67a63abed4cc timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/TimeInterval.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/TimeInterval.cs.meta index 035d753..ab4108c 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/TimeInterval.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/TimeInterval.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 065e40ebd4bd4a848b58a7a90dac881d timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Timeout.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Timeout.cs.meta index 4ec24d2..c3c77d5 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Timeout.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Timeout.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a22cd4a86f62fc64384dddb043530703 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Timer.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Timer.cs.meta index f9ebcc0..7f55fe4 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Timer.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Timer.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 6be220be1da39e14ea87b366c149953e timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Timestamp.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Timestamp.cs.meta index dac70a0..1313978 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Timestamp.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Timestamp.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d9ec806fec477b243a812e7f609a4453 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ToArray.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ToArray.cs.meta index 0c1405d..f2da5ba 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ToArray.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ToArray.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 38d1f7c869353b542af469b0e3fae89a timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ToList.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ToList.cs.meta index 8290365..586772b 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ToList.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ToList.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: cee1b9300a644c9458346c1f80f64197 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ToObservable.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ToObservable.cs.meta index 78a4d0c..7714ed0 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ToObservable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ToObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7cd3ae084c8ca754f9aceca2e18c3af9 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Wait.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Wait.cs.meta index e3979a3..5291736 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Wait.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Wait.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: ea55c5647aa075b4f894dd37abf5e469 timeCreated: 1455373902 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/WhenAll.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/WhenAll.cs.meta index f5e559a..4d47c87 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/WhenAll.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/WhenAll.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 0af8ada83db8f8a408ee6e9aa994fbbd timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Where.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Where.cs.meta index 9e53076..b440e73 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Where.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Where.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a035699dbe9572548afa47c460bad078 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/WhereSelect.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/WhereSelect.cs.meta index 328b2b9..55d0c46 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/WhereSelect.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/WhereSelect.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f7453a184d42aa34c854977496f381b9 timeCreated: 1468743755 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/WithLatestFrom.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/WithLatestFrom.cs.meta index be6f9f6..f94c77c 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/WithLatestFrom.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/WithLatestFrom.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: eb0bc7125d343ed45bb7e36ff1a53362 timeCreated: 1455373902 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Zip.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Zip.cs.meta index b5c1220..f394fdf 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Zip.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Zip.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4e92e25f9bb221d478d4af5bcd8b8a2c timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ZipLatest.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ZipLatest.cs.meta index e050ab9..725334d 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ZipLatest.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ZipLatest.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f84ea50040d682c43811d1d98ae7fec8 timeCreated: 1455373908 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Pair.cs.meta b/Assets/Plugins/UniRx/Scripts/Pair.cs.meta index d7c24ce..16e1017 100644 --- a/Assets/Plugins/UniRx/Scripts/Pair.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Pair.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7947c520dfd9de94bb381e45dc105752 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Schedulers.meta b/Assets/Plugins/UniRx/Scripts/Schedulers.meta index 3ac35d8..984bc16 100644 --- a/Assets/Plugins/UniRx/Scripts/Schedulers.meta +++ b/Assets/Plugins/UniRx/Scripts/Schedulers.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: db7122db40f3d67459767aec6aaf271c folderAsset: yes -timeCreated: 1522374661 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/Schedulers/CurrentThreadScheduler.cs.meta b/Assets/Plugins/UniRx/Scripts/Schedulers/CurrentThreadScheduler.cs.meta index e131095..b8bc6a0 100644 --- a/Assets/Plugins/UniRx/Scripts/Schedulers/CurrentThreadScheduler.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Schedulers/CurrentThreadScheduler.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1d547b5ee71b7284db1fecfcdfa59fac timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Schedulers/IScheduler.cs.meta b/Assets/Plugins/UniRx/Scripts/Schedulers/IScheduler.cs.meta index ae2adfc..5551cf8 100644 --- a/Assets/Plugins/UniRx/Scripts/Schedulers/IScheduler.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Schedulers/IScheduler.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7409b202c20d3894b9677c8f2a27f3aa timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Schedulers/ImmediateScheduler.cs.meta b/Assets/Plugins/UniRx/Scripts/Schedulers/ImmediateScheduler.cs.meta index d2ef97f..8cad6fe 100644 --- a/Assets/Plugins/UniRx/Scripts/Schedulers/ImmediateScheduler.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Schedulers/ImmediateScheduler.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 87be5fca34f9b44428b7fb1ce9147860 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Schedulers/Scheduler.cs.meta b/Assets/Plugins/UniRx/Scripts/Schedulers/Scheduler.cs.meta index 1d2d162..0fabcf2 100644 --- a/Assets/Plugins/UniRx/Scripts/Schedulers/Scheduler.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Schedulers/Scheduler.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: bfeb53a7ea29f714798ba6bb3bd70ba4 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Schedulers/ThreadPoolScheduler.cs.meta b/Assets/Plugins/UniRx/Scripts/Schedulers/ThreadPoolScheduler.cs.meta index 41a33c3..f748fd1 100644 --- a/Assets/Plugins/UniRx/Scripts/Schedulers/ThreadPoolScheduler.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Schedulers/ThreadPoolScheduler.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f8189a60f4619be489df10eca6a78fbb timeCreated: 1455373902 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Subjects.meta b/Assets/Plugins/UniRx/Scripts/Subjects.meta index bf51a19..8aa7801 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: a498f16648e620f4099a0add31f6af8d folderAsset: yes -timeCreated: 1522374661 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/Subjects/AsyncSubject.cs.meta b/Assets/Plugins/UniRx/Scripts/Subjects/AsyncSubject.cs.meta index 77e6ed2..b994cf8 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects/AsyncSubject.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects/AsyncSubject.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 137cd44250b484d4ba2390d510f8423f timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Subjects/BehaviorSubject.cs.meta b/Assets/Plugins/UniRx/Scripts/Subjects/BehaviorSubject.cs.meta index 40ab73f..b679d0d 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects/BehaviorSubject.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects/BehaviorSubject.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2fa461d2fc0c4ec4999e0b9aff16dd47 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Subjects/ConnectableObservable.cs.meta b/Assets/Plugins/UniRx/Scripts/Subjects/ConnectableObservable.cs.meta index c6a0404..d407f17 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects/ConnectableObservable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects/ConnectableObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8de419b467eded246bc4fc5e70859f73 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Subjects/ISubject.cs.meta b/Assets/Plugins/UniRx/Scripts/Subjects/ISubject.cs.meta index bad4695..e0c92e5 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects/ISubject.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects/ISubject.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e9dbcd28e4f3965408744e0ee03b7bc8 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Subjects/ReplaySubject.cs.meta b/Assets/Plugins/UniRx/Scripts/Subjects/ReplaySubject.cs.meta index 057102a..5275283 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects/ReplaySubject.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects/ReplaySubject.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d9b0c2f29645e1f468259893bf9afb68 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Subjects/Subject.cs.meta b/Assets/Plugins/UniRx/Scripts/Subjects/Subject.cs.meta index cb6358f..4769776 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects/Subject.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects/Subject.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d5fdc90caca9cbe4b9cd9c3fae81e7f6 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Subjects/SubjectExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Subjects/SubjectExtensions.cs.meta index ec21501..9377a3d 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects/SubjectExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects/SubjectExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 359bf19588606a14fb0edc6efa97deaf timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/System.meta b/Assets/Plugins/UniRx/Scripts/System.meta index 9bf1c3e..9ee2ad7 100644 --- a/Assets/Plugins/UniRx/Scripts/System.meta +++ b/Assets/Plugins/UniRx/Scripts/System.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: a9082dba9e572004eacba691cbc4568a folderAsset: yes -timeCreated: 1522374661 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/System/IObservable.cs.meta b/Assets/Plugins/UniRx/Scripts/System/IObservable.cs.meta index f543801..162258a 100644 --- a/Assets/Plugins/UniRx/Scripts/System/IObservable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/System/IObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9703f7aad3c6b334badd37c1b41d0d8f timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/System/IObserver.cs.meta b/Assets/Plugins/UniRx/Scripts/System/IObserver.cs.meta index 82af2d2..11e3ec2 100644 --- a/Assets/Plugins/UniRx/Scripts/System/IObserver.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/System/IObserver.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1fc7a9cec9d3b644da7dbcf18ea16270 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/System/IOptimizedObservable.cs.meta b/Assets/Plugins/UniRx/Scripts/System/IOptimizedObservable.cs.meta index c3dfcfd..0bb6cbf 100644 --- a/Assets/Plugins/UniRx/Scripts/System/IOptimizedObservable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/System/IOptimizedObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 5a2d3a7c73260e14a875d62586ae28f9 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/System/IProgress.cs.meta b/Assets/Plugins/UniRx/Scripts/System/IProgress.cs.meta index 7f86694..8432314 100644 --- a/Assets/Plugins/UniRx/Scripts/System/IProgress.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/System/IProgress.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a38a024b6babf8d48b7e32f2f8fb8686 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/System/Tuple.cs.meta b/Assets/Plugins/UniRx/Scripts/System/Tuple.cs.meta index 3ecf72a..376a26d 100644 --- a/Assets/Plugins/UniRx/Scripts/System/Tuple.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/System/Tuple.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: be811500a5640704b92de622c9202d48 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/System/Unit.cs.meta b/Assets/Plugins/UniRx/Scripts/System/Unit.cs.meta index 5eda932..1c9fe58 100644 --- a/Assets/Plugins/UniRx/Scripts/System/Unit.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/System/Unit.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 14f6907c0ae17e64c8fc34f08c3038a4 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Tasks.meta b/Assets/Plugins/UniRx/Scripts/Tasks.meta index ca5f3e8..2ad881d 100644 --- a/Assets/Plugins/UniRx/Scripts/Tasks.meta +++ b/Assets/Plugins/UniRx/Scripts/Tasks.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: 5e4e30d9ac0617842a01698194f50290 folderAsset: yes -timeCreated: 1522374661 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/Tasks/TaskObservableExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Tasks/TaskObservableExtensions.cs.meta index 406e68c..8156ead 100644 --- a/Assets/Plugins/UniRx/Scripts/Tasks/TaskObservableExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Tasks/TaskObservableExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d4f80d45cec56574e990cc840d1ac16b timeCreated: 1475139656 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Tasks/UniTaskObservableExtensions.cs b/Assets/Plugins/UniRx/Scripts/Tasks/UniTaskObservableExtensions.cs index 0edc9be..d937dc9 100644 --- a/Assets/Plugins/UniRx/Scripts/Tasks/UniTaskObservableExtensions.cs +++ b/Assets/Plugins/UniRx/Scripts/Tasks/UniTaskObservableExtensions.cs @@ -1,4 +1,4 @@ -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System; @@ -116,7 +116,7 @@ public ToUniTaskObserver(UniTaskCompletionSource promise, SingleAssignmentDis if (this.cancellationToken.CanBeCanceled) { - this.registration = this.cancellationToken.Register(callback, this, false); + this.registration = this.cancellationToken.RegisterWithoutCaptureExecutionContext(callback, this); } } @@ -186,7 +186,7 @@ public FirstValueToUniTaskObserver(UniTaskCompletionSource promise, SingleAss if (this.cancellationToken.CanBeCanceled) { - this.registration = this.cancellationToken.Register(callback, this, false); + this.registration = this.cancellationToken.RegisterWithoutCaptureExecutionContext(callback, this); } } diff --git a/Assets/Plugins/UniRx/Scripts/TimeInterval.cs.meta b/Assets/Plugins/UniRx/Scripts/TimeInterval.cs.meta index 259eba8..e7329f1 100644 --- a/Assets/Plugins/UniRx/Scripts/TimeInterval.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/TimeInterval.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: dd48622e783cadc47af9a6b456ac8438 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Timestamped.cs.meta b/Assets/Plugins/UniRx/Scripts/Timestamped.cs.meta index 1319fe8..6eb3903 100644 --- a/Assets/Plugins/UniRx/Scripts/Timestamped.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Timestamped.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: c1d908b82d0e2b4489d3351a484e5eae timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge.meta index 07fb552..f32a923 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: 33caec847c56d5b47ae6ba89d27a18a4 folderAsset: yes -timeCreated: 1522374661 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AotSafeExtensions.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AotSafeExtensions.cs deleted file mode 100644 index a4e372a..0000000 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AotSafeExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; - -namespace UniRx -{ - public static class AotSafeExtensions - { - public static IEnumerable AsSafeEnumerable(this IEnumerable source) - { - var e = ((IEnumerable)source).GetEnumerator(); - using (e as IDisposable) - { - while (e.MoveNext()) - { - yield return (T)e.Current; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AotSafeExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AotSafeExtensions.cs.meta deleted file mode 100644 index bac65ab..0000000 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AotSafeExtensions.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b54afb590b8d9f149aac39f480c8d4c0 -timeCreated: 1455373900 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AsyncOperationExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AsyncOperationExtensions.cs.meta index 1e33df4..d261ab7 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AsyncOperationExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AsyncOperationExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 245d77a29b1ece34e96bfc80f8c825d8 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CancellationToken.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CancellationToken.cs.meta index b376a5a..ebefcbc 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CancellationToken.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CancellationToken.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e02a1bf45f8861048a6014cf7eab1825 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CoroutineAsyncBridge.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CoroutineAsyncBridge.cs index a99590b..c2d8ee8 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CoroutineAsyncBridge.cs +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CoroutineAsyncBridge.cs @@ -91,14 +91,22 @@ public static CoroutineAsyncBridge GetAwaiter(this Coroutine coroutine) return CoroutineAsyncBridge.Start(coroutine); } -#if !CSHARP_7_OR_LATER +#if !(CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))) // should use UniRx.Async in C# 7.0 +#if UNITY_2018_3_OR_NEWER +#pragma warning disable CS0618 +#endif public static CoroutineAsyncBridge GetAwaiter(this WWW www) { return CoroutineAsyncBridge.Start(www); } +#if UNITY_2018_3_OR_NEWER +#pragma warning restore CS0618 +#endif + + public static CoroutineAsyncBridge GetAwaiter(this AsyncOperation asyncOperation) { diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CoroutineAsyncBridge.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CoroutineAsyncBridge.cs.meta index 0c245dd..2efbac5 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CoroutineAsyncBridge.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CoroutineAsyncBridge.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 93ca3de3810199947871ab4a77014fa3 timeCreated: 1475193276 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics.meta index e9668c1..cf18141 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: a2e9fc22f60bc9d49bd3e964610fa541 folderAsset: yes -timeCreated: 1522374662 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntry.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntry.cs.meta index 6fb7092..7669e9f 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntry.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntry.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 53917e87e91c0e4449402e5d85a04765 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntryExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntryExtensions.cs.meta index f71269d..f4303f0 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntryExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntryExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8706ef5a13e53ec46b4848a7eec5e826 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/Logger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/Logger.cs.meta index e8e4fd7..348f963 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/Logger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/Logger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f0ecf366503cb0644bdd90934d24da62 timeCreated: 1455373902 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableDebugExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableDebugExtensions.cs.meta index 4d5f179..9968a5d 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableDebugExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableDebugExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: b43f948e095c3e749a0506709be90d68 timeCreated: 1468662620 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableLogger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableLogger.cs.meta index a2e274e..84b786e 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableLogger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableLogger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 063f79dc45f902c459f0955d27b445d7 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/UnityDebugSink.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/UnityDebugSink.cs.meta index c3c63fa..b1db84b 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/UnityDebugSink.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/UnityDebugSink.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 882166c30c3bff841b1e12d62c392e02 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/FrameInterval.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/FrameInterval.cs.meta index 25c6007..128c3a6 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/FrameInterval.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/FrameInterval.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 266d1e44d71e7774c9abc5b23773e3f1 timeCreated: 1467771656 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectableReactiveProperty.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectableReactiveProperty.cs.meta index e6aee10..968f323 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectableReactiveProperty.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectableReactiveProperty.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 13c690f353ea23141aca4090d28aaa9c timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectorDisplayDrawer.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectorDisplayDrawer.cs.meta index 9ac054c..1388fb4 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectorDisplayDrawer.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectorDisplayDrawer.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 6180f9fd2198dee44ae7f4a617529ffa timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LazyTask.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LazyTask.cs deleted file mode 100644 index 7f753b2..0000000 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LazyTask.cs +++ /dev/null @@ -1,143 +0,0 @@ -// LazyTask is only for before MONO_BLEEDING_EDGE -#if !(NET_4_6) - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; // in future, should remove LINQ -using System.Threading; -using UnityEngine; - -namespace UniRx -{ - public abstract class LazyTask - { - public enum TaskStatus - { - WaitingToRun, - Running, - Completed, - Canceled, - Faulted - } - - public TaskStatus Status { get; protected set; } - - protected readonly BooleanDisposable cancellation = new BooleanDisposable(); - - public abstract Coroutine Start(); - - public void Cancel() - { - if (Status == TaskStatus.WaitingToRun || Status == TaskStatus.Running) - { - Status = TaskStatus.Canceled; - cancellation.Dispose(); - } - } - - public static LazyTask FromResult(T value) - { - return LazyTask.FromResult(value); - } - - - public static Coroutine WhenAll(params LazyTask[] tasks) - { - return WhenAll(tasks.AsEnumerable()); - } - - public static Coroutine WhenAll(IEnumerable tasks) - { - var coroutines = tasks.Select(x => x.Start()).ToArray(); - - return MainThreadDispatcher.StartCoroutine(WhenAllCore(coroutines)); - } - - static IEnumerator WhenAllCore(Coroutine[] coroutines) - { - foreach (var item in coroutines) - { - // wait sequential, but all coroutine is already started, it's parallel - yield return item; - } - } - } - - public class LazyTask : LazyTask - { - readonly IObservable source; - - T result; - public T Result - { - get - { - if (Status != TaskStatus.Completed) throw new InvalidOperationException("Task is not completed"); - return result; - } - } - - /// - /// If faulted stock error. If completed or canceld, returns null. - /// - public Exception Exception { get; private set; } - - public LazyTask(IObservable source) - { - this.source = source; - this.Status = TaskStatus.WaitingToRun; - } - - public override Coroutine Start() - { - if (Status != TaskStatus.WaitingToRun) throw new InvalidOperationException("Task already started"); - - Status = TaskStatus.Running; - - var coroutine = source.StartAsCoroutine( - onResult: x => { result = x; Status = TaskStatus.Completed; }, - onError: ex => { Exception = ex; Status = TaskStatus.Faulted; }, - cancel: new CancellationToken(cancellation)); - - return coroutine; - } - - public override string ToString() - { - switch (Status) - { - case TaskStatus.WaitingToRun: - return "Status:WaitingToRun"; - case TaskStatus.Running: - return "Status:Running"; - case TaskStatus.Completed: - return "Status:Completed, Result:" + Result.ToString(); - case TaskStatus.Canceled: - return "Status:Canceled"; - case TaskStatus.Faulted: - return "Status:Faulted, Result:" + Result.ToString(); - default: - return ""; - } - } - - public static LazyTask FromResult(T value) - { - var t = new LazyTask(null); - t.result = value; ; - t.Status = TaskStatus.Completed; - return t; - } - } - - public static class LazyTaskExtensions - { - public static LazyTask ToLazyTask(this IObservable source) - { - return new LazyTask(source); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LifetimeDisposableExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LifetimeDisposableExtensions.cs.meta index 1491bd1..a774199 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LifetimeDisposableExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LifetimeDisposableExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a7474e4acdc541340a1f566b2df46355 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs index bab54f1..91cc8c4 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs @@ -117,12 +117,18 @@ void ConsumeEnumerator(IEnumerator routine) } var type = current.GetType(); +#if UNITY_2018_3_OR_NEWER +#pragma warning disable CS0618 +#endif if (type == typeof(WWW)) { var www = (WWW)current; editorQueueWorker.Enqueue(_ => ConsumeEnumerator(UnwrapWaitWWW(www, routine)), null); return; } +#if UNITY_2018_3_OR_NEWER +#pragma warning restore CS0618 +#endif else if (type == typeof(AsyncOperation)) { var asyncOperation = (AsyncOperation)current; @@ -156,6 +162,9 @@ void ConsumeEnumerator(IEnumerator routine) } } +#if UNITY_2018_3_OR_NEWER +#pragma warning disable CS0618 +#endif IEnumerator UnwrapWaitWWW(WWW www, IEnumerator continuation) { while (!www.isDone) @@ -164,6 +173,9 @@ IEnumerator UnwrapWaitWWW(WWW www, IEnumerator continuation) } ConsumeEnumerator(continuation); } +#if UNITY_2018_3_OR_NEWER +#pragma warning restore CS0618 +#endif IEnumerator UnwrapWaitAsyncOperation(AsyncOperation asyncOperation, IEnumerator continuation) { diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs.meta index 0825892..9db2ce3 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: c3cd207057515c4438a31a6a7b548fe7 timeCreated: 1465903910 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadScheduler.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadScheduler.cs.meta index 639fdcf..64bd220 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadScheduler.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadScheduler.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f141c5dc72b97084a85631367a946ee8 timeCreated: 1455373902 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Observable.Unity.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Observable.Unity.cs index c1d498c..9090a6f 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Observable.Unity.cs +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Observable.Unity.cs @@ -229,7 +229,13 @@ public static partial class Observable { readonly static HashSet YieldInstructionTypes = new HashSet { + #if UNITY_2018_3_OR_NEWER +#pragma warning disable CS0618 +#endif typeof(WWW), + #if UNITY_2018_3_OR_NEWER +#pragma warning restore CS0618 +#endif typeof(WaitForEndOfFrame), typeof(WaitForFixedUpdate), typeof(WaitForSeconds), diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Observable.Unity.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Observable.Unity.cs.meta index a5cabe6..e78c0a2 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Observable.Unity.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Observable.Unity.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: c6ef0a186b9ceaf41af7f2a9f4006216 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableMonoBehaviour.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableMonoBehaviour.cs deleted file mode 100644 index 4ec5057..0000000 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableMonoBehaviour.cs +++ /dev/null @@ -1,885 +0,0 @@ -#if !UNITY_5_5_OR_NEWER - -using System; -using UnityEngine; - -namespace UniRx -{ - /// - /// Note: TypedMonoBehaviour and ObservableMonoBehaviour cause some performance issues. - /// This is legacy interface. - /// I recommend use ObservableTriggers(UniRx.Triggers) instead. - /// More information, see github page. - /// - [Obsolete("ObservableMonoBehaviour is legacy component. use triggers instead")] - public class ObservableMonoBehaviour : TypedMonoBehaviour - { - bool calledAwake = false; - Subject awake; - - /// Awake is called when the script instance is being loaded. - public override void Awake() - { - calledAwake = true; - if (awake != null) { awake.OnNext(Unit.Default); awake.OnCompleted(); } - } - - /// Awake is called when the script instance is being loaded. - public IObservable AwakeAsObservable() - { - if (calledAwake) return Observable.Return(Unit.Default); - return awake ?? (awake = new Subject()); - } - - Subject fixedUpdate; - - /// This function is called every fixed framerate frame, if the MonoBehaviour is enabled. - public override void FixedUpdate() - { - if (fixedUpdate != null) fixedUpdate.OnNext(Unit.Default); - } - - /// This function is called every fixed framerate frame, if the MonoBehaviour is enabled. - public IObservable FixedUpdateAsObservable() - { - return fixedUpdate ?? (fixedUpdate = new Subject()); - } - - Subject lateUpdate; - - /// LateUpdate is called every frame, if the Behaviour is enabled. - public override void LateUpdate() - { - if (lateUpdate != null) lateUpdate.OnNext(Unit.Default); - } - - /// LateUpdate is called every frame, if the Behaviour is enabled. - public IObservable LateUpdateAsObservable() - { - return lateUpdate ?? (lateUpdate = new Subject()); - } - - Subject onAnimatorIK; - - /// Callback for setting up animation IK (inverse kinematics). - public override void OnAnimatorIK(int layerIndex) - { - if (onAnimatorIK != null) onAnimatorIK.OnNext(layerIndex); - } - - /// Callback for setting up animation IK (inverse kinematics). - public IObservable OnAnimatorIKAsObservable() - { - return onAnimatorIK ?? (onAnimatorIK = new Subject()); - } - - Subject onAnimatorMove; - - /// Callback for processing animation movements for modifying root motion. - public override void OnAnimatorMove() - { - if (onAnimatorMove != null) onAnimatorMove.OnNext(Unit.Default); - } - - /// Callback for processing animation movements for modifying root motion. - public IObservable OnAnimatorMoveAsObservable() - { - return onAnimatorMove ?? (onAnimatorMove = new Subject()); - } - - Subject onApplicationFocus; - - /// Sent to all game objects when the player gets or loses focus. - public override void OnApplicationFocus(bool focus) - { - if (onApplicationFocus != null) onApplicationFocus.OnNext(focus); - } - - /// Sent to all game objects when the player gets or loses focus. - public IObservable OnApplicationFocusAsObservable() - { - return onApplicationFocus ?? (onApplicationFocus = new Subject()); - } - - Subject onApplicationPause; - - /// Sent to all game objects when the player pauses. - public override void OnApplicationPause(bool pause) - { - if (onApplicationPause != null) onApplicationPause.OnNext(pause); - } - - /// Sent to all game objects when the player pauses. - public IObservable OnApplicationPauseAsObservable() - { - return onApplicationPause ?? (onApplicationPause = new Subject()); - } - - Subject onApplicationQuit; - - /// Sent to all game objects before the application is quit. - public override void OnApplicationQuit() - { - if (onApplicationQuit != null) onApplicationQuit.OnNext(Unit.Default); - } - - /// Sent to all game objects before the application is quit. - public IObservable OnApplicationQuitAsObservable() - { - return onApplicationQuit ?? (onApplicationQuit = new Subject()); - } - - Subject> onAudioFilterRead; - - /// If OnAudioFilterRead is implemented, Unity will insert a custom filter into the audio DSP chain. - public override void OnAudioFilterRead(float[] data, int channels) - { - if (onAudioFilterRead != null) onAudioFilterRead.OnNext(Tuple.Create(data, channels)); - } - - /// If OnAudioFilterRead is implemented, Unity will insert a custom filter into the audio DSP chain. - public IObservable> OnAudioFilterReadAsObservable() - { - return onAudioFilterRead ?? (onAudioFilterRead = new Subject>()); - } - - Subject onBecameInvisible; - - /// OnBecameInvisible is called when the renderer is no longer visible by any camera. - public override void OnBecameInvisible() - { - if (onBecameInvisible != null) onBecameInvisible.OnNext(Unit.Default); - } - - /// OnBecameInvisible is called when the renderer is no longer visible by any camera. - public IObservable OnBecameInvisibleAsObservable() - { - return onBecameInvisible ?? (onBecameInvisible = new Subject()); - } - - Subject onBecameVisible; - - /// OnBecameVisible is called when the renderer became visible by any camera. - public override void OnBecameVisible() - { - if (onBecameVisible != null) onBecameVisible.OnNext(Unit.Default); - } - - /// OnBecameVisible is called when the renderer became visible by any camera. - public IObservable OnBecameVisibleAsObservable() - { - return onBecameVisible ?? (onBecameVisible = new Subject()); - } - - Subject onCollisionEnter; - - /// OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider. - public override void OnCollisionEnter(Collision collision) - { - if (onCollisionEnter != null) onCollisionEnter.OnNext(collision); - } - - /// OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider. - public IObservable OnCollisionEnterAsObservable() - { - return onCollisionEnter ?? (onCollisionEnter = new Subject()); - } - - Subject onCollisionEnter2D; - - /// Sent when an incoming collider makes contact with this object's collider (2D physics only). - public override void OnCollisionEnter2D(Collision2D coll) - { - if (onCollisionEnter2D != null) onCollisionEnter2D.OnNext(coll); - } - - /// Sent when an incoming collider makes contact with this object's collider (2D physics only). - public IObservable OnCollisionEnter2DAsObservable() - { - return onCollisionEnter2D ?? (onCollisionEnter2D = new Subject()); - } - - Subject onCollisionExit; - - /// OnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider. - public override void OnCollisionExit(Collision collisionInfo) - { - if (onCollisionExit != null) onCollisionExit.OnNext(collisionInfo); - } - - /// OnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider. - public IObservable OnCollisionExitAsObservable() - { - return onCollisionExit ?? (onCollisionExit = new Subject()); - } - - Subject onCollisionExit2D; - - /// Sent when a collider on another object stops touching this object's collider (2D physics only). - public override void OnCollisionExit2D(Collision2D coll) - { - if (onCollisionExit2D != null) onCollisionExit2D.OnNext(coll); - } - - /// Sent when a collider on another object stops touching this object's collider (2D physics only). - public IObservable OnCollisionExit2DAsObservable() - { - return onCollisionExit2D ?? (onCollisionExit2D = new Subject()); - } - - Subject onCollisionStay; - - /// OnCollisionStay is called once per frame for every collider/rigidbody that is touching rigidbody/collider. - public override void OnCollisionStay(Collision collisionInfo) - { - if (onCollisionStay != null) onCollisionStay.OnNext(collisionInfo); - } - - /// OnCollisionStay is called once per frame for every collider/rigidbody that is touching rigidbody/collider. - public IObservable OnCollisionStayAsObservable() - { - return onCollisionStay ?? (onCollisionStay = new Subject()); - } - - Subject onCollisionStay2D; - - /// Sent each frame where a collider on another object is touching this object's collider (2D physics only). - public override void OnCollisionStay2D(Collision2D coll) - { - if (onCollisionStay2D != null) onCollisionStay2D.OnNext(coll); - } - - /// Sent each frame where a collider on another object is touching this object's collider (2D physics only). - public IObservable OnCollisionStay2DAsObservable() - { - return onCollisionStay2D ?? (onCollisionStay2D = new Subject()); - } - - Subject onConnectedToServer; - - /// Called on the client when you have successfully connected to a server. - public override void OnConnectedToServer() - { - if (onConnectedToServer != null) onConnectedToServer.OnNext(Unit.Default); - } - - /// Called on the client when you have successfully connected to a server. - public IObservable OnConnectedToServerAsObservable() - { - return onConnectedToServer ?? (onConnectedToServer = new Subject()); - } - - Subject onControllerColliderHit; - - /// OnControllerColliderHit is called when the controller hits a collider while performing a Move. - public override void OnControllerColliderHit(ControllerColliderHit hit) - { - if (onControllerColliderHit != null) onControllerColliderHit.OnNext(hit); - } - - /// OnControllerColliderHit is called when the controller hits a collider while performing a Move. - public IObservable OnControllerColliderHitAsObservable() - { - return onControllerColliderHit ?? (onControllerColliderHit = new Subject()); - } - - bool calledDestroy = false; - Subject onDestroy; - - /// This function is called when the MonoBehaviour will be destroyed. - public override void OnDestroy() - { - calledDestroy = true; - if (onDestroy != null) { onDestroy.OnNext(Unit.Default); onDestroy.OnCompleted(); } - } - - /// This function is called when the MonoBehaviour will be destroyed. - public IObservable OnDestroyAsObservable() - { - if (this == null) return Observable.Return(Unit.Default); - if (calledDestroy) return Observable.Return(Unit.Default); - return onDestroy ?? (onDestroy = new Subject()); - } - - Subject onDisable; - - /// This function is called when the behaviour becomes disabled () or inactive. - public override void OnDisable() - { - if (onDisable != null) onDisable.OnNext(Unit.Default); - } - - /// This function is called when the behaviour becomes disabled () or inactive. - public IObservable OnDisableAsObservable() - { - return onDisable ?? (onDisable = new Subject()); - } - - Subject onDrawGizmos; - - /// Implement OnDrawGizmos if you want to draw gizmos that are also pickable and always drawn. - public override void OnDrawGizmos() - { - if (onDrawGizmos != null) onDrawGizmos.OnNext(Unit.Default); - } - - /// Implement OnDrawGizmos if you want to draw gizmos that are also pickable and always drawn. - public IObservable OnDrawGizmosAsObservable() - { - return onDrawGizmos ?? (onDrawGizmos = new Subject()); - } - - Subject onDrawGizmosSelected; - - /// Implement this OnDrawGizmosSelected if you want to draw gizmos only if the object is selected. - public override void OnDrawGizmosSelected() - { - if (onDrawGizmosSelected != null) onDrawGizmosSelected.OnNext(Unit.Default); - } - - /// Implement this OnDrawGizmosSelected if you want to draw gizmos only if the object is selected. - public IObservable OnDrawGizmosSelectedAsObservable() - { - return onDrawGizmosSelected ?? (onDrawGizmosSelected = new Subject()); - } - - Subject onEnable; - - /// This function is called when the object becomes enabled and active. - public override void OnEnable() - { - if (onEnable != null) onEnable.OnNext(Unit.Default); - } - - /// This function is called when the object becomes enabled and active. - public IObservable OnEnableAsObservable() - { - return onEnable ?? (onEnable = new Subject()); - } - -#if FALSE // OnGUI called multiple time per frame update and it cause performance issue, If you want to need OnGUI, copy & paste this code on your MonoBehaviour - - Subject onGUI; - - /// OnGUI is called for rendering and handling GUI events. - public override void OnGUI() - { - if (onGUI != null) onGUI.OnNext(Unit.Default); - } - - /// OnGUI is called for rendering and handling GUI events. - public IObservable OnGUIAsObservable() - { - return onGUI ?? (onGUI = new Subject()); - } - -#endif - - Subject onJointBreak; - - /// Called when a joint attached to the same game object broke. - public override void OnJointBreak(float breakForce) - { - if (onJointBreak != null) onJointBreak.OnNext(breakForce); - } - - /// Called when a joint attached to the same game object broke. - public IObservable OnJointBreakAsObservable() - { - return onJointBreak ?? (onJointBreak = new Subject()); - } - -#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO) - - Subject onMouseDown; - - /// OnMouseDown is called when the user has pressed the mouse button while over the GUIElement or Collider. - public override void OnMouseDown() - { - if (onMouseDown != null) onMouseDown.OnNext(Unit.Default); - } - - /// OnMouseDown is called when the user has pressed the mouse button while over the GUIElement or Collider. - public IObservable OnMouseDownAsObservable() - { - return onMouseDown ?? (onMouseDown = new Subject()); - } - - Subject onMouseDrag; - - /// OnMouseDrag is called when the user has clicked on a GUIElement or Collider and is still holding down the mouse. - public override void OnMouseDrag() - { - if (onMouseDrag != null) onMouseDrag.OnNext(Unit.Default); - } - - /// OnMouseDrag is called when the user has clicked on a GUIElement or Collider and is still holding down the mouse. - public IObservable OnMouseDragAsObservable() - { - return onMouseDrag ?? (onMouseDrag = new Subject()); - } - - Subject onMouseEnter; - - /// OnMouseEnter is called when the mouse entered the GUIElement or Collider. - public override void OnMouseEnter() - { - if (onMouseEnter != null) onMouseEnter.OnNext(Unit.Default); - } - - /// OnMouseEnter is called when the mouse entered the GUIElement or Collider. - public IObservable OnMouseEnterAsObservable() - { - return onMouseEnter ?? (onMouseEnter = new Subject()); - } - - Subject onMouseExit; - - /// OnMouseExit is called when the mouse is not any longer over the GUIElement or Collider. - public override void OnMouseExit() - { - if (onMouseExit != null) onMouseExit.OnNext(Unit.Default); - } - - /// OnMouseExit is called when the mouse is not any longer over the GUIElement or Collider. - public IObservable OnMouseExitAsObservable() - { - return onMouseExit ?? (onMouseExit = new Subject()); - } - - Subject onMouseOver; - - /// OnMouseOver is called every frame while the mouse is over the GUIElement or Collider. - public override void OnMouseOver() - { - if (onMouseOver != null) onMouseOver.OnNext(Unit.Default); - } - - /// OnMouseOver is called every frame while the mouse is over the GUIElement or Collider. - public IObservable OnMouseOverAsObservable() - { - return onMouseOver ?? (onMouseOver = new Subject()); - } - - Subject onMouseUp; - - /// OnMouseUp is called when the user has released the mouse button. - public override void OnMouseUp() - { - if (onMouseUp != null) onMouseUp.OnNext(Unit.Default); - } - - /// OnMouseUp is called when the user has released the mouse button. - public IObservable OnMouseUpAsObservable() - { - return onMouseUp ?? (onMouseUp = new Subject()); - } - - Subject onMouseUpAsButton; - - /// OnMouseUpAsButton is only called when the mouse is released over the same GUIElement or Collider as it was pressed. - public override void OnMouseUpAsButton() - { - if (onMouseUpAsButton != null) onMouseUpAsButton.OnNext(Unit.Default); - } - - /// OnMouseUpAsButton is only called when the mouse is released over the same GUIElement or Collider as it was pressed. - public IObservable OnMouseUpAsButtonAsObservable() - { - return onMouseUpAsButton ?? (onMouseUpAsButton = new Subject()); - } - -#endif - - Subject onParticleCollision; - - /// OnParticleCollision is called when a particle hits a collider. - public override void OnParticleCollision(GameObject other) - { - if (onParticleCollision != null) onParticleCollision.OnNext(other); - } - - /// OnParticleCollision is called when a particle hits a collider. - public IObservable OnParticleCollisionAsObservable() - { - return onParticleCollision ?? (onParticleCollision = new Subject()); - } - - Subject onPostRender; - - /// OnPostRender is called after a camera finished rendering the scene. - public override void OnPostRender() - { - if (onPostRender != null) onPostRender.OnNext(Unit.Default); - } - - /// OnPostRender is called after a camera finished rendering the scene. - public IObservable OnPostRenderAsObservable() - { - return onPostRender ?? (onPostRender = new Subject()); - } - - Subject onPreCull; - - /// OnPreCull is called before a camera culls the scene. - public override void OnPreCull() - { - if (onPreCull != null) onPreCull.OnNext(Unit.Default); - } - - /// OnPreCull is called before a camera culls the scene. - public IObservable OnPreCullAsObservable() - { - return onPreCull ?? (onPreCull = new Subject()); - } - - Subject onPreRender; - - /// OnPreRender is called before a camera starts rendering the scene. - public override void OnPreRender() - { - if (onPreRender != null) onPreRender.OnNext(Unit.Default); - } - - /// OnPreRender is called before a camera starts rendering the scene. - public IObservable OnPreRenderAsObservable() - { - return onPreRender ?? (onPreRender = new Subject()); - } - - Subject> onRenderImage; - - /// OnRenderImage is called after all rendering is complete to render image. - public override void OnRenderImage(RenderTexture src, RenderTexture dest) - { - if (onRenderImage != null) onRenderImage.OnNext(Tuple.Create(src, dest)); - } - - /// OnRenderImage is called after all rendering is complete to render image. - public IObservable> OnRenderImageAsObservable() - { - return onRenderImage ?? (onRenderImage = new Subject>()); - } - - Subject onRenderObject; - - /// OnRenderObject is called after camera has rendered the scene. - public override void OnRenderObject() - { - if (onRenderObject != null) onRenderObject.OnNext(Unit.Default); - } - - /// OnRenderObject is called after camera has rendered the scene. - public IObservable OnRenderObjectAsObservable() - { - return onRenderObject ?? (onRenderObject = new Subject()); - } - - Subject onServerInitialized; - - /// Called on the server whenever a Network.InitializeServer was invoked and has completed. - public override void OnServerInitialized() - { - if (onServerInitialized != null) onServerInitialized.OnNext(Unit.Default); - } - - /// Called on the server whenever a Network.InitializeServer was invoked and has completed. - public IObservable OnServerInitializedAsObservable() - { - return onServerInitialized ?? (onServerInitialized = new Subject()); - } - - Subject onTriggerEnter; - - /// OnTriggerEnter is called when the Collider other enters the trigger. - public override void OnTriggerEnter(Collider other) - { - if (onTriggerEnter != null) onTriggerEnter.OnNext(other); - } - - /// OnTriggerEnter is called when the Collider other enters the trigger. - public IObservable OnTriggerEnterAsObservable() - { - return onTriggerEnter ?? (onTriggerEnter = new Subject()); - } - - Subject onTriggerEnter2D; - - /// Sent when another object enters a trigger collider attached to this object (2D physics only). - public override void OnTriggerEnter2D(Collider2D other) - { - if (onTriggerEnter2D != null) onTriggerEnter2D.OnNext(other); - } - - /// Sent when another object enters a trigger collider attached to this object (2D physics only). - public IObservable OnTriggerEnter2DAsObservable() - { - return onTriggerEnter2D ?? (onTriggerEnter2D = new Subject()); - } - - Subject onTriggerExit; - - /// OnTriggerExit is called when the Collider other has stopped touching the trigger. - public override void OnTriggerExit(Collider other) - { - if (onTriggerExit != null) onTriggerExit.OnNext(other); - } - - /// OnTriggerExit is called when the Collider other has stopped touching the trigger. - public IObservable OnTriggerExitAsObservable() - { - return onTriggerExit ?? (onTriggerExit = new Subject()); - } - - Subject onTriggerExit2D; - - /// Sent when another object leaves a trigger collider attached to this object (2D physics only). - public override void OnTriggerExit2D(Collider2D other) - { - if (onTriggerExit2D != null) onTriggerExit2D.OnNext(other); - } - - /// Sent when another object leaves a trigger collider attached to this object (2D physics only). - public IObservable OnTriggerExit2DAsObservable() - { - return onTriggerExit2D ?? (onTriggerExit2D = new Subject()); - } - - Subject onTriggerStay; - - /// OnTriggerStay is called once per frame for every Collider other that is touching the trigger. - public override void OnTriggerStay(Collider other) - { - if (onTriggerStay != null) onTriggerStay.OnNext(other); - } - - /// OnTriggerStay is called once per frame for every Collider other that is touching the trigger. - public IObservable OnTriggerStayAsObservable() - { - return onTriggerStay ?? (onTriggerStay = new Subject()); - } - - Subject onTriggerStay2D; - - /// Sent each frame where another object is within a trigger collider attached to this object (2D physics only). - public override void OnTriggerStay2D(Collider2D other) - { - if (onTriggerStay2D != null) onTriggerStay2D.OnNext(other); - } - - /// Sent each frame where another object is within a trigger collider attached to this object (2D physics only). - public IObservable OnTriggerStay2DAsObservable() - { - return onTriggerStay2D ?? (onTriggerStay2D = new Subject()); - } - - Subject onValidate; - - /// This function is called when the script is loaded or a value is changed in the inspector (Called in the editor only). - public override void OnValidate() - { - if (onValidate != null) onValidate.OnNext(Unit.Default); - } - - /// This function is called when the script is loaded or a value is changed in the inspector (Called in the editor only). - public IObservable OnValidateAsObservable() - { - return onValidate ?? (onValidate = new Subject()); - } - - Subject onWillRenderObject; - - /// OnWillRenderObject is called once for each camera if the object is visible. - public override void OnWillRenderObject() - { - if (onWillRenderObject != null) onWillRenderObject.OnNext(Unit.Default); - } - - /// OnWillRenderObject is called once for each camera if the object is visible. - public IObservable OnWillRenderObjectAsObservable() - { - return onWillRenderObject ?? (onWillRenderObject = new Subject()); - } - - Subject reset; - - /// Reset to default values. - public override void Reset() - { - if (reset != null) reset.OnNext(Unit.Default); - } - - /// Reset to default values. - public IObservable ResetAsObservable() - { - return reset ?? (reset = new Subject()); - } - - bool calledStart = false; - Subject start; - - /// Start is called on the frame when a script is enabled just before any of the Update methods is called the first time. - public override void Start() - { - calledStart = true; - if (start != null) { start.OnNext(Unit.Default); start.OnCompleted(); } - } - - /// Start is called on the frame when a script is enabled just before any of the Update methods is called the first time. - public IObservable StartAsObservable() - { - if (calledStart) return Observable.Return(Unit.Default); - return start ?? (start = new Subject()); - } - - Subject update; - - /// Update is called every frame, if the MonoBehaviour is enabled. - public override void Update() - { - if (update != null) update.OnNext(Unit.Default); - } - - /// Update is called every frame, if the MonoBehaviour is enabled. - public IObservable UpdateAsObservable() - { - return update ?? (update = new Subject()); - } - -#if !(UNITY_METRO || UNITY_WP8 || UNITY_NACL_CHROME || UNITY_WEBGL) - - Subject onDisconnectedFromServer; - - /// Called on the client when the connection was lost or you disconnected from the server. - public override void OnDisconnectedFromServer(NetworkDisconnection info) - { - if (onDisconnectedFromServer != null) onDisconnectedFromServer.OnNext(info); - } - - /// Called on the client when the connection was lost or you disconnected from the server. - public IObservable OnDisconnectedFromServerAsObservable() - { - return onDisconnectedFromServer ?? (onDisconnectedFromServer = new Subject()); - } - - Subject onFailedToConnect; - - /// Called on the client when a connection attempt fails for some reason. - public override void OnFailedToConnect(NetworkConnectionError error) - { - if (onFailedToConnect != null) onFailedToConnect.OnNext(error); - } - - /// Called on the client when a connection attempt fails for some reason. - public IObservable OnFailedToConnectAsObservable() - { - return onFailedToConnect ?? (onFailedToConnect = new Subject()); - } - - Subject onFailedToConnectToMasterServer; - - /// Called on clients or servers when there is a problem connecting to the MasterServer. - public override void OnFailedToConnectToMasterServer(NetworkConnectionError info) - { - if (onFailedToConnectToMasterServer != null) onFailedToConnectToMasterServer.OnNext(info); - } - - /// Called on clients or servers when there is a problem connecting to the MasterServer. - public IObservable OnFailedToConnectToMasterServerAsObservable() - { - return onFailedToConnectToMasterServer ?? (onFailedToConnectToMasterServer = new Subject()); - } - - Subject onMasterServerEvent; - - /// Called on clients or servers when reporting events from the MasterServer. - public override void OnMasterServerEvent(MasterServerEvent msEvent) - { - if (onMasterServerEvent != null) onMasterServerEvent.OnNext(msEvent); - } - - /// Called on clients or servers when reporting events from the MasterServer. - public IObservable OnMasterServerEventAsObservable() - { - return onMasterServerEvent ?? (onMasterServerEvent = new Subject()); - } - - Subject onNetworkInstantiate; - - /// Called on objects which have been network instantiated with Network.Instantiate. - public override void OnNetworkInstantiate(NetworkMessageInfo info) - { - if (onNetworkInstantiate != null) onNetworkInstantiate.OnNext(info); - } - - /// Called on objects which have been network instantiated with Network.Instantiate. - public IObservable OnNetworkInstantiateAsObservable() - { - return onNetworkInstantiate ?? (onNetworkInstantiate = new Subject()); - } - - Subject onPlayerConnected; - - /// Called on the server whenever a new player has successfully connected. - public override void OnPlayerConnected(NetworkPlayer player) - { - if (onPlayerConnected != null) onPlayerConnected.OnNext(player); - } - - /// Called on the server whenever a new player has successfully connected. - public IObservable OnPlayerConnectedAsObservable() - { - return onPlayerConnected ?? (onPlayerConnected = new Subject()); - } - - Subject onPlayerDisconnected; - - /// Called on the server whenever a player disconnected from the server. - public override void OnPlayerDisconnected(NetworkPlayer player) - { - if (onPlayerDisconnected != null) onPlayerDisconnected.OnNext(player); - } - - /// Called on the server whenever a player disconnected from the server. - public IObservable OnPlayerDisconnectedAsObservable() - { - return onPlayerDisconnected ?? (onPlayerDisconnected = new Subject()); - } - - Subject> onSerializeNetworkView; - - /// Used to customize synchronization of variables in a script watched by a network view. - public override void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info) - { - if (onSerializeNetworkView != null) onSerializeNetworkView.OnNext(Tuple.Create(stream, info)); - } - - /// Used to customize synchronization of variables in a script watched by a network view. - public IObservable> OnSerializeNetworkViewAsObservable() - { - return onSerializeNetworkView ?? (onSerializeNetworkView = new Subject>()); - } - -#endif - } -} - -#endif - -// above code is generated from template - -/* -var template = @"Subject {0}; - -/// {1} -public override void {2}() -{{ - if ({0} != null) {0}.OnNext(Unit.Default); -}} - -/// {1} -public IObservable {2}AsObservable() -{{ - return {0} ?? ({0} = new Subject()); -}}"; -*/ diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableWWW.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableWWW.cs index 8ad9fc3..e1bc7d7 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableWWW.cs +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableWWW.cs @@ -6,6 +6,10 @@ using ObservableUnity = UniRx.Observable; #endif +#if UNITY_2018_3_OR_NEWER +#pragma warning disable CS0618 +#endif + namespace UniRx { using System.Threading; @@ -21,6 +25,9 @@ namespace UniRx using HashEntry = System.Collections.Generic.KeyValuePair; #endif +#if UNITY_2018_3_OR_NEWER + [Obsolete("Use UnityWebRequest, a fully featured replacement which is more efficient and has additional features")] +#endif public static partial class ObservableWWW { public static IObservable Get(string url, Hash headers = null, IProgress progress = null) @@ -428,4 +435,8 @@ public override string ToString() } } } -} \ No newline at end of file +} + +#if UNITY_2018_3_OR_NEWER +#pragma warning restore CS0618 +#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableWWW.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableWWW.cs.meta index a9707e9..cf317e4 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableWWW.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableWWW.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: ba71e5544e233dd4b83d4c5a6c696d05 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObserveExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObserveExtensions.cs.meta index 069346d..84e9e6c 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObserveExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObserveExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8741793924a6c2f4ea22ba27031d531f timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators.meta index 80103de..38f26d7 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: 55fb4e5dac4d23c4d824ea04d8722fdb folderAsset: yes -timeCreated: 1522374662 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/BatchFrame.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/BatchFrame.cs.meta index 6b63eb6..803040e 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/BatchFrame.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/BatchFrame.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 74a2b6b8c63d1144f914c7f0d6719a36 timeCreated: 1467771656 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrame.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrame.cs.meta index ea6fa66..bff7e5e 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrame.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrame.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 868f75a703f1a944a801ab9c9b4512aa timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrameSubscription.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrameSubscription.cs.meta index ea8341b..8755182 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrameSubscription.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrameSubscription.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: ecfef95eedf36c2448944fb8932f682c timeCreated: 1455373902 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameInterval.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameInterval.cs.meta index 19755f9..8604067 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameInterval.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameInterval.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a731a1a74be20a04a9d7dedc5ceefab2 timeCreated: 1467771656 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameTimeInterval.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameTimeInterval.cs.meta index 931fb59..28adfca 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameTimeInterval.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameTimeInterval.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a55cce9ef638364409d1227a25a32421 timeCreated: 1467771656 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FromCoroutine.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FromCoroutine.cs.meta index e9dc996..62a69e9 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FromCoroutine.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FromCoroutine.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e83ddad992535fb4f8a68a1e7ef8be60 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/RepeatUntil.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/RepeatUntil.cs.meta index 7f3078e..e2c843c 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/RepeatUntil.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/RepeatUntil.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 93507e8a72a71094f870c8dbe1e5bed8 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SampleFrame.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SampleFrame.cs.meta index e59f954..e755f50 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SampleFrame.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SampleFrame.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e04c7fc1929a3db458bf7ae31bcd9e55 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SubscribeOnMainThread.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SubscribeOnMainThread.cs.meta index 573172c..bb5461a 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SubscribeOnMainThread.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SubscribeOnMainThread.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: da3fd97518766ab43827991b7b5d4270 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFirstFrame.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFirstFrame.cs.meta index 0d6b558..e8b8b53 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFirstFrame.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFirstFrame.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3ec92e777b0b4d949967b0663ce8bee8 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFrame.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFrame.cs.meta index 380407b..9addfec 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFrame.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFrame.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2c4ef0bfcfe787543999c7a6cda03c07 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/TimeoutFrame.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/TimeoutFrame.cs.meta index 108cb9c..a969e19 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/TimeoutFrame.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/TimeoutFrame.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: c27be0a585d78a944bccd31b86ee6722 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/PresenterBase.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/PresenterBase.cs deleted file mode 100644 index 9116151..0000000 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/PresenterBase.cs +++ /dev/null @@ -1,234 +0,0 @@ -using System; -using UnityEngine; - -/* -PresenterBase works enough, but too complex. -You can use simple Initialize method and call parent to child, it works for most scenario. -So I don't recommend using PresenterBase, sorry. -*/ - -namespace UniRx -{ - // InEditor : Construct Children Dependency - // Awake : Construct Parent Dependency - // Start(Capture phase) : Parent to Child, pass argument - // Start(Bubbling phase) : Child to Parent, initialize(like constructor) - - /// - /// [Obsolete]Infrastructure interface for PresenterBase`T - /// - public interface IPresenter - { - IPresenter Parent { get; } - GameObject gameObject { get; } - void RegisterParent(IPresenter parent); - void InitializeCore(); - void StartCapturePhase(); - void Awake(); - void ForceInitialize(object argument); - } - - /// - /// [Obsolete]PresenterBase can control dependency of presenter's hierarchy. - /// - public abstract class PresenterBase : PresenterBase - { - protected sealed override void BeforeInitialize(Unit argument) - { - BeforeInitialize(); - } - - /// - /// Same as Start but called before children initialized, it's chance for propagate argument to children. - /// - protected abstract void BeforeInitialize(); - - protected override void Initialize(Unit argument) - { - Initialize(); - } - - /// - /// Force Start BeforeInitialize/Initialize. If you create presenter dynamically, maybe useful. - /// - public void ForceInitialize() - { - ForceInitialize(Unit.Default); - } - - /// - /// Same as Start but called after all children are initialized. - /// - protected abstract void Initialize(); - } - - /// - /// [Obsolete]PresenterBase can control dependency of presenter's hierarchy. - /// - public abstract class PresenterBase : MonoBehaviour, IPresenter - { - protected static readonly IPresenter[] EmptyChildren = new IPresenter[0]; - - int childrenCount = 0; - int currentCalledCount = 0; - bool isAwaken = false; - bool isInitialized = false; - bool isStartedCapturePhase = false; - Subject initializeSubject = null; - IPresenter[] children = null; // set from awake - - IPresenter parent = null; - T argument = default(T); - - public IPresenter Parent - { - get - { - return parent; - } - } - - /// - /// Observable sequence called after initialize completed. - /// - public IObservable InitializeAsObservable() - { - if (isInitialized) return Observable.Return(Unit.Default); - return initializeSubject ?? (initializeSubject = new Subject()); - } - - /// - /// Propagate(Set) argument. - /// - public void PropagateArgument(T argument) - { - this.argument = argument; - } - - /// - /// Dependency on hierarchy of this presenter. If Children is empty, you can return this.EmptyChildren. - /// - protected abstract IPresenter[] Children { get; } - - /// - /// Same as Start but called before children initialized, it's chance for propagate argument to children. - /// - protected abstract void BeforeInitialize(T argument); - - /// - /// Same as Start but called after all children are initialized. - /// - protected abstract void Initialize(T argument); - - /// - /// Force Start BeforeInitialize/Initialize. If you create presenter dynamically, maybe useful. - /// - public virtual void ForceInitialize(T argument) - { - Awake(); - PropagateArgument(argument); - Start(); - } - - void IPresenter.ForceInitialize(object argument) - { - ForceInitialize((T)argument); - } - - void IPresenter.Awake() - { - if (isAwaken) return; - isAwaken = true; - - children = Children; - childrenCount = children.Length; - - for (int i = 0; i < children.Length; i++) - { - var child = children[i]; - child.RegisterParent(this); - child.Awake(); // call Awake directly - } - OnAwake(); - } - - /// Infrastructure method called by UnityEngine. If you needs override Awake, override OnAwake. - protected void Awake() - { - (this as IPresenter).Awake(); - } - - /// An alternative of Awake. - protected virtual void OnAwake() - { - } - - /// Infrastructure method called by UnityEngine. don't call directly, don't override, don't hide! - protected void Start() - { - if (isStartedCapturePhase) return; - var root = parent; - - // Search root object - if (root == null) - { - root = this; - } - else - { - while (root.Parent != null) - { - root = root.Parent; - } - } - - root.StartCapturePhase(); - } - - void IPresenter.StartCapturePhase() - { - isStartedCapturePhase = true; - BeforeInitialize(argument); - - for (int i = 0; i < children.Length; i++) - { - var child = children[i]; - child.StartCapturePhase(); - } - - // Start Bubbling phase - if (children.Length == 0) - { - Initialize(argument); - isInitialized = true; - if (initializeSubject != null) { initializeSubject.OnNext(Unit.Default); initializeSubject.OnCompleted(); } - if (parent != null) - { - parent.InitializeCore(); - } - } - } - - void IPresenter.RegisterParent(IPresenter parent) - { - if (this.parent != null) throw new InvalidOperationException("PresenterBase can't register multiple parent. Name:" + this.name); - - this.parent = parent; - } - - void IPresenter.InitializeCore() - { - currentCalledCount += 1; - if (childrenCount == currentCalledCount) - { - Initialize(argument); - isInitialized = true; - if (initializeSubject != null) { initializeSubject.OnNext(Unit.Default); initializeSubject.OnCompleted(); } - if (parent != null) - { - parent.InitializeCore(); - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/PresenterBase.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/PresenterBase.cs.meta deleted file mode 100644 index 8c82022..0000000 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/PresenterBase.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 57bffdb091ac4164d850493fc89e9d6c -timeCreated: 1455373899 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCollection.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCollection.cs.meta index a909b36..76579b7 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCollection.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCollection.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2e22185fb1dbcef42bc613efd4769011 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs index 0719b7a..25c619d 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; using System.Threading; -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) using UniRx.Async; +using UniRx.Async.Internal; #endif namespace UniRx @@ -12,7 +13,7 @@ public interface IReactiveCommand : IObservable IReadOnlyReactiveProperty CanExecute { get; } bool Execute(T parameter); -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) UniTask WaitUntilExecuteAsync(CancellationToken cancellationToken); #endif } @@ -23,7 +24,7 @@ public interface IAsyncReactiveCommand IDisposable Execute(T parameter); IDisposable Subscribe(Func> asyncAction); -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) UniTask WaitUntilExecuteAsync(CancellationToken cancellationToken); #endif } @@ -104,14 +105,11 @@ public bool Execute(T parameter) { trigger.OnNext(parameter); -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) commonPromise?.InvokeContinuation(ref parameter); if (removablePromises != null) { - foreach (var item in removablePromises) - { - item.Value.InvokeContinuation(ref parameter); - } + PromiseHelper.TrySetResultAll(removablePromises.Values, parameter); } #endif @@ -148,7 +146,7 @@ public void Dispose() trigger.Dispose(); canExecuteSubscription.Dispose(); -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) commonPromise?.SetCanceled(); commonPromise = null; if (removablePromises != null) @@ -162,7 +160,7 @@ public void Dispose() #endif } -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) static readonly Action Callback = CancelCallback; ReactivePropertyReusablePromise commonPromise; @@ -191,7 +189,7 @@ public UniTask WaitUntilExecuteAsync(CancellationToken cancellationToken) newPromise = new ReactivePropertyReusablePromise(cancellationToken); removablePromises.Add(cancellationToken, newPromise); - cancellationToken.Register(Callback, Tuple.Create(this, newPromise), false); + cancellationToken.RegisterWithoutCaptureExecutionContext(Callback, Tuple.Create(this, newPromise)); return newPromise.Task; } @@ -305,14 +303,11 @@ public IDisposable Execute(T parameter) { try { -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) commonPromise?.InvokeContinuation(ref parameter); if (removablePromises != null) { - foreach (var item in removablePromises) - { - item.Value.InvokeContinuation(ref parameter); - } + PromiseHelper.TrySetResultAll(removablePromises.Values, parameter); } #endif @@ -330,14 +325,11 @@ public IDisposable Execute(T parameter) var xs = new IObservable[a.Length]; try { -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) commonPromise?.InvokeContinuation(ref parameter); if (removablePromises != null) { - foreach (var item in removablePromises) - { - item.Value.InvokeContinuation(ref parameter); - } + PromiseHelper.TrySetResultAll(removablePromises.Values, parameter); } #endif @@ -382,7 +374,7 @@ public void Dispose() IsDisposed = true; asyncActions = UniRx.InternalUtil.ImmutableList>>.Empty; -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) commonPromise?.SetCanceled(); commonPromise = null; if (removablePromises != null) @@ -396,7 +388,7 @@ public void Dispose() #endif } -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) static readonly Action Callback = CancelCallback; ReactivePropertyReusablePromise commonPromise; @@ -425,7 +417,7 @@ public UniTask WaitUntilExecuteAsync(CancellationToken cancellationToken) newPromise = new ReactivePropertyReusablePromise(cancellationToken); removablePromises.Add(cancellationToken, newPromise); - cancellationToken.Register(Callback, Tuple.Create(this, newPromise), false); + cancellationToken.RegisterWithoutCaptureExecutionContext(Callback, Tuple.Create(this, newPromise)); return newPromise.Task; } @@ -480,7 +472,7 @@ public static ReactiveCommand ToReactiveCommand(this IObservable can return new ReactiveCommand(canExecuteSource, initialValue); } -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) public static UniTask.Awaiter GetAwaiter(this IReactiveCommand command) { @@ -541,7 +533,7 @@ public static AsyncReactiveCommand ToAsyncReactiveCommand(this IReactivePr return new AsyncReactiveCommand(sharedCanExecuteSource); } -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) public static UniTask.Awaiter GetAwaiter(this IAsyncReactiveCommand command) { diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs.meta index b9a3d29..10b2694 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 939b249fde5252f45a4404e7648931ed timeCreated: 1462927720 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveDictionary.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveDictionary.cs.meta index 4fdc326..011f925 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveDictionary.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveDictionary.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 12cd1079b0fe33f429f9f174c1f849af timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs index 9b6183b..3f0b482 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs @@ -1,4 +1,6 @@ -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +#endif using System; using System.Collections.Generic; @@ -6,8 +8,9 @@ #if !UniRxLibrary using UnityEngine; #endif -#if CSHARP_7_OR_LATER +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) using UniRx.Async; +using UniRx.Async.Internal; #endif namespace UniRx @@ -17,7 +20,7 @@ public interface IReadOnlyReactiveProperty : IObservable T Value { get; } bool HasValue { get; } -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) UniTask WaitUntilValueChangedAsync(CancellationToken cancellationToken); #endif } @@ -154,14 +157,11 @@ void RaiseOnNext(ref T value) node = node.Next; } -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) commonPromise?.InvokeContinuation(ref value); if (removablePromises != null) { - foreach (var item in removablePromises) - { - item.Value.InvokeContinuation(ref value); - } + PromiseHelper.TrySetResultAll(removablePromises.Values, value); } #endif } @@ -246,7 +246,7 @@ protected virtual void Dispose(bool disposing) node.OnCompleted(); node = node.Next; } -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) commonPromise?.SetCanceled(); commonPromise = null; if (removablePromises != null) @@ -272,7 +272,7 @@ public bool IsRequiredSubscribeOnCurrentThread() } -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) static readonly Action Callback = CancelCallback; ReactivePropertyReusablePromise commonPromise; @@ -301,7 +301,7 @@ public UniTask WaitUntilValueChangedAsync(CancellationToken cancellationToken newPromise = new ReactivePropertyReusablePromise(cancellationToken); removablePromises.Add(cancellationToken, newPromise); - cancellationToken.Register(Callback, Tuple.Create(this, newPromise), false); + cancellationToken.RegisterWithoutCaptureExecutionContext(Callback, Tuple.Create(this, newPromise)); return newPromise.Task; } @@ -462,7 +462,7 @@ protected virtual void Dispose(bool disposing) node = node.Next; } -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) commonPromise?.SetCanceled(); commonPromise = null; if (removablePromises != null) @@ -522,14 +522,11 @@ void IObserver.OnNext(T value) node = node.Next; } -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) commonPromise?.InvokeContinuation(ref value); if (removablePromises != null) { - foreach (var item in removablePromises) - { - item.Value.InvokeContinuation(ref value); - } + PromiseHelper.TrySetResultAll(removablePromises.Values, value); } #endif } @@ -541,7 +538,7 @@ void IObserver.OnError(Exception error) // call source.OnError var node = root; while (node != null) - { + { node.OnError(error); node = node.Next; } @@ -565,7 +562,7 @@ public bool IsRequiredSubscribeOnCurrentThread() return false; } -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) static readonly Action Callback = CancelCallback; ReactivePropertyReusablePromise commonPromise; @@ -594,7 +591,7 @@ public UniTask WaitUntilValueChangedAsync(CancellationToken cancellationToken newPromise = new ReactivePropertyReusablePromise(cancellationToken); removablePromises.Add(cancellationToken, newPromise); - cancellationToken.Register(Callback, Tuple.Create(this, newPromise), false); + cancellationToken.RegisterWithoutCaptureExecutionContext(Callback, Tuple.Create(this, newPromise)); return newPromise.Task; } @@ -631,7 +628,7 @@ public static ReadOnlyReactiveProperty ToReadOnlyReactiveProperty(this IOb return new ReadOnlyReactiveProperty(source); } -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) public static UniTask.Awaiter GetAwaiter(this IReadOnlyReactiveProperty source) { diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs.meta index a17fa6d..7819654 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 88e12aa895fef434fbe3ea0cc8f57301 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactivePropertyReusablePromise.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactivePropertyReusablePromise.cs index 18e8913..e6af87d 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactivePropertyReusablePromise.cs +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactivePropertyReusablePromise.cs @@ -1,4 +1,4 @@ -#if (CSHARP_7_OR_LATER) +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) #pragma warning disable CS1591 @@ -9,7 +9,7 @@ namespace UniRx { - internal class ReactivePropertyReusablePromise : IAwaiter + internal class ReactivePropertyReusablePromise : IAwaiter, IResolvePromise { T result; object continuation; // Action or Queue @@ -128,6 +128,12 @@ public void UnsafeOnCompleted(Action action) } } } + + bool IResolvePromise.TrySetResult(T value) + { + InvokeContinuation(ref value); + return true; + } } } diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ScenePlaybackDetector.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ScenePlaybackDetector.cs.meta index 3e3e6d7..f090f98 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ScenePlaybackDetector.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ScenePlaybackDetector.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8d380d86e2ef6674c83ca983a1604273 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit.meta index 37d688d..a290e81 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: 87f9d8f6c8b0b584a87f87878621769f folderAsset: yes -timeCreated: 1522374662 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit/ObjectPool.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit/ObjectPool.cs.meta index ec758de..fbf8a1e 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit/ObjectPool.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit/ObjectPool.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f4980e1e001c7e94fab3250ba284dc91 timeCreated: 1468655394 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers.meta index 72397ab..bde02c6 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: 32cf3f2e2edea8b4cb7505281befe757 folderAsset: yes -timeCreated: 1522374662 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableAnimatorTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableAnimatorTrigger.cs.meta index f5ef20e..8aff60f 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableAnimatorTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableAnimatorTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e03f9257cc6667f4082439aa77d6f01e timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableBeginDragTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableBeginDragTrigger.cs.meta index 827f6f2..2ec62c4 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableBeginDragTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableBeginDragTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3a81a9b6bec6b4f4fba7e0047cd989f6 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCancelTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCancelTrigger.cs.meta index 105cc04..9f3b842 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCancelTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCancelTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4c0a9070b7cc23746b2c0e2db3ec16cd timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCanvasGroupChangedTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCanvasGroupChangedTrigger.cs.meta index b24d785..a023c40 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCanvasGroupChangedTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCanvasGroupChangedTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 54095d3e740f7714085d0568207cbfe0 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollision2DTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollision2DTrigger.cs.meta index f98f99b..40ddc3e 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollision2DTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollision2DTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1be7847b61f30f24daa5762db87a5b19 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollisionTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollisionTrigger.cs.meta index f61184c..09399cc 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollisionTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollisionTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 10b917196cbfcf74898ce1686e205d04 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDeselectTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDeselectTrigger.cs.meta index dd281cf..91bdae0 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDeselectTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDeselectTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9fe6f69c4d869c04e8a1924aab1d3694 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDestroyTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDestroyTrigger.cs.meta index 0899ccf..68d8b53 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDestroyTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDestroyTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: cb219b23cdf4b314f94a27bca3cc8012 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDragTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDragTrigger.cs.meta index 3b63ae6..ba30a30 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDragTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDragTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 79db090dc9e4db245821e8b89b0e208e timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDropTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDropTrigger.cs.meta index a6a9720..1288eb8 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDropTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDropTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f2ffa8b5af3474446a310bb6aa0b180a timeCreated: 1455373902 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEnableTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEnableTrigger.cs.meta index 37c5ea3..969370b 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEnableTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEnableTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 0d9c7eb607af1fd4aa0e15f52cc0543b timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEndDragTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEndDragTrigger.cs.meta index e225db3..e55cd9d 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEndDragTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEndDragTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: b8ce8424f238d6842bd8b09c0cca1ac4 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEventTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEventTrigger.cs.meta index 1574fef..cc19548 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEventTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEventTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 48e93426b16d5454c89e8d47ccded1c5 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableFixedUpdateTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableFixedUpdateTrigger.cs.meta index 6f6a5c8..aabc769 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableFixedUpdateTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableFixedUpdateTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d525c42c11d945f4398061ed8f84e5f4 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableInitializePotentialDragTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableInitializePotentialDragTrigger.cs.meta index 57ce1b2..a14ffba 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableInitializePotentialDragTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableInitializePotentialDragTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3f3148a9e1b8b21409f54d2b0c2c81de timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableLateUpdateTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableLateUpdateTrigger.cs.meta index 94d5398..a62624a 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableLateUpdateTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableLateUpdateTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 176ace24965d0c744bc61c8aad8b3fc7 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMouseTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMouseTrigger.cs.meta index ea9f707..9611b63 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMouseTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMouseTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: c5f30958c5509bc4f9c14ea261a1567c timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMoveTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMoveTrigger.cs.meta index 7545c17..1964275 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMoveTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMoveTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3e1feec0f10dcea4d9c779a81a0ee3dc timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableParticleTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableParticleTrigger.cs.meta index d76755d..184d0fe 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableParticleTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableParticleTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9e6a20494274d5045a1b36a770ea76b4 timeCreated: 1468669952 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerClickTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerClickTrigger.cs.meta index 109913e..b6d86b7 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerClickTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerClickTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: aa69c313aba23f945b760e79c45083ad timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerDownTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerDownTrigger.cs.meta index 07df119..8ca694a 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerDownTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerDownTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: c7ae5b5965df2344d99ef7792521b937 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerEnterTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerEnterTrigger.cs.meta index 3bb79c6..655ddb2 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerEnterTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerEnterTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3468b3db8d419c745b12124f6432696b timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerExitTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerExitTrigger.cs.meta index 1ce197f..5365e5b 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerExitTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerExitTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9643e74593988274bbed9adf40384e48 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerUpTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerUpTrigger.cs.meta index c390c78..ed50e6c 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerUpTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerUpTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 41b0031b2e409894aacafa49d8583617 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableRectTransformTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableRectTransformTrigger.cs.meta index d91b250..2cd2e43 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableRectTransformTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableRectTransformTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 20b97bcdd98f27346851c3a690ec7faf timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableScrollTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableScrollTrigger.cs.meta index ca981b3..67afed9 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableScrollTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableScrollTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2231ec04e488f7443ae7acf609ac5f00 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSelectTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSelectTrigger.cs.meta index a76ab32..3230e07 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSelectTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSelectTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1e4cb287d3ab8274885ed05748f26329 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableStateMachineTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableStateMachineTrigger.cs.meta index 7acb5cf..48921b1 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableStateMachineTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableStateMachineTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1e29959e46c7ea7409560769cde085ae timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSubmitTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSubmitTrigger.cs.meta index 6d8584c..fb7cc88 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSubmitTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSubmitTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 655296fedabd6004ab699ab9749e369c timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTransformChangedTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTransformChangedTrigger.cs.meta index 2fd5e6d..27fbaa5 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTransformChangedTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTransformChangedTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 835e244a602942c4c84a09c9bdedf229 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTrigger2DTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTrigger2DTrigger.cs.meta index b3c4918..38a7ee3 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTrigger2DTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTrigger2DTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1aad3129752ef804999a880a7b2d72ef timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerBase.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerBase.cs.meta index 22d4b87..00d1d1a 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerBase.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerBase.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 850bc951297608e4fb0722795c21ed16 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.Component.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.Component.cs.meta index b019211..ded96f4 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.Component.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.Component.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d10150b3ca6f3924baae5bce4343f6c4 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.cs.meta index 70c9c18..830b73d 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3ee4df960144b9042874516111cf2d6c timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerTrigger.cs.meta index 1c9ddd2..b5dd3fe 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: cadcfd987fed8a044b75709fc19ad0f7 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateSelectedTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateSelectedTrigger.cs.meta index 64d22d2..1f3c83c 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateSelectedTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateSelectedTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4d207a04db328fd4d970c1457530deb3 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateTrigger.cs.meta index 09f87a4..3a2de1a 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: ceb5e5014f40d6948815a7be8b174ff2 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableVisibleTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableVisibleTrigger.cs.meta index ea2f367..9bff2e2 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableVisibleTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableVisibleTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 03515121745b2d74c8782ce92eb2a1a0 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/TypedMonoBehaviour.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/TypedMonoBehaviour.cs deleted file mode 100644 index 39bc254..0000000 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/TypedMonoBehaviour.cs +++ /dev/null @@ -1,205 +0,0 @@ -#if !UNITY_5_5_OR_NEWER - -using UnityEngine; - -namespace UniRx -{ - /// - /// Note: TypedMonoBehaviour and ObservableMonoBehaviour cause some performance issues. - /// This is legacy interface. - /// I recommend use ObservableTriggers(UniRx.Triggers) instead. - /// More information, see github page. - /// - [System.Obsolete("TypedMonoBehaviour is legacy component. use triggers instead")] - public class TypedMonoBehaviour : MonoBehaviour - { - /// Awake is called when the script instance is being loaded. - public virtual void Awake() { } - - /// This function is called every fixed framerate frame, if the MonoBehaviour is enabled. - public virtual void FixedUpdate() { } - - /// LateUpdate is called every frame, if the Behaviour is enabled. - public virtual void LateUpdate() { } - - /// Callback for setting up animation IK (inverse kinematics). - public virtual void OnAnimatorIK(int layerIndex) { } - - /// Callback for processing animation movements for modifying root motion. - public virtual void OnAnimatorMove() { } - - /// Sent to all game objects when the player gets or loses focus. - public virtual void OnApplicationFocus(bool focus) { } - - /// Sent to all game objects when the player pauses. - public virtual void OnApplicationPause(bool pause) { } - - /// Sent to all game objects before the application is quit. - public virtual void OnApplicationQuit() { } - - /// If OnAudioFilterRead is implemented, Unity will insert a custom filter into the audio DSP chain. - public virtual void OnAudioFilterRead(float[] data, int channels) { } - - /// OnBecameInvisible is called when the renderer is no longer visible by any camera. - public virtual void OnBecameInvisible() { } - - /// OnBecameVisible is called when the renderer became visible by any camera. - public virtual void OnBecameVisible() { } - - /// OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider. - public virtual void OnCollisionEnter(Collision collision) { } - - /// Sent when an incoming collider makes contact with this object's collider (2D physics only). - public virtual void OnCollisionEnter2D(Collision2D coll) { } - - /// OnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider. - public virtual void OnCollisionExit(Collision collisionInfo) { } - - /// Sent when a collider on another object stops touching this object's collider (2D physics only). - public virtual void OnCollisionExit2D(Collision2D coll) { } - - /// OnCollisionStay is called once per frame for every collider/rigidbody that is touching rigidbody/collider. - public virtual void OnCollisionStay(Collision collisionInfo) { } - - /// Sent each frame where a collider on another object is touching this object's collider (2D physics only). - public virtual void OnCollisionStay2D(Collision2D coll) { } - - /// Called on the client when you have successfully connected to a server. - public virtual void OnConnectedToServer() { } - - /// OnControllerColliderHit is called when the controller hits a collider while performing a Move. - public virtual void OnControllerColliderHit(ControllerColliderHit hit) { } - - /// This function is called when the MonoBehaviour will be destroyed. - public virtual void OnDestroy() { } - - /// This function is called when the behaviour becomes disabled () or inactive. - public virtual void OnDisable() { } - - /// Implement OnDrawGizmos if you want to draw gizmos that are also pickable and always drawn. - public virtual void OnDrawGizmos() { } - - /// Implement this OnDrawGizmosSelected if you want to draw gizmos only if the object is selected. - public virtual void OnDrawGizmosSelected() { } - - /// This function is called when the object becomes enabled and active. - public virtual void OnEnable() { } - -#if FALSE // OnGUI called multiple time per frame update and it cause performance issue, If you want to need OnGUI, copy & paste this code on your MonoBehaviour - - /// OnGUI is called for rendering and handling GUI events. - public virtual void OnGUI() { } - -#endif - - /// Called when a joint attached to the same game object broke. - public virtual void OnJointBreak(float breakForce) { } - -#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO) - - /// OnMouseDown is called when the user has pressed the mouse button while over the GUIElement or Collider. - public virtual void OnMouseDown() { } - - /// OnMouseDrag is called when the user has clicked on a GUIElement or Collider and is still holding down the mouse. - public virtual void OnMouseDrag() { } - - /// OnMouseEnter is called when the mouse entered the GUIElement or Collider. - public virtual void OnMouseEnter() { } - - /// OnMouseExit is called when the mouse is not any longer over the GUIElement or Collider. - public virtual void OnMouseExit() { } - - /// OnMouseOver is called every frame while the mouse is over the GUIElement or Collider. - public virtual void OnMouseOver() { } - - /// OnMouseUp is called when the user has released the mouse button. - public virtual void OnMouseUp() { } - - /// OnMouseUpAsButton is only called when the mouse is released over the same GUIElement or Collider as it was pressed. - public virtual void OnMouseUpAsButton() { } - -#endif - - /// OnParticleCollision is called when a particle hits a collider. - public virtual void OnParticleCollision(GameObject other) { } - - /// OnPostRender is called after a camera finished rendering the scene. - public virtual void OnPostRender() { } - - /// OnPreCull is called before a camera culls the scene. - public virtual void OnPreCull() { } - - /// OnPreRender is called before a camera starts rendering the scene. - public virtual void OnPreRender() { } - - /// OnRenderImage is called after all rendering is complete to render image. - public virtual void OnRenderImage(RenderTexture src, RenderTexture dest) { } - - /// OnRenderObject is called after camera has rendered the scene. - public virtual void OnRenderObject() { } - - /// Called on the server whenever a Network. InitializeServer was invoked and has completed. - public virtual void OnServerInitialized() { } - - /// OnTriggerEnter is called when the Collider other enters the trigger. - public virtual void OnTriggerEnter(Collider other) { } - - /// Sent when another object enters a trigger collider attached to this object (2D physics only). - public virtual void OnTriggerEnter2D(Collider2D other) { } - - /// OnTriggerExit is called when the Collider other has stopped touching the trigger. - public virtual void OnTriggerExit(Collider other) { } - - /// Sent when another object leaves a trigger collider attached to this object (2D physics only). - public virtual void OnTriggerExit2D(Collider2D other) { } - - /// OnTriggerStay is called once per frame for every Collider other that is touching the trigger. - public virtual void OnTriggerStay(Collider other) { } - - /// Sent each frame where another object is within a trigger collider attached to this object (2D physics only). - public virtual void OnTriggerStay2D(Collider2D other) { } - - /// This function is called when the script is loaded or a value is changed in the inspector (Called in the editor only). - public virtual void OnValidate() { } - - /// OnWillRenderObject is called once for each camera if the object is visible. - public virtual void OnWillRenderObject() { } - - /// Reset to default values. - public virtual void Reset() { } - - /// Start is called on the frame when a script is enabled just before any of the Update methods is called the first time. - public virtual void Start() { } - - /// Update is called every frame, if the MonoBehaviour is enabled. - public virtual void Update() { } - -#if !(UNITY_METRO || UNITY_WP8 || UNITY_NACL_CHROME || UNITY_WEBGL) - /// Called on the client when the connection was lost or you disconnected from the server. - public virtual void OnDisconnectedFromServer(NetworkDisconnection info) { } - - /// Called on the client when a connection attempt fails for some reason. - public virtual void OnFailedToConnect(NetworkConnectionError error) { } - - /// Called on clients or servers when there is a problem connecting to the MasterServer. - public virtual void OnFailedToConnectToMasterServer(NetworkConnectionError info) { } - - /// Called on clients or servers when reporting events from the MasterServer. - public virtual void OnMasterServerEvent(MasterServerEvent msEvent) { } - - /// Called on objects which have been network instantiated with Network Instantiate. - public virtual void OnNetworkInstantiate(NetworkMessageInfo info) { } - - /// Called on the server whenever a new player has successfully connected. - public virtual void OnPlayerConnected(NetworkPlayer player) { } - - /// Called on the server whenever a player disconnected from the server. - public virtual void OnPlayerDisconnected(NetworkPlayer player) { } - - /// Used to customize synchronization of variables in a script watched by a network view. - public virtual void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info) { } -#endif - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/TypedMonoBehaviour.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/TypedMonoBehaviour.cs.meta deleted file mode 100644 index a0aa322..0000000 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/TypedMonoBehaviour.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0d6bb561b9a027f4d8ee0cf68f9df4dc -timeCreated: 1455373897 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UniRxSynchronizationContext.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UniRxSynchronizationContext.cs deleted file mode 100644 index 99e6670..0000000 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UniRxSynchronizationContext.cs +++ /dev/null @@ -1,60 +0,0 @@ -#if (NET_4_6) - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace UniRx -{ - // Check more details, if does not need this, remove this file. - // I've found UnityEngine.UnitySynchronizationContext. - - public class UniRxSynchronizationContext : SynchronizationContext - { - static bool autoInstall = false; - public static bool AutoInstall { get { return autoInstall; } set { autoInstall = value; } } - - public override void Post(SendOrPostCallback d, object state) - { - // If is in mainthread, call direct. - if (MainThreadDispatcher.IsInMainThread) - { - d(state); - } - else - { - MainThreadDispatcher.Post(x => - { - var pair = (Pair)x; - pair.Callback(pair.State); - }, new Pair(d, state)); - } - } - - public override void Send(SendOrPostCallback d, object state) - { - MainThreadDispatcher.Send(x => - { - var pair = (Pair)x; - pair.Callback(pair.State); - }, new Pair(d, state)); - } - - struct Pair - { - public readonly SendOrPostCallback Callback; - public readonly object State; - - public Pair(SendOrPostCallback callback, object state) - { - this.Callback = callback; - this.State = state; - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UniRxSynchronizationContext.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UniRxSynchronizationContext.cs.meta deleted file mode 100644 index ea7a744..0000000 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UniRxSynchronizationContext.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 4b54aaefaddf9b245a688f382be22b6c -timeCreated: 1475139656 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEqualityComparer.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEqualityComparer.cs deleted file mode 100644 index f6b981f..0000000 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEqualityComparer.cs +++ /dev/null @@ -1,136 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UniRx -{ - public static class UnityEqualityComparer - { - public static readonly IEqualityComparer Vector2 = new Vector2EqualityComparer(); - public static readonly IEqualityComparer Vector3 = new Vector3EqualityComparer(); - public static readonly IEqualityComparer Vector4 = new Vector4EqualityComparer(); - public static readonly IEqualityComparer Color = new ColorEqualityComparer(); - public static readonly IEqualityComparer Rect = new RectEqualityComparer(); - public static readonly IEqualityComparer Bounds = new BoundsEqualityComparer(); - public static readonly IEqualityComparer Quaternion = new QuaternionEqualityComparer(); - - static readonly RuntimeTypeHandle vector2Type = typeof(Vector2).TypeHandle; - static readonly RuntimeTypeHandle vector3Type = typeof(Vector3).TypeHandle; - static readonly RuntimeTypeHandle vector4Type = typeof(Vector4).TypeHandle; - static readonly RuntimeTypeHandle colorType = typeof(Color).TypeHandle; - static readonly RuntimeTypeHandle rectType = typeof(Rect).TypeHandle; - static readonly RuntimeTypeHandle boundsType = typeof(Bounds).TypeHandle; - static readonly RuntimeTypeHandle quaternionType = typeof(Quaternion).TypeHandle; - - static class RuntimeTypeHandlerCache - { - public static readonly RuntimeTypeHandle TypeHandle = typeof(T).TypeHandle; - } - - public static IEqualityComparer GetDefault() - { - var t = RuntimeTypeHandlerCache.TypeHandle; - - if (t.Equals(vector2Type)) return (IEqualityComparer)UnityEqualityComparer.Vector2; - if (t.Equals(vector3Type)) return (IEqualityComparer)UnityEqualityComparer.Vector3; - if (t.Equals(vector4Type)) return (IEqualityComparer)UnityEqualityComparer.Vector4; - if (t.Equals(colorType)) return (IEqualityComparer)UnityEqualityComparer.Color; - if (t.Equals(rectType)) return (IEqualityComparer)UnityEqualityComparer.Rect; - if (t.Equals(boundsType)) return (IEqualityComparer)UnityEqualityComparer.Bounds; - if (t.Equals(quaternionType)) return (IEqualityComparer)UnityEqualityComparer.Quaternion; - - return EqualityComparer.Default; - } - - class Vector2EqualityComparer : IEqualityComparer - { - public bool Equals(Vector2 self, Vector2 vector) - { - return self.x.Equals(vector.x) && self.y.Equals(vector.y); - } - - public int GetHashCode(Vector2 obj) - { - return obj.x.GetHashCode() ^ obj.y.GetHashCode() << 2; - } - } - - class Vector3EqualityComparer : IEqualityComparer - { - public bool Equals(Vector3 self, Vector3 vector) - { - return self.x.Equals(vector.x) && self.y.Equals(vector.y) && self.z.Equals(vector.z); - } - - public int GetHashCode(Vector3 obj) - { - return obj.x.GetHashCode() ^ obj.y.GetHashCode() << 2 ^ obj.z.GetHashCode() >> 2; - } - } - - class Vector4EqualityComparer : IEqualityComparer - { - public bool Equals(Vector4 self, Vector4 vector) - { - return self.x.Equals(vector.x) && self.y.Equals(vector.y) && self.z.Equals(vector.z) && self.w.Equals(vector.w); - } - - public int GetHashCode(Vector4 obj) - { - return obj.x.GetHashCode() ^ obj.y.GetHashCode() << 2 ^ obj.z.GetHashCode() >> 2 ^ obj.w.GetHashCode() >> 1; - } - } - - class ColorEqualityComparer : IEqualityComparer - { - public bool Equals(Color self, Color other) - { - return self.r.Equals(other.r) && self.g.Equals(other.g) && self.b.Equals(other.b) && self.a.Equals(other.a); - } - - public int GetHashCode(Color obj) - { - return obj.r.GetHashCode() ^ obj.g.GetHashCode() << 2 ^ obj.b.GetHashCode() >> 2 ^ obj.a.GetHashCode() >> 1; - } - } - - class RectEqualityComparer : IEqualityComparer - { - public bool Equals(Rect self, Rect other) - { - return self.x.Equals(other.x) && self.width.Equals(other.width) && self.y.Equals(other.y) && self.height.Equals(other.height); - } - - public int GetHashCode(Rect obj) - { - return obj.x.GetHashCode() ^ obj.width.GetHashCode() << 2 ^ obj.y.GetHashCode() >> 2 ^ obj.height.GetHashCode() >> 1; - } - } - - class BoundsEqualityComparer : IEqualityComparer - { - public bool Equals(Bounds self, Bounds vector) - { - return self.center.Equals(vector.center) && self.extents.Equals(vector.extents); - } - - public int GetHashCode(Bounds obj) - { - return obj.center.GetHashCode() ^ obj.extents.GetHashCode() << 2; - } - } - - class QuaternionEqualityComparer : IEqualityComparer - { - public bool Equals(Quaternion self, Quaternion vector) - { - return self.x.Equals(vector.x) && self.y.Equals(vector.y) && self.z.Equals(vector.z) && self.w.Equals(vector.w); - } - - public int GetHashCode(Quaternion obj) - { - return obj.x.GetHashCode() ^ obj.y.GetHashCode() << 2 ^ obj.z.GetHashCode() >> 2 ^ obj.w.GetHashCode() >> 1; - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEqualityComparer.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEqualityComparer.cs.meta deleted file mode 100644 index 87e1fcb..0000000 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEqualityComparer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 590dc07f5b0787f418da909b37281f86 -timeCreated: 1455373899 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEventExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEventExtensions.cs.meta index c911bbb..ffe6ade 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEventExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEventExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e3c4861cc04ac524484d0730a3a5bd4a timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityGraphicExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityGraphicExtensions.cs.meta index 13a9fce..e52e1b3 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityGraphicExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityGraphicExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 99be646df339108498ebb70efa1b7bd4 timeCreated: 1455373900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityUIComponentExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityUIComponentExtensions.cs.meta index 1cdffc4..30075fd 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityUIComponentExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityUIComponentExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7645084659bc779448e384456805d251 timeCreated: 1455373899 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/YieldInstructionCache.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/YieldInstructionCache.cs.meta index a574f0a..9fac1b1 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/YieldInstructionCache.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/YieldInstructionCache.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2493deaccf35b0542800b0851771e665 timeCreated: 1455373897 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge.meta b/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge.meta index c37d50f..086e5ec 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge.meta @@ -1,8 +1,6 @@ fileFormatVersion: 2 guid: 383c6945ed8402f4dac000cefd6f173e folderAsset: yes -timeCreated: 1522374661 -licenseType: Free DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/Thread.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/Thread.cs.meta index 85c96d8..a46af85 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/Thread.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/Thread.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: bf1175d5dd9b5904d898eb4c9dd7e0c5 timeCreated: 1455373901 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/ThreadPoolScheduler_UnityWinRT.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/ThreadPoolScheduler_UnityWinRT.cs.meta index 72486f7..dfa8aab 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/ThreadPoolScheduler_UnityWinRT.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/ThreadPoolScheduler_UnityWinRT.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2c36c9256c17bbb40854ef9b9e4d51c7 timeCreated: 1455373898 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs index 20d5aa5..9facb53 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs +++ b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs @@ -213,7 +213,7 @@ private void OnTypeSelected(object typeName) dynamic element = Activator.CreateInstance(type, type.ToString().Split('.').Last() + " " + id, depth, id); element.ElementType = element.GetType().ToString(); - element.BehaviorTreeManager = parent.BehaviorTreeManager; + //element.BehaviorTreeManager = parent.BehaviorTreeManager; _TreeView.treeModel.AddElement(element, parent, 0); _TreeView.SetSelection(new[] { id }, TreeViewSelectionOptions.RevealAndFrame); diff --git a/Assets/Visual Behavior Tree/Editor/uVBT-Editor.asmdef b/Assets/Visual Behavior Tree/Editor/uVBT-Editor.asmdef new file mode 100644 index 0000000..18cf85b --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/uVBT-Editor.asmdef @@ -0,0 +1,18 @@ +{ + "name": "uVBT-Editor", + "references": [ + "uVBT", + "UniRx", + "UniRx.Async" + ], + "optionalUnityReferences": [], + "includePlatforms": ["Editor"], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [ + "Newtonsoft.Json.dll" + ], + "autoReferenced": true, + "defineConstraints": [] +} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/New GUISkin.guiskin.meta b/Assets/Visual Behavior Tree/Editor/uVBT-Editor.asmdef.meta similarity index 52% rename from Assets/Plugins/UniRx/Scripts/New GUISkin.guiskin.meta rename to Assets/Visual Behavior Tree/Editor/uVBT-Editor.asmdef.meta index f2467a4..1f2b8e0 100644 --- a/Assets/Plugins/UniRx/Scripts/New GUISkin.guiskin.meta +++ b/Assets/Visual Behavior Tree/Editor/uVBT-Editor.asmdef.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 52ca93ffd0db1bb41822d7ce5625cb6b -NativeFormatImporter: +guid: 420ba072673e29d42823595a11bb8771 +AssemblyDefinitionImporter: externalObjects: {} - mainObjectFileID: 11400000 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/MarbleDiagrams.meta b/Assets/Visual Behavior Tree/MarbleDiagrams.meta new file mode 100644 index 0000000..a50b78f --- /dev/null +++ b/Assets/Visual Behavior Tree/MarbleDiagrams.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e1ceb47939fef8f4db9de4fb44bc9b1d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/MarbleDiagrams/ParallelMarbleDiagram.xml.meta b/Assets/Visual Behavior Tree/MarbleDiagrams/ParallelMarbleDiagram.xml.meta new file mode 100644 index 0000000..c60203a --- /dev/null +++ b/Assets/Visual Behavior Tree/MarbleDiagrams/ParallelMarbleDiagram.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 216554e3fb822f14f967e3eee83f1e69 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs index 98fab02..d021adf 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs @@ -122,7 +122,7 @@ void Start() { if (TimesToTick > 0) --TimesToTick; Debug.Log(TimesToTick); - Runner.Tick(); + Runner.Start(); TreeSubject.OnNext(Runner); }) .Debug("") diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs index d41b5a4..e4cd208 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs @@ -35,7 +35,7 @@ public BehaviorTreeElement(string name, int depth, int id) /// The primary method of action /// /// observable stream of states from this behavior - public abstract IObservable Tick(); + public abstract IObservable Start(); public virtual void Initialize() { diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs index 2df9b6a..1d65601 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs @@ -45,7 +45,6 @@ public static ParallelRunner LoadFromJSON(this BehaviorTreeManagerAsset asset, B var str = ""; foreach(var e in newElements) { - e.BehaviorTreeManager = manager; str += e.Name + "\n"; } diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/BehaviorComponent.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/BehaviorComponent.cs index 15de38f..7626fe5 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/BehaviorComponent.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/BehaviorComponent.cs @@ -20,7 +20,7 @@ public virtual void AddChild(BehaviorTreeElement element) Children.Add(element); } - public override System.IObservable Tick() + public override System.IObservable Start() { return Observable.Empty(); } diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs index f6ef384..4034f33 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs @@ -11,26 +11,19 @@ namespace Assets.Scripts.AI.Components [Description("Runs all children at same time. Fails early if NumFailures are >0 and total children failed reach that number. Succeeds otherwise.")] public class ParallelRunner : BehaviorComponent { + /// /// Number of times the children return fail before the parallel runner returns in a fail state. /// 0 means ignore number of failures. /// 0 for both succeed and fail means run this once /// - [SerializeField] public int NumberOfFailuresBeforeFail = 0; - protected IntReactiveProperty NumberOfFailures = new IntReactiveProperty(0); - - /// - /// Number of times the children return success before the parallel runner returns in a success state. - /// 0 means ignore number of sucesses. - /// 0 for both succeed and fail means this will only run once - /// - [SerializeField] public int NumberOfSuccessBeforeSucceed = 0; - protected IntReactiveProperty NumberOfSuccesses = new IntReactiveProperty(0); + [Range(0,100)] + [SerializeField] public float SucceedFailRatioForSucceess = 51; public ParallelRunner(string name, int depth, int id) : base(name, depth, id) { } - public override IObservable Tick() + public override IObservable Start() { if (Children == null || Children.Count == 0) { @@ -38,19 +31,24 @@ public override IObservable Tick() return Observable.Return(BehaviorState.Fail); } - return Children.ToObservable() - .Select(child => ((BehaviorTreeElement)child).Tick()) //inject all my children streams into a stream of streams - .Merge() //merge children streams into one stream ("concurrent"ly) - .Do(state => { - if (state == BehaviorState.Fail) - NumberOfFailures.SetValueAndForceNotify(NumberOfFailures.Value + 1); - if (state == BehaviorState.Success) - NumberOfSuccesses.SetValueAndForceNotify(NumberOfSuccesses.Value + 1); - }) - .TakeWhile(_ => NumberOfSuccesses.Value < NumberOfSuccessBeforeSucceed && - NumberOfFailures.Value < NumberOfFailuresBeforeFail) - .Publish() - .RefCount(); + var source = Children.ToObservable() + .SelectMany(child => ((BehaviorTreeElement)child).Start()); + + //should take all streams and publish running until last stream finishes... + //once last stream finishes, must emit "success" or "fail" based on set ratio... + + + return source.Aggregate(new { total = 0, succeeded = 0 }, (acc, childResult) => + { + return childResult == BehaviorState.Success ? + new { total = acc.total + 1, succeeded = acc.succeeded + 1 } : + new { total = acc.total + 1, acc.succeeded }; + }) + .Select(e => 100 * (((float)e.succeeded) / e.total)) + .Select(ratio => + { + return ratio >= SucceedFailRatioForSucceess ? BehaviorState.Success : BehaviorState.Fail; + }); } } } diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs index d225b22..6f16aa6 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs @@ -1,4 +1,5 @@ -using System; +using Assets.Visual_Behavior_Tree.Scripts; +using System; using System.Collections; using System.ComponentModel; using System.Linq; @@ -8,8 +9,8 @@ namespace Assets.Scripts.AI.Components { /// - /// Ticks all sub behaviors until a behavior returns success. - /// Returns and is in success state if a child was successful, otherwise returns in fail state + /// runs all sub behaviors until a behavior returns success. + /// Returns success if a child was successful, otherwise returns fail /// [Serializable] [Description("Runs children in order. Succeeds on first child that succeeds. Fails if no children succeed.")] @@ -19,7 +20,7 @@ public Selector(string name, int depth, int id) : base(name, depth, id) { } - public override IObservable Tick() + public override IObservable Start() { if (Children == null || Children.Count == 0) { @@ -27,16 +28,20 @@ public override IObservable Tick() return Observable.Return(BehaviorState.Fail); } - var source = from child in Children.ToObservable() - select child as BehaviorTreeElement; + var sourceConcat = Children.ToObservable() + .Select(child => + ((BehaviorTreeElement)child).Start() + .Where(st => st != BehaviorState.Running)) + .Concat(); //Sequentially run children and select the final value (should be fail/succeed/error) - return source.Select(child => child.Tick()) - .Concat() //Sequentially subscribe - .TakeWhile(childState => childState != BehaviorState.Success) //take until "succeed". then stop and publish "OnComplete" - - .Publish() - .RefCount(); //automatically begin generating upon receiving first subscription, - //and automatically dispose upon last dispose + // + return sourceConcat.Publish(src => + src.Any(e => e == BehaviorState.Success) //true if any succeed, false if none succeed + .Select(e => e ? BehaviorState.Success : BehaviorState.Fail) //Success if any succeed, fail if all fail + .Publish(srcLast => + src.Where(e => e == BehaviorState.Fail) + .Select(e => BehaviorState.Running) + .TakeUntil(srcLast).Merge(srcLast))); } } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs index dab2cb7..31fd6a1 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs @@ -1,4 +1,5 @@ -using System; +using Assets.Visual_Behavior_Tree.Scripts; +using System; using System.Collections; using System.ComponentModel; using UniRx; @@ -10,15 +11,14 @@ namespace Assets.Scripts.AI.Components /// Runs until a child returns in a fail state /// [System.Serializable] - [Description("Continually runs children in sequence until a child fails. Succeeds if no children fail. Fails if any child fails.")] + [Description("runs children in sequence until a child fails. Succeeds if no children fail. Fails if any child fails.")] public class Sequencer : BehaviorComponent { public Sequencer(string name, int depth, int id) : base(name, depth, id) - { - } + {} - public override IObservable Tick() + public override IObservable Start() { if (Children == null || Children.Count == 0) { @@ -26,17 +26,19 @@ public override IObservable Tick() return Observable.Return(BehaviorState.Fail); } - var source = from child in Children.ToObservable() - select child as BehaviorTreeElement; - - return source.Select(child => child.Tick()) - .Concat() //Sequentially subscribe - .TakeWhile(childState => childState != BehaviorState.Fail) //take until "fail". then stop and publish "OnComplete" + var sourceConcat = Children.ToObservable() + .Select(child => + ((BehaviorTreeElement)child).Start() + .Where(st => st != BehaviorState.Running)) + .Concat(); //Sequentially run children and select the final value (should be fail/succeed/error) - .Publish() - .RefCount(); //automatically begin generating upon receiving first subscription, - //and automatically dispose upon last dispose + return sourceConcat.Publish(src => + src.Any(e => e == BehaviorState.Fail) //true if any fail, false if none fail + .Select(e => e ? BehaviorState.Fail : BehaviorState.Success) //fail if any fail, succeed if all succeed + .Publish(srcLast => + src.Where(e => e == BehaviorState.Success) //success should keep running + .Select(e => BehaviorState.Running) //so return running to show this + .TakeUntil(srcLast).Merge(srcLast))); } } } -} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs b/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs index 7e389c9..2a6bd73 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs @@ -1,4 +1,5 @@ -using System.Collections; +using System; +using System.Collections; using UniRx; using UnityEngine; @@ -11,35 +12,45 @@ public Inverter(string name, int depth, int id) : base(name, depth, id) { } - public override IEnumerator Tick() + public override IObservable Start() { - base.Tick().ToObservable() - //.Do(_ => Debug.Log("OnNext Inverter at start (base.tick()")) - .Subscribe(); + if (Children == null || Children.Count == 0) + { + Debug.LogWarning("Children Null in " + this.Name); + return Observable.Return(BehaviorState.Fail); + } + + var source = from child in Children.ToObservable() + select child as BehaviorTreeElement; - CurrentState = BehaviorState.Null; - if (Children == null) yield return null; - if (Children.Count == 0) yield return null; - var behavior = Children[0] as BehaviorTreeElement; + var sourceConcat = + source.Select(child => child.Start().Where(state => state != BehaviorState.Running)) + .Concat(); - yield return behavior.Tick().ToObservable().Subscribe(_ => + return Observable.CreateSafe((IObserver observer) => { - switch (behavior.CurrentState) + var childrenDisposable = sourceConcat.Do(st => { - case BehaviorState.Fail: - CurrentState = BehaviorState.Success; - break; - case BehaviorState.Success: - CurrentState = BehaviorState.Fail; - break; - case BehaviorState.Running: - CurrentState = BehaviorState.Running; - break; - default: - Debug.LogError("Something went wrong in an inverter."); - break; - } - }).AddTo(Disposables); + if (st == BehaviorState.Fail) + { + observer.OnNext(BehaviorState.Fail); + observer.OnCompleted(); + } + else observer.OnNext(BehaviorState.Running); + }) + .Do(st => + { + if (st == BehaviorState.Success) + observer.OnNext(BehaviorState.Success); + else + observer.OnNext(BehaviorState.Fail); + }) + .Publish().RefCount(); + + return childrenDisposable.Subscribe(); + }) + .Publish() + .RefCount(); } } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs index 94b3ece..b1695b3 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs @@ -1,5 +1,6 @@ using System; using System.Collections; +using UniRx; using UnityEngine; namespace Assets.Scripts.AI.Nodes @@ -12,16 +13,16 @@ public DebugOutNode(string name, int depth, int id) { } - public override BehaviorState Tick() + public override IObservable Start() { base.Initialize(); CurrentState = BehaviorState.Running; //Forces an update on the state between succeeds. //DO STUFF HERE Debug.Log("Debug Out Node " + Name + " Doing stuff"); - //DOM MORE STUFF?! - CurrentState = BehaviorState.Success; - return CurrentState; + //DO MORE STUFF?! + + return Observable.Return(BehaviorState.Success); } } } diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/MoveEnemyIfCloseToPlayer.cs b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/MoveEnemyIfCloseToPlayer.cs deleted file mode 100644 index f802091..0000000 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/MoveEnemyIfCloseToPlayer.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using System.Collections; -using System.ComponentModel; -using UnityEngine; - -namespace Assets.Scripts.AI.Nodes -{ - [Serializable] - public class MoveEnemyIfCloseToPlayer : BehaviorNode - { - private Transform myPos; - private GameObject[] players; - private int numTicks = 0; - - [SerializeField] - [Description("Move Speed. Default = 1.0")] - public float MoveSpeed = 1; - - /// - /// The number of ticks between each full update of player objects. At "0" this will update EVERY TICK. - /// This can be very inefficient and typically is not needed. Default is 10. - /// - [SerializeField] - [Description("Frames between updating player list in the scene. " + - "At 0 this ticks every frame which is typically not needed and is very inefficient.")] - public int UpdatePlayersTickInterval = 20; - - /// - /// Number of ticks between updating current position. Default is 5. - /// - [SerializeField] - [Description("Frames between updating current position in the scene. " + - "At 0 this ticks every frame which is typically not needed and can be inefficient.")] - public int UpdateSelfPositionTickInterval = 5; - - public MoveEnemyIfCloseToPlayer(string name, int depth, int id) : base(name, depth, id) - { } - - public override IEnumerator Tick() - { - - base.Tick(); - - ++numTicks; - if(UpdatePlayersTickInterval % numTicks == 0 || numTicks == 0) - { - players = GameObject.FindGameObjectsWithTag("Player"); - } - if (UpdateSelfPositionTickInterval % numTicks == 0 || numTicks == 0) - { - myPos = BehaviorTreeManager.GetComponentInParent(); - } - - if (players != null && players.Length > 0) - { - var closestPlayer = GetClosestEnemy(players); - yield return MoveTowardsPosition(closestPlayer.position); - } - - CurrentState = BehaviorState.Fail; - yield return null; - } - - private Transform GetClosestEnemy(GameObject[] enemies) - { - Transform bestTarget = null; - float closestDistanceSqr = Mathf.Infinity; - Vector3 currentPosition = myPos.position; - foreach (var potentialTarget in enemies) - { - Vector3 directionToTarget = potentialTarget.transform.position - currentPosition; - float dSqrToTarget = directionToTarget.sqrMagnitude; - if (dSqrToTarget < closestDistanceSqr) - { - closestDistanceSqr = dSqrToTarget; - bestTarget = potentialTarget.transform; - } - } - - return bestTarget; - } - - private IEnumerator MoveTowardsPosition(Vector3 targetPosition) - { - var currentPosition = myPos.position; - - if (Vector3.Distance(currentPosition, targetPosition) > myPos.GetComponentInParent().size.magnitude * 2) - { - var directionOfTravel = targetPosition - currentPosition; - CurrentState = BehaviorState.Running; - float step = (MoveSpeed / directionOfTravel.magnitude) * Time.fixedDeltaTime; - float t = 0; - while (t <= 1.0f) - { - t += step; // Goes from 0 to 1, incrementing by step each time - myPos.position = Vector3.Lerp(currentPosition, targetPosition, t); // Move objectToMove closer to b - yield return new WaitForFixedUpdate(); // Leave the routine and return here in the next frame - } - } - CurrentState = BehaviorState.Success; - yield return null; - } - } -} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs deleted file mode 100644 index f46a085..0000000 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Assets.Scripts.AI; -using Assets.Scripts.AI.Nodes; -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UniRx; -using UnityEngine; - -namespace Assets.Visual_Behavior_Tree.Scripts.AI.Nodes -{ - /// - /// waits a specified time (or a number of frames) then swaps from one given prefab to the next - /// - [Serializable] - class SwapPrefabsOnTime : BehaviorNode - { - [SerializeField] - [Description("prefabs to select from in sequence.")] - public GameObject[] prefabsToSwapBetween; - - [SerializeField] - [Description("Number of received ticks before prefab goes to the next in the list.")] - public int changeEveryTickNum = 10; - - public SwapPrefabsOnTime(string name, int depth, int id) : base(name, depth, id) - { - } - - public override BehaviorState Tick() - { - return base.Tick(); - } - } -} diff --git a/Assets/Visual Behavior Tree/Scripts/BehaviorReactiveExtensions.cs b/Assets/Visual Behavior Tree/Scripts/BehaviorReactiveExtensions.cs new file mode 100644 index 0000000..4f82cde --- /dev/null +++ b/Assets/Visual Behavior Tree/Scripts/BehaviorReactiveExtensions.cs @@ -0,0 +1,37 @@ +using Assets.Scripts.AI; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UniRx; + +namespace Assets.Visual_Behavior_Tree.Scripts +{ + public static class BehaviorReactiveExtensions + { + public static IObservable Publish( + this IObservable source, Func, IObservable> selector) + { + return Observable.CreateSafe((IObserver observer) => + { + var s = source.Publish(); + var p = selector(s).Subscribe(observer); + return new CompositeDisposable(p, s.Connect()); + }); + } + + public static IObservable TakeWhileInclusive( + this IObservable source, Func predicate) + { + return source.Publish(co => co.TakeWhile(predicate) + .Merge(co.SkipWhile(predicate) + .Take(1))); + } + + public static IObservable Any(this IObservable source, Func predicate) + { + return source.Where(predicate).Select(e => true).Concat(Observable.Return(false)).Take(1); + } + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs.meta b/Assets/Visual Behavior Tree/Scripts/BehaviorReactiveExtensions.cs.meta similarity index 83% rename from Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs.meta rename to Assets/Visual Behavior Tree/Scripts/BehaviorReactiveExtensions.cs.meta index 8567753..be65791 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/SwapPrefabsOnTime.cs.meta +++ b/Assets/Visual Behavior Tree/Scripts/BehaviorReactiveExtensions.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 879961ece0cf83142814dcb81be124ae +guid: 6915e3e9fae65eb47a577985a8e9e98c MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Visual Behavior Tree/Tests.meta b/Assets/Visual Behavior Tree/Tests.meta new file mode 100644 index 0000000..88cfa1f --- /dev/null +++ b/Assets/Visual Behavior Tree/Tests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 53c499d27ede20a4ebea85408138b628 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Tests/Components.meta b/Assets/Visual Behavior Tree/Tests/Components.meta new file mode 100644 index 0000000..eba779a --- /dev/null +++ b/Assets/Visual Behavior Tree/Tests/Components.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7d595e46e1515f9458f3e18d590584da +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Tests/SelectorTests.cs b/Assets/Visual Behavior Tree/Tests/SelectorTests.cs new file mode 100644 index 0000000..e604139 --- /dev/null +++ b/Assets/Visual Behavior Tree/Tests/SelectorTests.cs @@ -0,0 +1,74 @@ +using System.Collections.Generic; +using Assets.Scripts.AI; +using Assets.Scripts.AI.Components; +using NUnit.Framework; +using UniRx; + +namespace Assets.Visual_Behavior_Tree.Tests +{ + public class SelectorTests + { + [Test, Description("If any child succeeds, a selector should return succeed")] + public void TestSelectorSucceedsOnSucceed() + { + var selector = new Selector("", 1, 1); + + selector.AddChild(TestingResources.GetRunRunSuccess()); + + var actual = new List(); + + var expected = new List(); + expected.Add(BehaviorState.Success); + + selector.Start().Subscribe((x) => actual.Add(x)); + + Assert.AreEqual(expected, actual); + } + + [Test, Description("If a child succeeds, a selector should return succeed immediately, and not continue running children")] + public void TestSelectorCompletesOnFirstSucceed() + { + var selector = new Selector("", 1, 1); + + selector.AddChild(TestingResources.GetRunRunFail()); + selector.AddChild(TestingResources.GetRunRunSuccess()); + + //all of these should be ignored + //TODO: Should probably check if these are run anyways + // through the Concat operation + selector.AddChild(TestingResources.GetRunRunFail()); + selector.AddChild(TestingResources.GetRunRunFail()); + selector.AddChild(TestingResources.GetRunRunFail()); + selector.AddChild(TestingResources.GetRunRunFail()); + + var actual = new List(); + + var expected = new List(); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Success); + + selector.Start().Subscribe((x) => actual.Add(x)); + + Assert.AreEqual(expected, actual); + } + + [Test, Description("If none of the children succeed, a selector should fail")] + public void TestSelectorFailsIfNoneSucceed() + { + var selector = new Selector("", 1, 1); + + selector.AddChild(TestingResources.GetRunRunFail()); //should be "running" + selector.AddChild(TestingResources.GetRunRunFail()); //should be "running" + + var actual = new List(); + + var expected = new List(); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Fail); + + selector.Start().Subscribe((x) => actual.Add(x)); + Assert.AreEqual(expected, actual); + } + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/MoveEnemyIfCloseToPlayer.cs.meta b/Assets/Visual Behavior Tree/Tests/SelectorTests.cs.meta similarity index 71% rename from Assets/Visual Behavior Tree/Scripts/AI/Nodes/MoveEnemyIfCloseToPlayer.cs.meta rename to Assets/Visual Behavior Tree/Tests/SelectorTests.cs.meta index b68ce23..a0a59b8 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/MoveEnemyIfCloseToPlayer.cs.meta +++ b/Assets/Visual Behavior Tree/Tests/SelectorTests.cs.meta @@ -1,7 +1,5 @@ fileFormatVersion: 2 -guid: d5af97a3140f40042ab091c6cca12186 -timeCreated: 1519072071 -licenseType: Free +guid: af5036ce6767d644f91a2d23c24c00be MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Visual Behavior Tree/Tests/SequencerTests.cs b/Assets/Visual Behavior Tree/Tests/SequencerTests.cs new file mode 100644 index 0000000..721406d --- /dev/null +++ b/Assets/Visual Behavior Tree/Tests/SequencerTests.cs @@ -0,0 +1,72 @@ +using System.Collections.Generic; +using Assets.Scripts.AI; +using Assets.Scripts.AI.Components; +using NUnit.Framework; +using UniRx; + +namespace Assets.Visual_Behavior_Tree.Tests +{ + public class SequencerTests + { + [Test, Description("If any child fails, a sequencer should return running")] + public void TestSequencerFailsOnAnyFail() + { + var sequencer = new Sequencer("", 1, 1); + + sequencer.AddChild(TestingResources.GetRunRunFail()); + + var actual = new List(); + + var expected = new List(); + expected.Add(BehaviorState.Fail); + + sequencer.Start().Subscribe((x) => actual.Add(x)); + + Assert.AreEqual(expected, actual); + } + + [Test, Description("If a child fails, a sequencer should return fail immediately, and not continue running children")] + public void TestSequencerCompletesOnFirstFail() + { + var sequencer = new Sequencer("", 1, 1); + + sequencer.AddChild(TestingResources.GetRunRunSuccess()); + sequencer.AddChild(TestingResources.GetRunRunFail()); + + //all of these should be ignored + //TODO: Should probably check if these are run anyways + // through the Concat operation + sequencer.AddChild(TestingResources.GetRunRunFail()); + sequencer.AddChild(TestingResources.GetRunRunFail()); + + var actual = new List(); + + var expected = new List(); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Fail); + + sequencer.Start().Subscribe((x) => actual.Add(x)); + + Assert.AreEqual(expected, actual); + } + + [Test, Description("If none of the children fail, a sequencer should succeed")] + public void TestSequencerSucceedsIfNoneFail() + { + var sequencer = new Sequencer("", 1, 1); + + sequencer.AddChild(TestingResources.GetRunRunSuccess()); + sequencer.AddChild(TestingResources.GetRunRunSuccess()); + + var actual = new List(); + + var expected = new List(); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Success); + + sequencer.Start().Subscribe((x) => actual.Add(x)); + Assert.AreEqual(expected, actual); + } + } +} diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LazyTask.cs.meta b/Assets/Visual Behavior Tree/Tests/SequencerTests.cs.meta similarity index 68% rename from Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LazyTask.cs.meta rename to Assets/Visual Behavior Tree/Tests/SequencerTests.cs.meta index 76a2399..759a5c3 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LazyTask.cs.meta +++ b/Assets/Visual Behavior Tree/Tests/SequencerTests.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 894287b5c0263d14fbf00c5de21f3b81 -timeCreated: 1455373900 -licenseType: Store +guid: 567b7eca2a5a00e4dbb4a76a509b9f43 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Visual Behavior Tree/Tests/TestingResources.cs b/Assets/Visual Behavior Tree/Tests/TestingResources.cs new file mode 100644 index 0000000..f82743d --- /dev/null +++ b/Assets/Visual Behavior Tree/Tests/TestingResources.cs @@ -0,0 +1,49 @@ +using Assets.Scripts.AI; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UniRx; + +namespace Assets.Visual_Behavior_Tree.Tests +{ + public class TestingResources + { + public static IObservable Fail = Observable.Return(BehaviorState.Fail); + public static IObservable Running = Observable.Return(BehaviorState.Running); + public static IObservable Success = Observable.Return(BehaviorState.Success); + + internal sealed class RunRunFail : BehaviorTreeElement + { + public RunRunFail(string name, int depth, int id) + : base(name, depth, id) { } + + public override IObservable Start() + { + return Observable.Concat(Running, Running, Fail); + } + } + + internal sealed class RunRunSuccess : BehaviorTreeElement + { + public RunRunSuccess(string name, int depth, int id) + : base(name, depth, id) { } + + public override IObservable Start() + { + return Observable.Concat(Running, Running, Success); + } + } + + internal static RunRunFail GetRunRunFail() + { + return new RunRunFail("",1,1); + } + + internal static RunRunSuccess GetRunRunSuccess() + { + return new RunRunSuccess("", 1, 1); + } + } +} diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableMonoBehaviour.cs.meta b/Assets/Visual Behavior Tree/Tests/TestingResources.cs.meta similarity index 68% rename from Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableMonoBehaviour.cs.meta rename to Assets/Visual Behavior Tree/Tests/TestingResources.cs.meta index 462e462..9a75a1b 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableMonoBehaviour.cs.meta +++ b/Assets/Visual Behavior Tree/Tests/TestingResources.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e57124d833524f44683d4699fadca8e0 -timeCreated: 1455373901 -licenseType: Store +guid: 7b6f30abcadd6804daee2f63ab2f0de5 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef b/Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef new file mode 100644 index 0000000..8e5d0fe --- /dev/null +++ b/Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef @@ -0,0 +1,19 @@ +{ + "name": "uVBT-Tests", + "references": [ + "UniRx", + "uVBT" + ], + "optionalUnityReferences": [ + "TestAssemblies" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": true, + "precompiledReferences": [ + "Newtonsoft.Json.dll" + ], + "autoReferenced": true, + "defineConstraints": [] +} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef.meta b/Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef.meta new file mode 100644 index 0000000..808cba1 --- /dev/null +++ b/Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 02f991e9e8dc94b47adc0a3ac0f8b1c5 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/uVBT.asmdef b/Assets/uVBT.asmdef new file mode 100644 index 0000000..af0e018 --- /dev/null +++ b/Assets/uVBT.asmdef @@ -0,0 +1,14 @@ +{ + "name": "uVBT", + "references": [ + "UniRx", + "UniRx.Async" + ], + "optionalUnityReferences": [], + "precompiledReferences": [ + "Newtonsoft.Json.dll" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false +} \ No newline at end of file diff --git a/Assets/uVBT.asmdef.meta b/Assets/uVBT.asmdef.meta new file mode 100644 index 0000000..7e013ed --- /dev/null +++ b/Assets/uVBT.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ced79fd04a0c23b42bbdf96621548c88 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Logs/Packages-Update.log b/Logs/Packages-Update.log index 66792cc..5881ddb 100644 --- a/Logs/Packages-Update.log +++ b/Logs/Packages-Update.log @@ -11,3 +11,14 @@ The following packages were updated: com.unity.analytics from version 2.0.16 to 3.2.2 com.unity.package-manager-ui from version 1.9.11 to 2.1.0-preview.1 com.unity.textmeshpro from version 1.2.4 to 1.3.0 + +=== Wed Dec 19 22:16:38 2018 + +Packages were changed. +Update Mode: updateDependencies + +The following packages were added: + com.unity.collab-proxy@1.2.15 +The following packages were updated: + com.unity.analytics from version 2.0.16 to 3.2.2 + com.unity.package-manager-ui from version 1.9.11 to 2.0.3 diff --git a/Packages/manifest.json b/Packages/manifest.json index 6f69980..e48993f 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,7 +1,8 @@ { "dependencies": { - "com.unity.analytics": "2.0.16", - "com.unity.package-manager-ui": "1.9.11", + "com.unity.analytics": "3.2.2", + "com.unity.collab-proxy": "1.2.15", + "com.unity.package-manager-ui": "2.0.3", "com.unity.textmeshpro": "1.3.0", "com.unity.modules.ai": "1.0.0", "com.unity.modules.animation": "1.0.0", diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset index 74d7b53..6e7e2d9 100644 --- a/ProjectSettings/GraphicsSettings.asset +++ b/ProjectSettings/GraphicsSettings.asset @@ -35,6 +35,8 @@ GraphicsSettings: - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} m_PreloadedShaders: [] m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 2e63e2c..87f2544 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -63,10 +63,12 @@ PlayerSettings: use32BitDisplayBuffer: 1 preserveFramebufferAlpha: 0 disableDepthAndStencilBuffers: 0 + androidStartInFullscreen: 1 + androidRenderOutsideSafeArea: 0 androidBlitType: 0 defaultIsNativeResolution: 1 macRetinaSupport: 1 - runInBackground: 0 + runInBackground: 1 captureSingleScreen: 0 muteOtherAudioSources: 0 Prepare IOS For Recording: 0 @@ -96,9 +98,6 @@ PlayerSettings: xboxEnableGuest: 0 xboxEnablePIXSampling: 0 metalFramebufferOnly: 0 - n3dsDisableStereoscopicView: 0 - n3dsEnableSharedListOpt: 1 - n3dsEnableVSync: 0 xboxOneResolution: 0 xboxOneSResolution: 0 xboxOneXResolution: 3 @@ -107,11 +106,7 @@ PlayerSettings: xboxOneDisableEsram: 0 xboxOnePresentImmediateThreshold: 0 switchQueueCommandMemory: 0 - videoMemoryForVertexBuffers: 0 - psp2PowerMode: 0 - psp2AcquireBGM: 1 vulkanEnableSetSRGBWrite: 0 - vulkanUseSWCommandBuffers: 0 m_SupportedAspectRatios: 4:3: 1 5:4: 1 @@ -145,6 +140,7 @@ PlayerSettings: dashSupport: 0 enable360StereoCapture: 0 protectGraphicsMemory: 0 + enableFrameTimingStats: 0 useHDRDisplay: 0 m_ColorGamuts: 00000000 targetPixelDensity: 30 @@ -169,7 +165,7 @@ PlayerSettings: StripUnusedMeshComponents: 0 VertexChannelCompressionMask: 214 iPhoneSdkVersion: 988 - iOSTargetOSVersionString: 8.0 + iOSTargetOSVersionString: 9.0 tvOSSdkVersion: 0 tvOSRequireExtendedGameController: 0 tvOSTargetOSVersionString: 9.0 @@ -235,7 +231,6 @@ PlayerSettings: appleEnableAutomaticSigning: 0 iOSRequireARKit: 0 appleEnableProMotion: 0 - vulkanEditorSupport: 0 clonedFromGUID: 00000000000000000000000000000000 templatePackageId: templateDefaultScene: @@ -453,6 +448,7 @@ PlayerSettings: ps4pnGameCustomData: 1 playerPrefsSupport: 0 enableApplicationExit: 0 + resetTempFolder: 1 restrictedAudioUsageRights: 0 ps4UseResolutionFallback: 0 ps4ReprojectionSupport: 0 @@ -476,53 +472,6 @@ PlayerSettings: ps4attribEyeToEyeDistanceSettingVR: 0 ps4IncludedModules: [] monoEnv: - psp2Splashimage: {fileID: 0} - psp2NPTrophyPackPath: - psp2NPSupportGBMorGJP: 0 - psp2NPAgeRating: 12 - psp2NPTitleDatPath: - psp2NPCommsID: - psp2NPCommunicationsID: - psp2NPCommsPassphrase: - psp2NPCommsSig: - psp2ParamSfxPath: - psp2ManualPath: - psp2LiveAreaGatePath: - psp2LiveAreaBackroundPath: - psp2LiveAreaPath: - psp2LiveAreaTrialPath: - psp2PatchChangeInfoPath: - psp2PatchOriginalPackage: - psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui - psp2KeystoneFile: - psp2MemoryExpansionMode: 0 - psp2DRMType: 0 - psp2StorageType: 0 - psp2MediaCapacity: 0 - psp2DLCConfigPath: - psp2ThumbnailPath: - psp2BackgroundPath: - psp2SoundPath: - psp2TrophyCommId: - psp2TrophyPackagePath: - psp2PackagedResourcesPath: - psp2SaveDataQuota: 10240 - psp2ParentalLevel: 1 - psp2ShortTitle: Not Set - psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF - psp2Category: 0 - psp2MasterVersion: 01.00 - psp2AppVersion: 01.00 - psp2TVBootMode: 0 - psp2EnterButtonAssignment: 2 - psp2TVDisableEmu: 0 - psp2AllowTwitterDialog: 1 - psp2Upgradable: 0 - psp2HealthWarning: 0 - psp2UseLibLocation: 0 - psp2InfoBarOnStartup: 0 - psp2InfoBarColor: 0 - psp2ScriptOptimizationLevel: 0 splashScreenBackgroundSourceLandscape: {fileID: 0} splashScreenBackgroundSourcePortrait: {fileID: 0} spritePackerPolicy: @@ -538,11 +487,13 @@ PlayerSettings: webGLUseEmbeddedResources: 0 webGLCompressionFormat: 1 webGLLinkerTarget: 1 + webGLThreadsSupport: 0 scriptingDefineSymbols: {} platformArchitecture: {} scriptingBackend: Standalone: 0 il2cppCompilerConfiguration: {} + managedStrippingLevel: {} incrementalIl2cppBuild: {} allowUnsafeCode: 0 additionalIl2CppArgs: @@ -564,6 +515,8 @@ PlayerSettings: metroMediumTileShowName: 0 metroLargeTileShowName: 0 metroWideTileShowName: 0 + metroSupportStreamingInstall: 0 + metroLastRequiredScene: 0 metroDefaultTileSize: 1 metroTileForegroundText: 2 metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} @@ -571,21 +524,11 @@ PlayerSettings: a: 1} metroSplashScreenUseBackgroundColor: 0 platformCapabilities: {} + metroTargetDeviceFamilies: {} metroFTAName: metroFTAFileTypes: [] metroProtocolName: metroCompilationOverrides: 1 - n3dsUseExtSaveData: 0 - n3dsCompressStaticMem: 1 - n3dsExtSaveDataNumber: 0x12345 - n3dsStackSize: 131072 - n3dsTargetPlatform: 2 - n3dsRegion: 7 - n3dsMediaSize: 0 - n3dsLogoStyle: 3 - n3dsTitle: GameName - n3dsProductCode: - n3dsApplicationId: 0xFF3FF XboxOneProductId: XboxOneUpdateKey: XboxOneSandboxId: @@ -611,16 +554,36 @@ PlayerSettings: XboxOnePersistentLocalStorageSize: 0 XboxOneXTitleMemory: 8 xboxOneScriptCompiler: 0 + XboxOneOverrideIdentityName: vrEditorSettings: daydream: daydreamIconForeground: {fileID: 0} daydreamIconBackground: {fileID: 0} cloudServicesEnabled: {} + luminIcon: + m_Name: + m_ModelFolderPath: + m_PortalFolderPath: + luminCert: + m_CertPath: + m_PrivateKeyPath: + luminIsChannelApp: 0 + luminVersion: + m_VersionCode: 1 + m_VersionName: facebookSdkVersion: 7.9.4 + facebookAppId: + facebookCookies: 1 + facebookLogging: 1 + facebookStatus: 1 + facebookXfbml: 0 + facebookFrictionlessRequests: 1 apiCompatibilityLevel: 3 cloudProjectId: + framebufferDepthMemorylessMode: 0 projectName: organizationId: cloudEnabled: 0 enableNativePlatformBackendsForNewInputSystem: 0 disableOldInputManagerSupport: 0 + legacyClampBlendShapeWeights: 1 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 62410b5..ca32b1e 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2018.2.15f1 +m_EditorVersion: 2018.3.0f2 diff --git a/ProjectSettings/UnityConnectSettings.asset b/ProjectSettings/UnityConnectSettings.asset index 3da14d5..c3ae9a0 100644 --- a/ProjectSettings/UnityConnectSettings.asset +++ b/ProjectSettings/UnityConnectSettings.asset @@ -3,25 +3,25 @@ --- !u!310 &1 UnityConnectSettings: m_ObjectHideFlags: 0 - m_Enabled: 0 + serializedVersion: 1 + m_Enabled: 1 m_TestMode: 0 - m_TestEventUrl: - m_TestConfigUrl: + m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events + m_EventUrl: https://cdp.cloud.unity3d.com/v1/events + m_ConfigUrl: https://config.uca.cloud.unity3d.com m_TestInitMode: 0 CrashReportingSettings: - m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes - m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate + m_EventUrl: https://perf-events.cloud.unity3d.com m_Enabled: 0 + m_LogBufferSize: 10 m_CaptureEditorExceptions: 1 UnityPurchasingSettings: m_Enabled: 0 m_TestMode: 0 UnityAnalyticsSettings: m_Enabled: 0 - m_InitializeOnStartup: 1 m_TestMode: 0 - m_TestEventUrl: - m_TestConfigUrl: + m_InitializeOnStartup: 1 UnityAdsSettings: m_Enabled: 0 m_InitializeOnStartup: 1 diff --git a/ProjectSettings/VFXManager.asset b/ProjectSettings/VFXManager.asset index 592104ba9804b3062d9c93d7e0fce0c611c73858..99af3a01f05a35b9a68f504645a46c020dbe9c55 100644 GIT binary patch delta 335 zcmZXOy$(S^5QWd|5;y+U601>2Y!P1saf($*B*-y#RGu=2lOt>p z5+2Y9sCPrmrZ+tPz-ce?PiI)=mV};t=)lj#ZGUHHzvu~fE|@>~^e7JD6eDd$D)se9 y8LDq_r&nc<-d9lnC5tKjHKlnm@dYO!8*gZ6L&=Yf^DA?_W^AM2BfImha_|J(J}7Sh delta 339 zcmZ`yI|{-;6r7ic27joHM8PQdX(T3MW2YAoEG#W-y@QY|EPDV;8#}GVBUpM0ub{Kh z1wou;-rF~`Z|B@Tw*$bf0+k7X8ao>>j^b$;htVdERBN71HK=u?^S%MXQ{cdD6iLS# z>Q+~KZ(v8E6S_#I6g)CR3KG^7>f#I3Ey&sV;r~Re=$Qz!o`Mm2B>yw=eD#%~7vlFn ztJEEdfyD4hn2%*b=&kh0?OFr9@La|Jmo Fail = Observable.Return(BehaviorState.Fail); + static IObservable Success = Observable.Return(BehaviorState.Success); + static IObservable Running = Observable.Return(BehaviorState.Running); + + internal class RunRunFail : BehaviorNode + { + public RunRunFail(string name, int depth, int id) + : base(name, depth, id) + { } + public override IObservable Start() + { + return Observable.Concat(Running, Running, Fail); + } + } + + internal class RunRunSuccess : BehaviorNode + { + public RunRunSuccess(string name, int depth, int id) + : base(name, depth, id) + { } + public override IObservable Start() + { + return Observable.Concat(Running, Running, Success); + } + } + + + [Test] + public void TestSelectorIsSequential() + { + var selector = new Selector("",0,1); + selector.AddChild(new RunRunFail("", 0, 0)); + selector.AddChild(new RunRunSuccess("", 0, 0)); + + Assert.AreEqual(selector.Start(), Observable.Concat(Running, Success)); + } + } +} From 831fc93e6c24b676f566877b833e21c33b9b756c Mon Sep 17 00:00:00 2001 From: MystikalPooka Date: Fri, 28 Dec 2018 19:07:32 -0700 Subject: [PATCH 05/16] Finish First Refactor, ADD unit tests! --- .../BackendData/MultiColumnBTreeWindow.cs | 8 +- .../BehaviorExtensions.cs | 4 +- .../Scripts/AI/BehaviorManager.cs | 2 +- .../Scripts/AI/BehaviorTreeManagerAsset.cs | 6 +- .../Scripts/AI/Components/Merge.cs | 51 +++++++++ .../{ParallelRunner.cs.meta => Merge.cs.meta} | 4 +- .../Scripts/AI/Components/ParallelRunner.cs | 54 ---------- .../Scripts/AI/Components/Sequencer.cs | 2 +- .../Scripts/AI/Decorators/Inverter.cs | 30 +----- .../Tests/InverterTests.cs | 43 ++++++++ .../Tests/InverterTests.cs.meta | 11 ++ .../Visual Behavior Tree/Tests/MergeTests.cs | 100 ++++++++++++++++++ .../Tests/MergeTests.cs.meta | 11 ++ .../Tests/TestingResources.cs | 40 +++++++ 14 files changed, 270 insertions(+), 96 deletions(-) create mode 100644 Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs rename Assets/Visual Behavior Tree/Scripts/AI/Components/{ParallelRunner.cs.meta => Merge.cs.meta} (71%) delete mode 100644 Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs create mode 100644 Assets/Visual Behavior Tree/Tests/InverterTests.cs create mode 100644 Assets/Visual Behavior Tree/Tests/InverterTests.cs.meta create mode 100644 Assets/Visual Behavior Tree/Tests/MergeTests.cs create mode 100644 Assets/Visual Behavior Tree/Tests/MergeTests.cs.meta diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs index 9facb53..36ba764 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs +++ b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs @@ -120,7 +120,7 @@ IList GetData() var treeRoot = _BehaviorTreeManagerAsset.LoadFromJSON(); if(treeRoot == null) { - treeRoot = new ParallelRunner("New Root",-1, -1); + treeRoot = new Merge("New Root",-1, -1); } var treeList = new List(); @@ -133,9 +133,9 @@ void CreateNewTree() { CustomAssetUtility.CreateAsset(); _BehaviorTreeManagerAsset = (BehaviorTreeManagerAsset)Selection.activeObject; - var root =new ParallelRunner("root",-1,-1); + var root =new Merge("root",-1,-1); BehaviorExtensions.SaveBehaviorAsset(null, AssetDatabase.GetAssetPath(_BehaviorTreeManagerAsset), - _BehaviorTreeManagerAsset,(ParallelRunner)root); + _BehaviorTreeManagerAsset,(Merge)root); } void OnSelectionChange() @@ -195,7 +195,7 @@ void TopToolbar(Rect rect) if (GUILayout.Button("Save Tree")) { FilePath = EditorUtility.SaveFilePanel("", FileDir, "New Behavior Tree", "asset"); - BehaviorExtensions.SaveBehaviorAsset(null, FilePath, _BehaviorTreeManagerAsset, (ParallelRunner)_TreeView.treeModel.Root); + BehaviorExtensions.SaveBehaviorAsset(null, FilePath, _BehaviorTreeManagerAsset, (Merge)_TreeView.treeModel.Root); } } diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BehaviorExtensions.cs b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BehaviorExtensions.cs index 987cdb4..4682ff1 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BehaviorExtensions.cs +++ b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BehaviorExtensions.cs @@ -84,7 +84,7 @@ public static Color GetBehaviorStateColor(this BehaviorState state) /// /// public static void SaveBehaviorAsset(this BehaviorManager behaviorManager, string filePath, - BehaviorTreeManagerAsset asset, ParallelRunner root = null) + BehaviorTreeManagerAsset asset, Merge root = null) { if (asset == null) asset = ScriptableObject.CreateInstance(); @@ -116,7 +116,7 @@ public static void SaveBehaviorAsset(this BehaviorManager behaviorManager, strin if(json == "" || runnerElementList.Count == 0) { - var runner = new ParallelRunner("Extension Root", -1, -1); + var runner = new Merge("Extension Root", -1, -1); runnerElementList.Add(runner); json = JsonConvert.SerializeObject(runnerElementList, Formatting.Indented); diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs index d021adf..ae1a19a 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs @@ -40,7 +40,7 @@ private set [Description("The currently loaded tree asset that will be run.")] public BehaviorTreeManagerAsset BehaviorTreeFile; - public ParallelRunner Runner { get; set; } = new ParallelRunner("Main Root", -1, -1); + public Merge Runner { get; set; } = new Merge("Main Root", -1, -1); /// /// Seconds between every tick. At "0" this will tick every frame (basically an update loop) diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs index 1d65601..5b85584 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs @@ -19,13 +19,13 @@ public class BehaviorTreeManagerAsset : ScriptableObject public static class AssetExtensions { - public static ParallelRunner LoadFromJSON(this BehaviorTreeManagerAsset asset, BehaviorManager manager = null) + public static Merge LoadFromJSON(this BehaviorTreeManagerAsset asset, BehaviorManager manager = null) { //TODO: Confirm reload from json if (asset == null) { Debug.Log("Asset is null when loading"); - return new ParallelRunner("Empty Root", -1, -1); + return new Merge("Empty Root", -1, -1); } else { @@ -49,7 +49,7 @@ public static ParallelRunner LoadFromJSON(this BehaviorTreeManagerAsset asset, B } var tree = TreeElementUtility.ListToTree(newElements); - return (ParallelRunner)tree; + return (Merge)tree; } } } diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs new file mode 100644 index 0000000..d14fd79 --- /dev/null +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections; +using System.ComponentModel; +using System.Linq; +using UniRx; +using UnityEngine; +using Assets.Visual_Behavior_Tree.Scripts; + +namespace Assets.Scripts.AI.Components +{ + [Serializable] + [Description("Runs all children at same time. Fails early if NumFailures are >0 and total children failed reach that number. Succeeds otherwise.")] + public class Merge : BehaviorComponent + { + [Range(0,100)] + [SerializeField] public float SucceedFailPercentForSucceess = 51; + + public Merge(string name, int depth, int id) + : base(name, depth, id) { } + + public override IObservable Start() + { + if (Children == null || Children.Count == 0) + { + Debug.LogWarning("Children Null in parallel runner"); + return Observable.Return(BehaviorState.Fail); + } + + var source = Children.ToObservable() + .SelectMany(child => + ((BehaviorTreeElement)child).Start() + .Where(st => st != BehaviorState.Running)); + + //should take all streams and publish running until last stream finishes... + //once last stream finishes, must emit "success" or "fail" based on set ratio... + return source.Publish(src => + src.Aggregate(new { total = 0, succeeded = 0 }, (acc, childResult) => + { + return childResult == BehaviorState.Success ? + new { total = acc.total + 1, succeeded = acc.succeeded + 1 } : + new { total = acc.total + 1, acc.succeeded }; + }) + .Select(a => 100 * ((float)a.succeeded / a.total)) + .Select(ratio => ratio >= SucceedFailPercentForSucceess ? + BehaviorState.Success : BehaviorState.Fail) + .Publish(srcLast => + src.Select(s => BehaviorState.Running) + .TakeUntil(srcLast).Merge(srcLast))); + } + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs.meta b/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs.meta similarity index 71% rename from Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs.meta rename to Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs.meta index 46b755a..eed86c5 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs.meta +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs.meta @@ -1,7 +1,5 @@ fileFormatVersion: 2 -guid: 4d77c67118a52d9499a2d906b8b18237 -timeCreated: 1518313599 -licenseType: Free +guid: 16ed73531ef05824e88999b5e3049f5a MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs deleted file mode 100644 index 4034f33..0000000 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/ParallelRunner.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Collections; -using System.ComponentModel; -using System.Linq; -using UniRx; -using UnityEngine; - -namespace Assets.Scripts.AI.Components -{ - [Serializable] - [Description("Runs all children at same time. Fails early if NumFailures are >0 and total children failed reach that number. Succeeds otherwise.")] - public class ParallelRunner : BehaviorComponent - { - - /// - /// Number of times the children return fail before the parallel runner returns in a fail state. - /// 0 means ignore number of failures. - /// 0 for both succeed and fail means run this once - /// - [Range(0,100)] - [SerializeField] public float SucceedFailRatioForSucceess = 51; - - public ParallelRunner(string name, int depth, int id) - : base(name, depth, id) { } - - public override IObservable Start() - { - if (Children == null || Children.Count == 0) - { - Debug.LogWarning("Children Null in parallel runner"); - return Observable.Return(BehaviorState.Fail); - } - - var source = Children.ToObservable() - .SelectMany(child => ((BehaviorTreeElement)child).Start()); - - //should take all streams and publish running until last stream finishes... - //once last stream finishes, must emit "success" or "fail" based on set ratio... - - - return source.Aggregate(new { total = 0, succeeded = 0 }, (acc, childResult) => - { - return childResult == BehaviorState.Success ? - new { total = acc.total + 1, succeeded = acc.succeeded + 1 } : - new { total = acc.total + 1, acc.succeeded }; - }) - .Select(e => 100 * (((float)e.succeeded) / e.total)) - .Select(ratio => - { - return ratio >= SucceedFailRatioForSucceess ? BehaviorState.Success : BehaviorState.Fail; - }); - } - } -} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs index 31fd6a1..9b6ab28 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs @@ -41,4 +41,4 @@ public override IObservable Start() .TakeUntil(srcLast).Merge(srcLast))); } } -} +} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs b/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs index 2a6bd73..41abcc7 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs @@ -20,37 +20,11 @@ public override IObservable Start() return Observable.Return(BehaviorState.Fail); } - var source = from child in Children.ToObservable() - select child as BehaviorTreeElement; - var sourceConcat = - source.Select(child => child.Start().Where(state => state != BehaviorState.Running)) + Children.ToObservable().Select(child => ((BehaviorTreeElement)child).Start().Where(state => state != BehaviorState.Running)) .Concat(); - return Observable.CreateSafe((IObserver observer) => - { - var childrenDisposable = sourceConcat.Do(st => - { - if (st == BehaviorState.Fail) - { - observer.OnNext(BehaviorState.Fail); - observer.OnCompleted(); - } - else observer.OnNext(BehaviorState.Running); - }) - .Do(st => - { - if (st == BehaviorState.Success) - observer.OnNext(BehaviorState.Success); - else - observer.OnNext(BehaviorState.Fail); - }) - .Publish().RefCount(); - - return childrenDisposable.Subscribe(); - }) - .Publish() - .RefCount(); + return sourceConcat.Select(state => state == BehaviorState.Fail ? BehaviorState.Success : BehaviorState.Fail); } } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Tests/InverterTests.cs b/Assets/Visual Behavior Tree/Tests/InverterTests.cs new file mode 100644 index 0000000..234b61d --- /dev/null +++ b/Assets/Visual Behavior Tree/Tests/InverterTests.cs @@ -0,0 +1,43 @@ +using Assets.Scripts.AI; +using Assets.Scripts.AI.Decorators; +using NUnit.Framework; +using System.Collections.Generic; +using UniRx; + +namespace Assets.Visual_Behavior_Tree.Tests +{ + class InverterTests + { + [Test, Description("Inverter should return succeed when child fails)")] + public void TestInverterInvertsFail() + { + var inverter = new Inverter("", 1, 1); + inverter.Children.Add(TestingResources.GetRunRunFail()); + + var actual = new List(); + + var expected = new List(); + expected.Add(BehaviorState.Success); + + inverter.Start().Subscribe((x) => actual.Add(x)); + + Assert.AreEqual(expected, actual); + } + + [Test, Description("Inverter should return fail when child succeeds")] + public void TestInverterInvertsSuccess() + { + var inverter = new Inverter("", 1, 1); + inverter.Children.Add(TestingResources.GetRunRunSuccess()); + + var actual = new List(); + + var expected = new List(); + expected.Add(BehaviorState.Fail); + + inverter.Start().Subscribe((x) => actual.Add(x)); + + Assert.AreEqual(expected, actual); + } + } +} diff --git a/Assets/Visual Behavior Tree/Tests/InverterTests.cs.meta b/Assets/Visual Behavior Tree/Tests/InverterTests.cs.meta new file mode 100644 index 0000000..4eee80a --- /dev/null +++ b/Assets/Visual Behavior Tree/Tests/InverterTests.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd7f47137fe81534ba5960b05b6403f1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Tests/MergeTests.cs b/Assets/Visual Behavior Tree/Tests/MergeTests.cs new file mode 100644 index 0000000..459c923 --- /dev/null +++ b/Assets/Visual Behavior Tree/Tests/MergeTests.cs @@ -0,0 +1,100 @@ +using Assets.Scripts.AI; +using Assets.Scripts.AI.Components; +using NUnit.Framework; +using System; +using System.Collections.Generic; +using UniRx; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Diagnostics; +using System.Threading; + +namespace Assets.Visual_Behavior_Tree.Tests +{ + class MergeTests + { + static IObservable Wait100msSucceed = Observable.Timer(TimeSpan.FromMilliseconds(100)) + .Publish().Select(e => BehaviorState.Success); + + static IObservable Wait200msFail = Observable.Timer(TimeSpan.FromMilliseconds(200)) + .Select(e => BehaviorState.Success); + + [Test, Description("Merge should return succeed when the percent of succeeds is over a set amount (51%)")] + public void TestMergeSucceedRatioSucceeds() + { + var runner = new Merge("", 1, 1); + runner.SucceedFailPercentForSucceess = 51; //over 50% succeed should succeed + + runner.AddChild(TestingResources.GetRunRunSuccess()); //publish running, success = 1/1 + runner.AddChild(TestingResources.GetRunRunSuccess()); //publish running, success = 2/2 + runner.AddChild(TestingResources.GetRunRunFail()); //publish running, success = 2/3 + //publish success, success = 2/3 + + var actual = new List(); + + var expected = new List(); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Success); + + runner.Start().Subscribe((x) => actual.Add(x)); + + Assert.AreEqual(expected, actual); + } + + [Test, Description("Merge should return fail when the percent of succeeds is under a set amount (40%)")] + public void TestMergeFailRatioFails() + { + var runner = new Merge("", 1, 1); + runner.SucceedFailPercentForSucceess = 40; //under 40% succeed should fail + + runner.AddChild(TestingResources.GetRunRunSuccess()); //success = 1/1 + runner.AddChild(TestingResources.GetRunRunFail()); //success = 1/2 + runner.AddChild(TestingResources.GetRunRunFail()); //publish fail, success = 1/3 + var actual = new List(); + + var expected = new List(); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Fail); + + runner.Start().Subscribe((x) => actual.Add(x)); + + Assert.AreEqual(expected, actual); + } + + [Test, Description("Merge should run multiple 100ms children in about 100ms (concurrently)(I WANT IT TO WORK! =( )")] + public void TestMergeRunsConcurrently() + { + var runner = new Merge("", 1, 1); + runner.SucceedFailPercentForSucceess = 40; //over 50% succeed should succeed + + runner.AddChild(TestingResources.GetWaitSuccess()); + runner.AddChild(TestingResources.GetWaitSuccess()); + runner.AddChild(TestingResources.GetWaitSuccess()); + runner.AddChild(TestingResources.GetWaitSuccess()); + + var actual = new List(); + + var expected = new List(); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Running); + expected.Add(BehaviorState.Success); + var sw = Stopwatch.StartNew(); + + runner.Start().Subscribe((x) => actual.Add(x)); + + sw.Stop(); + var msElapsed = sw.ElapsedMilliseconds; + UnityEngine.Debug.Log(msElapsed); + + Assert.AreEqual(expected, actual); + //Assert.That(msElapsed <= 108 && sw.ElapsedMilliseconds >= 92); + } + } +} diff --git a/Assets/Visual Behavior Tree/Tests/MergeTests.cs.meta b/Assets/Visual Behavior Tree/Tests/MergeTests.cs.meta new file mode 100644 index 0000000..54224f7 --- /dev/null +++ b/Assets/Visual Behavior Tree/Tests/MergeTests.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ea16e550cfb2d0545b0ccd5ee73894fb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Tests/TestingResources.cs b/Assets/Visual Behavior Tree/Tests/TestingResources.cs index f82743d..75c26dd 100644 --- a/Assets/Visual Behavior Tree/Tests/TestingResources.cs +++ b/Assets/Visual Behavior Tree/Tests/TestingResources.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using UniRx; @@ -36,6 +37,31 @@ public override IObservable Start() } } + internal sealed class Wait100msSuccess : BehaviorTreeElement + { + public Wait100msSuccess(string name, int depth, int id) + : base(name, depth, id) { } + + public override IObservable Start() + { + return Observable.Timer(TimeSpan.FromMilliseconds(10)).Select(e => BehaviorState.Success); + } + } + + + internal sealed class RunCustom : BehaviorTreeElement + { + public RunCustom(string name, int depth, int id) + : base(name, depth, id) { } + + public IObservable CustomStream; + + public override IObservable Start() + { + return CustomStream; + } + } + internal static RunRunFail GetRunRunFail() { return new RunRunFail("",1,1); @@ -45,5 +71,19 @@ internal static RunRunSuccess GetRunRunSuccess() { return new RunRunSuccess("", 1, 1); } + + internal static Wait100msSuccess GetWaitSuccess() + { + return new Wait100msSuccess("", 1, 1); + } + + internal static RunCustom GetRunCustom(IObservable customStream) + { + var custom = new RunCustom("", 1, 1); + custom.CustomStream = customStream; + + return custom; + } + } } From 0d8c3b59ccbb90706392222e17e889ae8056203a Mon Sep 17 00:00:00 2001 From: MystikalPooka Date: Sun, 30 Dec 2018 15:09:00 -0700 Subject: [PATCH 06/16] Remove concurrency test as it wasn't proving anything --- .../Scripts/AI/Components/Merge.cs | 7 ++-- .../Visual Behavior Tree/Tests/MergeTests.cs | 35 ------------------- .../Tests/TestingResources.cs | 18 +--------- 3 files changed, 6 insertions(+), 54 deletions(-) diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs index d14fd79..bf6280f 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs @@ -12,8 +12,9 @@ namespace Assets.Scripts.AI.Components [Description("Runs all children at same time. Fails early if NumFailures are >0 and total children failed reach that number. Succeeds otherwise.")] public class Merge : BehaviorComponent { - [Range(0,100)] - [SerializeField] public float SucceedFailPercentForSucceess = 51; + [Range(0, 100)] + [SerializeField] + public float SucceedFailPercentForSucceess = 51; public Merge(string name, int depth, int id) : base(name, depth, id) { } @@ -31,6 +32,7 @@ public override IObservable Start() ((BehaviorTreeElement)child).Start() .Where(st => st != BehaviorState.Running)); + //should take all streams and publish running until last stream finishes... //once last stream finishes, must emit "success" or "fail" based on set ratio... return source.Publish(src => @@ -47,5 +49,6 @@ public override IObservable Start() src.Select(s => BehaviorState.Running) .TakeUntil(srcLast).Merge(srcLast))); } + } } diff --git a/Assets/Visual Behavior Tree/Tests/MergeTests.cs b/Assets/Visual Behavior Tree/Tests/MergeTests.cs index 459c923..d8fc326 100644 --- a/Assets/Visual Behavior Tree/Tests/MergeTests.cs +++ b/Assets/Visual Behavior Tree/Tests/MergeTests.cs @@ -5,10 +5,6 @@ using System.Collections.Generic; using UniRx; using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Diagnostics; -using System.Threading; namespace Assets.Visual_Behavior_Tree.Tests { @@ -65,36 +61,5 @@ public void TestMergeFailRatioFails() Assert.AreEqual(expected, actual); } - - [Test, Description("Merge should run multiple 100ms children in about 100ms (concurrently)(I WANT IT TO WORK! =( )")] - public void TestMergeRunsConcurrently() - { - var runner = new Merge("", 1, 1); - runner.SucceedFailPercentForSucceess = 40; //over 50% succeed should succeed - - runner.AddChild(TestingResources.GetWaitSuccess()); - runner.AddChild(TestingResources.GetWaitSuccess()); - runner.AddChild(TestingResources.GetWaitSuccess()); - runner.AddChild(TestingResources.GetWaitSuccess()); - - var actual = new List(); - - var expected = new List(); - expected.Add(BehaviorState.Running); - expected.Add(BehaviorState.Running); - expected.Add(BehaviorState.Running); - expected.Add(BehaviorState.Running); - expected.Add(BehaviorState.Success); - var sw = Stopwatch.StartNew(); - - runner.Start().Subscribe((x) => actual.Add(x)); - - sw.Stop(); - var msElapsed = sw.ElapsedMilliseconds; - UnityEngine.Debug.Log(msElapsed); - - Assert.AreEqual(expected, actual); - //Assert.That(msElapsed <= 108 && sw.ElapsedMilliseconds >= 92); - } } } diff --git a/Assets/Visual Behavior Tree/Tests/TestingResources.cs b/Assets/Visual Behavior Tree/Tests/TestingResources.cs index 75c26dd..7cf4afa 100644 --- a/Assets/Visual Behavior Tree/Tests/TestingResources.cs +++ b/Assets/Visual Behavior Tree/Tests/TestingResources.cs @@ -6,6 +6,7 @@ using System.Threading; using System.Threading.Tasks; using UniRx; +using UniRx.Diagnostics; namespace Assets.Visual_Behavior_Tree.Tests { @@ -37,18 +38,6 @@ public override IObservable Start() } } - internal sealed class Wait100msSuccess : BehaviorTreeElement - { - public Wait100msSuccess(string name, int depth, int id) - : base(name, depth, id) { } - - public override IObservable Start() - { - return Observable.Timer(TimeSpan.FromMilliseconds(10)).Select(e => BehaviorState.Success); - } - } - - internal sealed class RunCustom : BehaviorTreeElement { public RunCustom(string name, int depth, int id) @@ -72,11 +61,6 @@ internal static RunRunSuccess GetRunRunSuccess() return new RunRunSuccess("", 1, 1); } - internal static Wait100msSuccess GetWaitSuccess() - { - return new Wait100msSuccess("", 1, 1); - } - internal static RunCustom GetRunCustom(IObservable customStream) { var custom = new RunCustom("", 1, 1); From 124ea9e908e1a54cc25c1e9e34e6345cc6c26b8c Mon Sep 17 00:00:00 2001 From: MystikalPooka Date: Sun, 30 Dec 2018 15:23:21 -0700 Subject: [PATCH 07/16] Update Default Asset Save Spot --- Assets/Visual Behavior Tree/Editor/CustomAssetUtitlity.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Visual Behavior Tree/Editor/CustomAssetUtitlity.cs b/Assets/Visual Behavior Tree/Editor/CustomAssetUtitlity.cs index 92cd2dc..8040170 100644 --- a/Assets/Visual Behavior Tree/Editor/CustomAssetUtitlity.cs +++ b/Assets/Visual Behavior Tree/Editor/CustomAssetUtitlity.cs @@ -11,7 +11,7 @@ public static void CreateAsset(string name = "") where T : ScriptableObject string path = AssetDatabase.GetAssetPath(Selection.activeObject); if (path == "") { - path = "Assets/Behaviors"; + path = "Assets/Visual Behavior Tree/Examples"; } else if (Path.GetExtension(path) != "") { From 5f3a78399f239cb2290b050555ae5711fb7f985a Mon Sep 17 00:00:00 2001 From: Pooka The Wolf Date: Sat, 15 Feb 2020 13:21:12 -0700 Subject: [PATCH 08/16] Saving and Loading working --- Assets/New Behavior Tree.asset | 87 + ...mdef.meta => New Behavior Tree.asset.meta} | 5 +- .../UniRx/Examples/Sample01_ObservableWWW.cs | 90 - .../Examples/Sample01_ObservableWWW.cs.meta | 12 - .../Examples/Sample02_ObservableTriggers.cs | 24 - .../Sample02_ObservableTriggers.cs.meta | 12 - .../Sample03_GameObjectAsObservable.cs | 23 - .../Sample03_GameObjectAsObservable.cs.meta | 12 - .../Sample04_ConvertFromUnityCallback.cs | 66 - .../Sample04_ConvertFromUnityCallback.cs.meta | 12 - .../Examples/Sample05_ConvertFromCoroutine.cs | 45 - .../Sample05_ConvertFromCoroutine.cs.meta | 12 - .../Examples/Sample06_ConvertToCoroutine.cs | 62 - .../Sample06_ConvertToCoroutine.cs.meta | 12 - .../Sample07_OrchestratIEnumerator.cs | 45 - .../Sample07_OrchestratIEnumerator.cs.meta | 12 - .../Examples/Sample08_DetectDoubleClick.cs | 32 - .../Sample08_DetectDoubleClick.cs.meta | 12 - .../UniRx/Examples/Sample09_EventHandling.cs | 69 - .../Examples/Sample09_EventHandling.cs.meta | 12 - .../Examples/Sample10_MainThreadDispatcher.cs | 48 - .../Sample10_MainThreadDispatcher.cs.meta | 12 - .../Plugins/UniRx/Examples/Sample11_Logger.cs | 41 - .../UniRx/Examples/Sample11_Logger.cs.meta | 12 - .../UniRx/Examples/Sample12Scene.unity | 1535 -------------- .../UniRx/Examples/Sample12Scene.unity.meta | 8 - .../Examples/Sample12_ReactiveProperty.cs | 77 - .../Sample12_ReactiveProperty.cs.meta | 12 - .../UniRx/Examples/Sample13Scene.unity | 1300 ------------ .../UniRx/Examples/Sample13Scene.unity.meta | 8 - .../UniRx/Examples/Sample13_ToDoApp.cs | 68 - .../UniRx/Examples/Sample13_ToDoApp.cs.meta | 12 - .../UniRx/Examples/Sample13_ToDoItem.prefab | 284 --- .../UniRx/Examples/UniRx.Examples.asmdef | 13 - Assets/Plugins/UniRx/ReadMe.txt.meta | 2 +- Assets/Plugins/UniRx/Scripts.meta | 5 +- .../Plugins/UniRx/Scripts/Async/AsyncUnit.cs | 28 - .../CancellationTokenEqualityComparer.cs | 25 - .../Async/CancellationTokenExtensions.cs | 76 - .../CancellationTokenSourceExtensions.cs | 48 - .../UniRx/Scripts/Async/CompilerServices.meta | 8 - .../AsyncMethodBuilderAttribute.cs | 18 - .../AsyncMethodBuilderAttribute.cs.meta | 11 - .../AsyncUniTaskMethodBuilder.cs | 274 --- .../AsyncUniTaskMethodBuilder.cs.meta | 11 - .../AsyncUniTaskVoidMethodBuilder.cs | 90 - .../AsyncUniTaskVoidMethodBuilder.cs.meta | 11 - .../Async/CompilerServices/MoveNextRunner.cs | 23 - .../CompilerServices/MoveNextRunner.cs.meta | 11 - .../Scripts/Async/DiagnosticsExtensions.cs | 270 --- .../Async/DiagnosticsExtensions.cs.meta | 11 - .../Plugins/UniRx/Scripts/Async/Editor.meta | 8 - .../Scripts/Async/Editor/SplitterGUILayout.cs | 64 - .../Async/Editor/SplitterGUILayout.cs.meta | 11 - .../Async/Editor/UniRx.Async.Editor.asmdef | 12 - .../Async/Editor/UniTaskTrackerTreeView.cs | 180 -- .../Editor/UniTaskTrackerTreeView.cs.meta | 11 - .../Async/Editor/UniTaskTrackerWindow.cs | 211 -- .../Async/Editor/UniTaskTrackerWindow.cs.meta | 11 - .../Async/EnumerableAsyncExtensions.cs | 36 - .../Async/EnumerableAsyncExtensions.cs.meta | 11 - .../Async/EnumeratorAsyncExtensions.cs | 149 -- .../Async/EnumeratorAsyncExtensions.cs.meta | 11 - .../Plugins/UniRx/Scripts/Async/IAwaiter.cs | 64 - .../UniRx/Scripts/Async/IAwaiter.cs.meta | 11 - .../Plugins/UniRx/Scripts/Async/Internal.meta | 8 - .../UniRx/Scripts/Async/Internal/ArrayPool.cs | 152 -- .../Scripts/Async/Internal/ArrayPool.cs.meta | 12 - .../Scripts/Async/Internal/ArrayPoolUtil.cs | 112 - .../Async/Internal/ArrayPoolUtil.cs.meta | 12 - .../UniRx/Scripts/Async/Internal/ArrayUtil.cs | 75 - .../Scripts/Async/Internal/ArrayUtil.cs.meta | 12 - .../Async/Internal/CancellationTokenHelper.cs | 32 - .../Internal/CancellationTokenHelper.cs.meta | 11 - .../Async/Internal/ContinuationQueue.cs | 115 - .../Async/Internal/ContinuationQueue.cs.meta | 11 - .../UniRx/Scripts/Async/Internal/Error.cs | 63 - .../Scripts/Async/Internal/Error.cs.meta | 12 - .../UniRx/Scripts/Async/Internal/Hack.cs | 23 - .../UniRx/Scripts/Async/Internal/Hack.cs.meta | 11 - .../Scripts/Async/Internal/LazyPromise.cs | 130 -- .../Async/Internal/LazyPromise.cs.meta | 11 - .../Scripts/Async/Internal/MinimumQueue.cs | 122 -- .../Async/Internal/MinimumQueue.cs.meta | 11 - .../Async/Internal/PlayerLoopRunner.cs | 153 -- .../Async/Internal/PlayerLoopRunner.cs.meta | 11 - .../Scripts/Async/Internal/PromiseHelper.cs | 34 - .../Scripts/Async/Internal/ReusablePromise.cs | 399 ---- .../Async/Internal/ReusablePromise.cs.meta | 11 - .../Internal/RuntimeHelpersAbstraction.cs | 62 - .../RuntimeHelpersAbstraction.cs.meta | 12 - .../Scripts/Async/Internal/TaskTracker.cs | 150 -- .../Async/Internal/TaskTracker.cs.meta | 11 - .../Scripts/Async/Internal/WeakDictionary.cs | 334 --- .../Async/Internal/WeakDictionary.cs.meta | 11 - .../UniRx/Scripts/Async/PlayerLoopHelper.cs | 125 -- .../Scripts/Async/PlayerLoopHelper.cs.meta | 11 - .../Plugins/UniRx/Scripts/Async/Progress.cs | 87 - .../UniRx/Scripts/Async/Progress.cs.meta | 11 - .../Plugins/UniRx/Scripts/Async/Triggers.meta | 8 - .../Async/Triggers/AsyncAnimatorTrigger.cs | 54 - .../Triggers/AsyncAnimatorTrigger.cs.meta | 11 - .../Async/Triggers/AsyncAwakeTrigger.cs | 55 - .../Async/Triggers/AsyncAwakeTrigger.cs.meta | 11 - .../Async/Triggers/AsyncBeginDragTrigger.cs | 41 - .../Triggers/AsyncBeginDragTrigger.cs.meta | 11 - .../Async/Triggers/AsyncCancelTrigger.cs | 41 - .../Async/Triggers/AsyncCancelTrigger.cs.meta | 11 - .../AsyncCanvasGroupChangedTrigger.cs | 41 - .../AsyncCanvasGroupChangedTrigger.cs.meta | 11 - .../Async/Triggers/AsyncCollision2DTrigger.cs | 69 - .../Triggers/AsyncCollision2DTrigger.cs.meta | 11 - .../Async/Triggers/AsyncCollisionTrigger.cs | 69 - .../Triggers/AsyncCollisionTrigger.cs.meta | 11 - .../Async/Triggers/AsyncDeselectTrigger.cs | 41 - .../Triggers/AsyncDeselectTrigger.cs.meta | 11 - .../Async/Triggers/AsyncDestroyTrigger.cs | 93 - .../Triggers/AsyncDestroyTrigger.cs.meta | 11 - .../Async/Triggers/AsyncDragTrigger.cs | 41 - .../Async/Triggers/AsyncDragTrigger.cs.meta | 11 - .../Async/Triggers/AsyncDropTrigger.cs | 41 - .../Async/Triggers/AsyncDropTrigger.cs.meta | 11 - .../Triggers/AsyncEnableDisableTrigger.cs | 55 - .../AsyncEnableDisableTrigger.cs.meta | 11 - .../Async/Triggers/AsyncEndDragTrigger.cs | 41 - .../Triggers/AsyncEndDragTrigger.cs.meta | 11 - .../Async/Triggers/AsyncEventTrigger.cs | 264 --- .../Async/Triggers/AsyncEventTrigger.cs.meta | 11 - .../Async/Triggers/AsyncFixedUpdateTrigger.cs | 41 - .../Triggers/AsyncFixedUpdateTrigger.cs.meta | 11 - .../AsyncInitializePotentialDragTrigger.cs | 41 - ...syncInitializePotentialDragTrigger.cs.meta | 11 - .../Async/Triggers/AsyncJointTrigger.cs | 55 - .../Async/Triggers/AsyncJointTrigger.cs.meta | 11 - .../Async/Triggers/AsyncLateUpdateTrigger.cs | 41 - .../Triggers/AsyncLateUpdateTrigger.cs.meta | 11 - .../Async/Triggers/AsyncMouseTrigger.cs | 129 -- .../Async/Triggers/AsyncMouseTrigger.cs.meta | 11 - .../Async/Triggers/AsyncMoveTrigger.cs | 41 - .../Async/Triggers/AsyncMoveTrigger.cs.meta | 11 - .../Async/Triggers/AsyncParticleTrigger.cs | 41 - .../Triggers/AsyncParticleTrigger.cs.meta | 11 - .../Triggers/AsyncPointerClickTrigger.cs | 41 - .../Triggers/AsyncPointerClickTrigger.cs.meta | 11 - .../Async/Triggers/AsyncPointerDownTrigger.cs | 41 - .../Triggers/AsyncPointerDownTrigger.cs.meta | 11 - .../Triggers/AsyncPointerEnterTrigger.cs | 41 - .../Triggers/AsyncPointerEnterTrigger.cs.meta | 11 - .../Async/Triggers/AsyncPointerExitTrigger.cs | 41 - .../Triggers/AsyncPointerExitTrigger.cs.meta | 11 - .../Async/Triggers/AsyncPointerUpTrigger.cs | 41 - .../Triggers/AsyncPointerUpTrigger.cs.meta | 11 - .../Triggers/AsyncRectTransformTrigger.cs | 55 - .../AsyncRectTransformTrigger.cs.meta | 11 - .../Async/Triggers/AsyncScrollTrigger.cs | 41 - .../Async/Triggers/AsyncScrollTrigger.cs.meta | 11 - .../Async/Triggers/AsyncSelectTrigger.cs | 41 - .../Async/Triggers/AsyncSelectTrigger.cs.meta | 11 - .../Async/Triggers/AsyncStartTrigger.cs | 64 - .../Async/Triggers/AsyncStartTrigger.cs.meta | 11 - .../Async/Triggers/AsyncSubmitTrigger.cs | 41 - .../Async/Triggers/AsyncSubmitTrigger.cs.meta | 11 - .../Triggers/AsyncTransformChangedTrigger.cs | 69 - .../AsyncTransformChangedTrigger.cs.meta | 11 - .../Async/Triggers/AsyncTrigger2DTrigger.cs | 69 - .../Triggers/AsyncTrigger2DTrigger.cs.meta | 11 - .../Async/Triggers/AsyncTriggerBase.cs | 271 --- .../Async/Triggers/AsyncTriggerBase.cs.meta | 11 - .../Async/Triggers/AsyncTriggerExtensions.cs | 511 ----- .../Triggers/AsyncTriggerExtensions.cs.meta | 11 - .../Async/Triggers/AsyncTriggerTrigger.cs | 69 - .../Triggers/AsyncTriggerTrigger.cs.meta | 11 - .../Triggers/AsyncUpdateSelectedTrigger.cs | 41 - .../AsyncUpdateSelectedTrigger.cs.meta | 11 - .../Async/Triggers/AsyncUpdateTrigger.cs | 41 - .../Async/Triggers/AsyncUpdateTrigger.cs.meta | 11 - .../Async/Triggers/AsyncVisibleTrigger.cs | 55 - .../Triggers/AsyncVisibleTrigger.cs.meta | 11 - .../UniRx/Scripts/Async/UniRx.Async.asmdef | 8 - .../UniRx/Scripts/Async/UniTask.Bridge.cs | 20 - .../Scripts/Async/UniTask.Bridge.cs.meta | 11 - .../UniRx/Scripts/Async/UniTask.Delay.cs | 246 --- .../UniRx/Scripts/Async/UniTask.Delay.cs.meta | 11 - .../UniRx/Scripts/Async/UniTask.Factory.cs | 121 -- .../Scripts/Async/UniTask.Factory.cs.meta | 11 - .../UniRx/Scripts/Async/UniTask.Run.cs | 58 - .../UniRx/Scripts/Async/UniTask.Run.cs.meta | 11 - .../UniRx/Scripts/Async/UniTask.Threading.cs | 184 -- .../Scripts/Async/UniTask.Threading.cs.meta | 11 - .../UniRx/Scripts/Async/UniTask.WaitUntil.cs | 235 --- .../Scripts/Async/UniTask.WaitUntil.cs.meta | 11 - .../Async/UniTask.WhenAll.Generated.cs | 1863 ----------------- .../Async/UniTask.WhenAll.Generated.cs.meta | 11 - .../UniRx/Scripts/Async/UniTask.WhenAll.cs | 298 --- .../Scripts/Async/UniTask.WhenAll.cs.meta | 11 - .../Async/UniTask.WhenAny.Generated.cs | 1527 -------------- .../Async/UniTask.WhenAny.Generated.cs.meta | 11 - .../UniRx/Scripts/Async/UniTask.WhenAny.cs | 374 ---- .../Scripts/Async/UniTask.WhenAny.cs.meta | 11 - Assets/Plugins/UniRx/Scripts/Async/UniTask.cs | 479 ----- .../UniRx/Scripts/Async/UniTask.cs.meta | 11 - .../Scripts/Async/UniTaskCompletionSource.cs | 413 ---- .../Async/UniTaskCompletionSource.cs.meta | 11 - .../Async/UniTaskExtensions.Shorthand.cs | 53 - .../Async/UniTaskExtensions.Shorthand.cs.meta | 11 - .../UniRx/Scripts/Async/UniTaskExtensions.cs | 506 ----- .../Scripts/Async/UniTaskExtensions.cs.meta | 11 - .../UniRx/Scripts/Async/UniTaskScheduler.cs | 106 - .../Scripts/Async/UniTaskScheduler.cs.meta | 11 - .../UniRx/Scripts/Async/UniTaskVoid.cs | 52 - .../UniRx/Scripts/Async/UniTaskVoid.cs.meta | 11 - .../Async/UnityAsyncExtensions.Jobs.cs | 140 -- .../Async/UnityAsyncExtensions.Jobs.cs.meta | 11 - .../Scripts/Async/UnityAsyncExtensions.cs | 702 ------- .../Async/UnityAsyncExtensions.cs.meta | 11 - .../Async/UnityAsyncExtensions.uGUI.cs | 434 ---- .../Async/UnityAsyncExtensions.uGUI.cs.meta | 11 - .../Plugins/UniRx/Scripts/Asynchronous.meta | 5 +- .../Asynchronous/WebRequestExtensions.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Disposables.meta | 5 +- .../Disposables/BooleanDisposable.cs.meta | 2 +- .../CancellationDisposable.cs.meta | 2 +- .../Disposables/CompositeDisposable.cs.meta | 2 +- .../Disposables/DictionaryDisposable.cs.meta | 2 +- .../Scripts/Disposables/Disposable.cs.meta | 2 +- .../Disposables/DisposableExtensions.cs.meta | 2 +- .../Scripts/Disposables/ICancelable.cs.meta | 2 +- .../MultipleAssignmentDisposable.cs.meta | 2 +- .../Disposables/RefCountDisposable.cs.meta | 2 +- .../Disposables/ScheduledDisposable.cs.meta | 2 +- .../Disposables/SerialDisposable.cs.meta | 2 +- .../SingleAssignmentDisposable.cs.meta | 2 +- .../StableCompositeDisposable.cs.meta | 2 +- .../UniRx/Scripts/EventPattern.cs.meta | 2 +- .../Plugins/UniRx/Scripts/InternalUtil.meta | 5 +- .../Scripts/InternalUtil/AscynLock.cs.meta | 2 +- .../CancellableTaskCompletionSource.cs | 23 + .../CancellableTaskCompletionSource.cs.meta} | 2 +- .../InternalUtil/ExceptionExtensions.cs.meta | 2 +- .../InternalUtil/ImmutableList.cs.meta | 2 +- .../Scripts/InternalUtil/ListObserver.cs.meta | 2 +- .../InternalUtil/MicroCoroutine.cs.meta | 2 +- .../InternalUtil/PriorityQueue.cs.meta | 2 +- .../Scripts/InternalUtil/PromiseHelper.cs | 26 + .../PromiseHelper.cs.meta | 2 +- .../InternalUtil/ScheduledItem.cs.meta | 2 +- .../ThreadSafeQueueWorker.cs.meta | 2 +- .../UnityEqualityComparer.cs | 16 +- .../UnityEqualityComparer.cs.meta | 2 +- .../UniRx/Scripts/Notification.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Notifiers.meta | 5 +- .../Scripts/Notifiers/BooleanNotifier.cs.meta | 2 +- .../Scripts/Notifiers/CountNotifier.cs.meta | 2 +- .../Scripts/Notifiers/MessageBroker.cs.meta | 2 +- .../Notifiers/ScheduledNotifier.cs.meta | 2 +- .../Scripts/Observable.Aggregate.cs.meta | 2 +- .../UniRx/Scripts/Observable.Awaiter.cs.meta | 2 +- .../UniRx/Scripts/Observable.Binding.cs.meta | 2 +- .../UniRx/Scripts/Observable.Blocking.cs.meta | 2 +- .../Scripts/Observable.Concatenate.cs.meta | 2 +- .../Scripts/Observable.Concurrency.cs.meta | 2 +- .../Scripts/Observable.Conversions.cs.meta | 2 +- .../UniRx/Scripts/Observable.Creation.cs.meta | 2 +- .../Scripts/Observable.ErrorHandling.cs.meta | 2 +- .../UniRx/Scripts/Observable.Events.cs.meta | 2 +- .../Scripts/Observable.FromAsync.cs.meta | 2 +- .../UniRx/Scripts/Observable.Joins.cs.meta | 2 +- .../UniRx/Scripts/Observable.Paging.cs | 1 + .../UniRx/Scripts/Observable.Paging.cs.meta | 2 +- .../UniRx/Scripts/Observable.Time.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Observable.cs | 1 + .../Plugins/UniRx/Scripts/Observable.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Observer.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Operators.meta | 5 +- .../UniRx/Scripts/Operators/Aggregate.cs.meta | 2 +- .../UniRx/Scripts/Operators/Amb.cs.meta | 2 +- .../Scripts/Operators/AsObservable.cs.meta | 2 +- .../Operators/AsSingleUnitObservable.cs.meta | 2 +- .../Operators/AsUnitObservable.cs.meta | 2 +- .../UniRx/Scripts/Operators/Buffer.cs.meta | 2 +- .../UniRx/Scripts/Operators/Cast.cs.meta | 2 +- .../UniRx/Scripts/Operators/Catch.cs.meta | 2 +- .../Scripts/Operators/CombineLatest.cs.meta | 2 +- .../UniRx/Scripts/Operators/Concat.cs.meta | 2 +- .../Scripts/Operators/ContinueWith.cs.meta | 2 +- .../UniRx/Scripts/Operators/Create.cs.meta | 2 +- .../Scripts/Operators/DefaultIfEmpty.cs.meta | 2 +- .../UniRx/Scripts/Operators/Defer.cs.meta | 2 +- .../UniRx/Scripts/Operators/Delay.cs.meta | 2 +- .../Operators/DelaySubscription.cs.meta | 2 +- .../Scripts/Operators/Dematerialize.cs.meta | 2 +- .../UniRx/Scripts/Operators/Distinct.cs.meta | 2 +- .../Operators/DistinctUntilChanged.cs.meta | 2 +- .../UniRx/Scripts/Operators/Do.cs.meta | 2 +- .../UniRx/Scripts/Operators/Empty.cs.meta | 2 +- .../UniRx/Scripts/Operators/Finally.cs.meta | 2 +- .../UniRx/Scripts/Operators/First.cs.meta | 2 +- .../Scripts/Operators/ForEachAsync.cs.meta | 2 +- .../UniRx/Scripts/Operators/FromEvent.cs.meta | 2 +- .../UniRx/Scripts/Operators/GroupBy.cs.meta | 2 +- .../Scripts/Operators/IgnoreElements.cs.meta | 2 +- .../UniRx/Scripts/Operators/Last.cs.meta | 2 +- .../Scripts/Operators/Materialize.cs.meta | 2 +- .../UniRx/Scripts/Operators/Merge.cs.meta | 2 +- .../UniRx/Scripts/Operators/Never.cs.meta | 2 +- .../UniRx/Scripts/Operators/ObserveOn.cs.meta | 2 +- .../UniRx/Scripts/Operators/OfType.cs.meta | 2 +- .../Operators/OperatorObservableBase.cs.meta | 2 +- .../Operators/OperatorObserverBase.cs.meta | 2 +- .../UniRx/Scripts/Operators/PairWise.cs.meta | 2 +- .../UniRx/Scripts/Operators/Range.cs.meta | 2 +- .../UniRx/Scripts/Operators/RefCount.cs.meta | 2 +- .../UniRx/Scripts/Operators/Repeat.cs.meta | 2 +- .../Scripts/Operators/RepeatSafe.cs.meta | 2 +- .../UniRx/Scripts/Operators/Return.cs.meta | 2 +- .../UniRx/Scripts/Operators/Sample.cs.meta | 2 +- .../UniRx/Scripts/Operators/Scan.cs.meta | 2 +- .../UniRx/Scripts/Operators/Select.cs.meta | 2 +- .../Scripts/Operators/SelectMany.cs.meta | 2 +- .../Scripts/Operators/SelectWhere.cs.meta | 2 +- .../UniRx/Scripts/Operators/Single.cs.meta | 2 +- .../UniRx/Scripts/Operators/Skip.cs.meta | 2 +- .../UniRx/Scripts/Operators/SkipUntil.cs.meta | 2 +- .../UniRx/Scripts/Operators/SkipWhile.cs.meta | 2 +- .../UniRx/Scripts/Operators/Start.cs.meta | 2 +- .../UniRx/Scripts/Operators/StartWith.cs.meta | 2 +- .../Scripts/Operators/SubscribeOn.cs.meta | 2 +- .../UniRx/Scripts/Operators/Switch.cs.meta | 2 +- .../Scripts/Operators/Synchronize.cs.meta | 2 +- .../Operators/SynchronizedObserver.cs.meta | 2 +- .../UniRx/Scripts/Operators/Take.cs.meta | 2 +- .../UniRx/Scripts/Operators/TakeLast.cs.meta | 2 +- .../UniRx/Scripts/Operators/TakeUntil.cs.meta | 2 +- .../UniRx/Scripts/Operators/TakeWhile.cs.meta | 2 +- .../UniRx/Scripts/Operators/Throttle.cs.meta | 2 +- .../Scripts/Operators/ThrottleFirst.cs.meta | 2 +- .../UniRx/Scripts/Operators/Throw.cs.meta | 2 +- .../Scripts/Operators/TimeInterval.cs.meta | 2 +- .../UniRx/Scripts/Operators/Timeout.cs.meta | 2 +- .../UniRx/Scripts/Operators/Timer.cs.meta | 2 +- .../UniRx/Scripts/Operators/Timestamp.cs.meta | 2 +- .../UniRx/Scripts/Operators/ToArray.cs.meta | 2 +- .../UniRx/Scripts/Operators/ToList.cs.meta | 2 +- .../Scripts/Operators/ToObservable.cs.meta | 2 +- .../UniRx/Scripts/Operators/Wait.cs.meta | 2 +- .../UniRx/Scripts/Operators/WhenAll.cs.meta | 2 +- .../UniRx/Scripts/Operators/Where.cs.meta | 2 +- .../Scripts/Operators/WhereSelect.cs.meta | 2 +- .../Scripts/Operators/WithLatestFrom.cs.meta | 2 +- .../UniRx/Scripts/Operators/Zip.cs.meta | 2 +- .../UniRx/Scripts/Operators/ZipLatest.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Pair.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Schedulers.meta | 5 +- .../Schedulers/CurrentThreadScheduler.cs.meta | 2 +- .../Scripts/Schedulers/IScheduler.cs.meta | 2 +- .../Schedulers/ImmediateScheduler.cs.meta | 2 +- .../Scripts/Schedulers/Scheduler.cs.meta | 2 +- .../Schedulers/ThreadPoolScheduler.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Subjects.meta | 5 +- .../Scripts/Subjects/AsyncSubject.cs.meta | 2 +- .../Scripts/Subjects/BehaviorSubject.cs.meta | 2 +- .../Subjects/ConnectableObservable.cs.meta | 2 +- .../UniRx/Scripts/Subjects/ISubject.cs.meta | 2 +- .../Scripts/Subjects/ReplaySubject.cs.meta | 2 +- .../UniRx/Scripts/Subjects/Subject.cs.meta | 2 +- .../Subjects/SubjectExtensions.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/System.meta | 5 +- .../UniRx/Scripts/System/IObservable.cs.meta | 2 +- .../UniRx/Scripts/System/IObserver.cs.meta | 2 +- .../System/IOptimizedObservable.cs.meta | 2 +- .../UniRx/Scripts/System/IProgress.cs.meta | 2 +- .../UniRx/Scripts/System/Tuple.cs.meta | 2 +- .../Plugins/UniRx/Scripts/System/Unit.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/Tasks.meta | 5 +- .../Tasks/TaskObservableExtensions.cs.meta | 2 +- .../Tasks/UniTaskObservableExtensions.cs | 246 --- .../Tasks/UniTaskObservableExtensions.cs.meta | 11 - .../UniRx/Scripts/TimeInterval.cs.meta | 2 +- .../Plugins/UniRx/Scripts/Timestamped.cs.meta | 2 +- Assets/Plugins/UniRx/Scripts/UniRx.asmdef | 12 +- .../UniRx/Scripts/UnityEngineBridge.meta | 5 +- .../AsyncOperationExtensions.cs.meta | 2 +- .../CancellationToken.cs.meta | 2 +- .../CoroutineAsyncBridge.cs.meta | 2 +- .../UnityEngineBridge/Diagnostics.meta | 5 +- .../Diagnostics/LogEntry.cs.meta | 2 +- .../Diagnostics/LogEntryExtensions.cs.meta | 2 +- .../Diagnostics/Logger.cs.meta | 2 +- .../ObservableDebugExtensions.cs.meta | 2 +- .../Diagnostics/ObservableLogger.cs.meta | 2 +- .../Diagnostics/UnityDebugSink.cs.meta | 2 +- .../UnityEngineBridge/FrameInterval.cs.meta | 2 +- .../InspectableReactiveProperty.cs | 1 + .../InspectableReactiveProperty.cs.meta | 2 +- .../InspectorDisplayDrawer.cs.meta | 2 +- .../LifetimeDisposableExtensions.cs.meta | 2 +- .../MainThreadDispatcher.cs.meta | 2 +- .../MainThreadScheduler.cs.meta | 2 +- .../Observable.Unity.cs.meta | 2 +- .../UnityEngineBridge/ObservableWWW.cs.meta | 2 +- .../UnityEngineBridge/ObserveExtensions.cs | 1 + .../ObserveExtensions.cs.meta | 2 +- .../Scripts/UnityEngineBridge/Operators.meta | 5 +- .../Operators/BatchFrame.cs.meta | 2 +- .../Operators/DelayFrame.cs.meta | 2 +- .../Operators/DelayFrameSubscription.cs.meta | 2 +- .../Operators/FrameInterval.cs.meta | 2 +- .../Operators/FrameTimeInterval.cs.meta | 2 +- .../Operators/FromCoroutine.cs.meta | 2 +- .../Operators/RepeatUntil.cs.meta | 2 +- .../Operators/SampleFrame.cs.meta | 2 +- .../Operators/SubscribeOnMainThread.cs.meta | 2 +- .../Operators/ThrottleFirstFrame.cs.meta | 2 +- .../Operators/ThrottleFrame.cs.meta | 2 +- .../Operators/TimeoutFrame.cs.meta | 2 +- .../ReactiveCollection.cs.meta | 2 +- .../UnityEngineBridge/ReactiveCommand.cs | 207 +- .../UnityEngineBridge/ReactiveCommand.cs.meta | 2 +- .../ReactiveDictionary.cs.meta | 2 +- .../UnityEngineBridge/ReactiveProperty.cs | 192 +- .../ReactiveProperty.cs.meta | 2 +- .../ReactivePropertyReusablePromise.cs | 140 -- .../ReactivePropertyReusablePromise.cs.meta | 11 - .../ScenePlaybackDetector.cs.meta | 2 +- .../Scripts/UnityEngineBridge/Toolkit.meta | 5 +- .../Toolkit/ObjectPool.cs.meta | 2 +- .../Scripts/UnityEngineBridge/Triggers.meta | 5 +- .../ObservableAnimatorTrigger.cs.meta | 2 +- .../ObservableBeginDragTrigger.cs.meta | 2 +- .../Triggers/ObservableCancelTrigger.cs.meta | 2 +- ...bservableCanvasGroupChangedTrigger.cs.meta | 2 +- .../ObservableCollision2DTrigger.cs.meta | 2 +- .../ObservableCollisionTrigger.cs.meta | 2 +- .../ObservableDeselectTrigger.cs.meta | 2 +- .../Triggers/ObservableDestroyTrigger.cs.meta | 2 +- .../Triggers/ObservableDragTrigger.cs.meta | 2 +- .../Triggers/ObservableDropTrigger.cs.meta | 2 +- .../Triggers/ObservableEnableTrigger.cs.meta | 2 +- .../Triggers/ObservableEndDragTrigger.cs.meta | 2 +- .../Triggers/ObservableEventTrigger.cs.meta | 2 +- .../ObservableFixedUpdateTrigger.cs.meta | 2 +- ...ableInitializePotentialDragTrigger.cs.meta | 2 +- .../ObservableLateUpdateTrigger.cs.meta | 2 +- .../Triggers/ObservableMouseTrigger.cs.meta | 2 +- .../Triggers/ObservableMoveTrigger.cs.meta | 2 +- .../ObservableParticleTrigger.cs.meta | 2 +- .../ObservablePointerClickTrigger.cs.meta | 2 +- .../ObservablePointerDownTrigger.cs.meta | 2 +- .../ObservablePointerEnterTrigger.cs.meta | 2 +- .../ObservablePointerExitTrigger.cs.meta | 2 +- .../ObservablePointerUpTrigger.cs.meta | 2 +- .../ObservableRectTransformTrigger.cs.meta | 2 +- .../Triggers/ObservableScrollTrigger.cs.meta | 2 +- .../Triggers/ObservableSelectTrigger.cs.meta | 2 +- .../ObservableStateMachineTrigger.cs.meta | 2 +- .../Triggers/ObservableSubmitTrigger.cs.meta | 2 +- .../ObservableTransformChangedTrigger.cs.meta | 2 +- .../ObservableTrigger2DTrigger.cs.meta | 2 +- .../Triggers/ObservableTriggerBase.cs.meta | 2 +- ...ervableTriggerExtensions.Component.cs.meta | 2 +- .../ObservableTriggerExtensions.cs.meta | 2 +- .../Triggers/ObservableTriggerTrigger.cs.meta | 2 +- .../ObservableUpdateSelectedTrigger.cs.meta | 2 +- .../Triggers/ObservableUpdateTrigger.cs.meta | 2 +- .../Triggers/ObservableVisibleTrigger.cs.meta | 2 +- .../UnityEventExtensions.cs.meta | 2 +- .../UnityGraphicExtensions.cs.meta | 2 +- .../UnityUIComponentExtensions.cs.meta | 2 +- .../YieldInstructionCache.cs.meta | 2 +- .../UniRx/Scripts/UnityWinRTBridge.meta | 5 +- .../Scripts/UnityWinRTBridge/Thread.cs.meta | 2 +- .../ThreadPoolScheduler_UnityWinRT.cs.meta | 2 +- Assets/TestScene.unity | 168 +- Assets/TestSceneSettings.lighting | 62 + ...b.meta => TestSceneSettings.lighting.meta} | 6 +- Assets/VFXDefaultResources.asset | 82 + Assets/VFXDefaultResources.asset.meta | 8 + Assets/Visual Behavior Tree/Editor.meta | 2 +- .../BehaviorExtensions.cs | 4 +- .../BehaviorExtensions.cs.meta | 0 .../Editor/BehaviorLogDrawer.cs | 179 -- .../Editor/BehaviorLogDrawer.cs.meta | 13 - .../Editor/BehaviorManagerEditor.cs | 35 - .../Editor/BehaviorManagerEditor.cs.meta | 13 - .../MultiColumnBehaviorTreeView.cs | 11 +- .../Editor/BuiltInResourcesWindow.cs | 229 ++ .../Editor/BuiltInResourcesWindow.cs.meta} | 2 +- .../Visual Behavior Tree/Editor/CustomGUI.cs | 31 - .../Editor/CustomGUI.cs.meta | 13 - .../Editor/Drawing.meta} | 2 +- .../Editor/NodeEditor.meta} | 2 +- .../Editor/NodeEditor/BehaviorEditorNode.cs | 206 ++ .../NodeEditor/BehaviorEditorNode.cs.meta} | 2 +- .../NodeEditor/BehaviorNodeEditorWindow.cs | 355 ++++ .../BehaviorNodeEditorWindow.cs.meta} | 2 +- .../Editor/NodeEditor/Connection.cs | 42 + .../Editor/NodeEditor/Connection.cs.meta | 11 + .../Editor/NodeEditor/ConnectionPoint.cs | 53 + .../Editor/NodeEditor/ConnectionPoint.cs.meta | 11 + .../Editor/TreeDebuggerWindow.cs | 154 -- .../Editor/TreeDebuggerWindow.cs.meta | 13 - .../Visual Behavior Tree/Editor/TreeLoader.cs | 89 + .../Editor/TreeLoader.cs.meta | 11 + .../Visual Behavior Tree/Editor/TreeSaver.cs | 79 + .../Editor/TreeSaver.cs.meta | 11 + .../Editor/TreeValidator.cs | 47 + .../Editor/TreeValidator.cs.meta | 11 + .../Editor/TypeDependantDrawer.cs | 82 - .../Editor/TypeDependantDrawer.cs.meta | 13 - .../Editor/uVBT-Editor.asmdef.meta | 7 - ...{uVBT-Editor.asmdef => uVBT.Editor.asmdef} | 2 +- .../Editor/uVBT.Editor.asmdef.meta} | 2 +- .../New BehaviorTreeManagerAsset 5.asset | 28 + .../New BehaviorTreeManagerAsset 5.asset.meta | 8 + .../New BehaviorTreeManagerAsset 6.asset | 20 + .../New BehaviorTreeManagerAsset 6.asset.meta | 8 + .../Visual Behavior Tree/Examples/TEST.asset | 27 + .../Examples/TEST.asset.meta | 8 + .../Scripts/AI/BehaviorManager.cs | 1 - .../Scripts/AI/BehaviorTreeElement.cs | 13 +- .../Scripts/AI/Components/Merge.cs | 4 +- .../Scripts/AI/Nodes/DebugOutNode.cs | 4 +- .../Scripts/AI/Tree/TreeElement.cs | 16 +- .../Scripts/TreeNodeAsset.cs | 17 + .../Scripts/TreeNodeAsset.cs.meta | 11 + .../Visual Behavior Tree/Tests/MergeTests.cs | 4 +- .../Tests/uVBT-Tests.asmdef.meta | 7 - .../{uVBT-Tests.asmdef => uVBT.Tests.asmdef} | 2 +- .../Tests/uVBT.Tests.asmdef.meta} | 2 +- Logs/Packages-Update.log | 57 + Packages/manifest.json | 28 +- ProjectSettings/ProjectSettings.asset | 56 +- ProjectSettings/ProjectVersion.txt | 3 +- ProjectSettings/QualitySettings.asset | 46 +- ProjectSettings/VFXManager.asset | Bin 4148 -> 337 bytes ProjectSettings/VersionControlSettings.asset | 8 + UIElementsSchema/UIElements.xsd | 2 +- .../UnityEditor.Experimental.UIElements.xsd | 429 +++- .../UnityEditor.PackageManager.UI.xsd | 92 +- .../UnityEngine.Experimental.UIElements.xsd | 211 +- UserSettings/EditorUserSettings.asset | 25 + stuff | 31 + 542 files changed, 2965 insertions(+), 21211 deletions(-) create mode 100644 Assets/New Behavior Tree.asset rename Assets/{Plugins/UniRx/Examples/UniRx.Examples.asmdef.meta => New Behavior Tree.asset.meta} (54%) delete mode 100644 Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs delete mode 100644 Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample02_ObservableTriggers.cs delete mode 100644 Assets/Plugins/UniRx/Examples/Sample02_ObservableTriggers.cs.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample03_GameObjectAsObservable.cs delete mode 100644 Assets/Plugins/UniRx/Examples/Sample03_GameObjectAsObservable.cs.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample04_ConvertFromUnityCallback.cs delete mode 100644 Assets/Plugins/UniRx/Examples/Sample04_ConvertFromUnityCallback.cs.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs delete mode 100644 Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs delete mode 100644 Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample07_OrchestratIEnumerator.cs delete mode 100644 Assets/Plugins/UniRx/Examples/Sample07_OrchestratIEnumerator.cs.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample08_DetectDoubleClick.cs delete mode 100644 Assets/Plugins/UniRx/Examples/Sample08_DetectDoubleClick.cs.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample09_EventHandling.cs delete mode 100644 Assets/Plugins/UniRx/Examples/Sample09_EventHandling.cs.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample10_MainThreadDispatcher.cs delete mode 100644 Assets/Plugins/UniRx/Examples/Sample10_MainThreadDispatcher.cs.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample11_Logger.cs delete mode 100644 Assets/Plugins/UniRx/Examples/Sample11_Logger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample12Scene.unity delete mode 100644 Assets/Plugins/UniRx/Examples/Sample12Scene.unity.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample12_ReactiveProperty.cs delete mode 100644 Assets/Plugins/UniRx/Examples/Sample12_ReactiveProperty.cs.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample13Scene.unity delete mode 100644 Assets/Plugins/UniRx/Examples/Sample13Scene.unity.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample13_ToDoApp.cs delete mode 100644 Assets/Plugins/UniRx/Examples/Sample13_ToDoApp.cs.meta delete mode 100644 Assets/Plugins/UniRx/Examples/Sample13_ToDoItem.prefab delete mode 100644 Assets/Plugins/UniRx/Examples/UniRx.Examples.asmdef delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/AsyncUnit.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/CancellationTokenEqualityComparer.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/CancellationTokenExtensions.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/CancellationTokenSourceExtensions.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/CompilerServices.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncMethodBuilderAttribute.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncMethodBuilderAttribute.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskMethodBuilder.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskMethodBuilder.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/CompilerServices/MoveNextRunner.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/CompilerServices/MoveNextRunner.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/DiagnosticsExtensions.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/DiagnosticsExtensions.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Editor.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Editor/SplitterGUILayout.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Editor/SplitterGUILayout.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Editor/UniRx.Async.Editor.asmdef delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerTreeView.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerTreeView.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerWindow.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerWindow.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/EnumerableAsyncExtensions.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/EnumerableAsyncExtensions.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/EnumeratorAsyncExtensions.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/EnumeratorAsyncExtensions.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/IAwaiter.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/IAwaiter.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/CancellationTokenHelper.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/CancellationTokenHelper.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/ContinuationQueue.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/ContinuationQueue.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/Hack.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/Hack.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/LazyPromise.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/LazyPromise.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/MinimumQueue.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/MinimumQueue.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/PlayerLoopRunner.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/PlayerLoopRunner.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/PromiseHelper.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/ReusablePromise.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/ReusablePromise.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/TaskTracker.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/TaskTracker.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/WeakDictionary.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Internal/WeakDictionary.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/PlayerLoopHelper.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/PlayerLoopHelper.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Progress.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Progress.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAnimatorTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAnimatorTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAwakeTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAwakeTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncBeginDragTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncBeginDragTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCancelTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCancelTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCanvasGroupChangedTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCanvasGroupChangedTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollision2DTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollision2DTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollisionTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollisionTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDeselectTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDeselectTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDestroyTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDestroyTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDragTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDragTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDropTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDropTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEnableDisableTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEnableDisableTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEndDragTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEndDragTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEventTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEventTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncFixedUpdateTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncFixedUpdateTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncInitializePotentialDragTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncInitializePotentialDragTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncJointTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncJointTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncLateUpdateTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncLateUpdateTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMouseTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMouseTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMoveTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMoveTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncParticleTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncParticleTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerClickTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerClickTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerDownTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerDownTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerEnterTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerEnterTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerExitTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerExitTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerUpTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerUpTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncRectTransformTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncRectTransformTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncScrollTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncScrollTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSelectTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSelectTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncStartTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncStartTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSubmitTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSubmitTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTransformChangedTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTransformChangedTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTrigger2DTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTrigger2DTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerBase.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerBase.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerExtensions.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerExtensions.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateSelectedTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateSelectedTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncVisibleTrigger.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncVisibleTrigger.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniRx.Async.asmdef delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.Bridge.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.Bridge.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.Delay.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.Delay.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.Factory.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.Factory.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.Run.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.Run.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.Threading.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.Threading.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.WaitUntil.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.WaitUntil.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.Generated.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.Generated.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.Generated.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.Generated.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTask.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTaskCompletionSource.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTaskCompletionSource.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.Shorthand.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.Shorthand.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTaskScheduler.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTaskScheduler.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTaskVoid.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UniTaskVoid.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.Jobs.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.Jobs.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.uGUI.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.uGUI.cs.meta create mode 100644 Assets/Plugins/UniRx/Scripts/InternalUtil/CancellableTaskCompletionSource.cs rename Assets/Plugins/UniRx/Scripts/{Async/AsyncUnit.cs.meta => InternalUtil/CancellableTaskCompletionSource.cs.meta} (83%) create mode 100644 Assets/Plugins/UniRx/Scripts/InternalUtil/PromiseHelper.cs rename Assets/Plugins/UniRx/Scripts/{Async/Internal => InternalUtil}/PromiseHelper.cs.meta (83%) rename Assets/Plugins/UniRx/Scripts/{Async => InternalUtil}/UnityEqualityComparer.cs (98%) rename Assets/Plugins/UniRx/Scripts/{Async => InternalUtil}/UnityEqualityComparer.cs.meta (83%) delete mode 100644 Assets/Plugins/UniRx/Scripts/Tasks/UniTaskObservableExtensions.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/Tasks/UniTaskObservableExtensions.cs.meta delete mode 100644 Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactivePropertyReusablePromise.cs delete mode 100644 Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactivePropertyReusablePromise.cs.meta create mode 100644 Assets/TestSceneSettings.lighting rename Assets/{Plugins/UniRx/Examples/Sample13_ToDoItem.prefab.meta => TestSceneSettings.lighting.meta} (54%) create mode 100644 Assets/VFXDefaultResources.asset create mode 100644 Assets/VFXDefaultResources.asset.meta rename Assets/Visual Behavior Tree/Editor/{BehaviorTreeViewEditor => }/BehaviorExtensions.cs (97%) rename Assets/Visual Behavior Tree/Editor/{BehaviorTreeViewEditor => }/BehaviorExtensions.cs.meta (100%) delete mode 100644 Assets/Visual Behavior Tree/Editor/BehaviorLogDrawer.cs delete mode 100644 Assets/Visual Behavior Tree/Editor/BehaviorLogDrawer.cs.meta delete mode 100644 Assets/Visual Behavior Tree/Editor/BehaviorManagerEditor.cs delete mode 100644 Assets/Visual Behavior Tree/Editor/BehaviorManagerEditor.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/BuiltInResourcesWindow.cs rename Assets/{Plugins/UniRx/Scripts/Async/CancellationTokenEqualityComparer.cs.meta => Visual Behavior Tree/Editor/BuiltInResourcesWindow.cs.meta} (83%) delete mode 100644 Assets/Visual Behavior Tree/Editor/CustomGUI.cs delete mode 100644 Assets/Visual Behavior Tree/Editor/CustomGUI.cs.meta rename Assets/{Plugins/UniRx/Examples.meta => Visual Behavior Tree/Editor/Drawing.meta} (77%) rename Assets/{Plugins/UniRx/Scripts/Async.meta => Visual Behavior Tree/Editor/NodeEditor.meta} (77%) create mode 100644 Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs rename Assets/{Plugins/UniRx/Scripts/Async/CancellationTokenExtensions.cs.meta => Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs.meta} (83%) create mode 100644 Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs rename Assets/{Plugins/UniRx/Scripts/Async/CancellationTokenSourceExtensions.cs.meta => Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs.meta} (83%) create mode 100644 Assets/Visual Behavior Tree/Editor/NodeEditor/Connection.cs create mode 100644 Assets/Visual Behavior Tree/Editor/NodeEditor/Connection.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/NodeEditor/ConnectionPoint.cs create mode 100644 Assets/Visual Behavior Tree/Editor/NodeEditor/ConnectionPoint.cs.meta delete mode 100644 Assets/Visual Behavior Tree/Editor/TreeDebuggerWindow.cs delete mode 100644 Assets/Visual Behavior Tree/Editor/TreeDebuggerWindow.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/TreeLoader.cs create mode 100644 Assets/Visual Behavior Tree/Editor/TreeLoader.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/TreeSaver.cs create mode 100644 Assets/Visual Behavior Tree/Editor/TreeSaver.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/TreeValidator.cs create mode 100644 Assets/Visual Behavior Tree/Editor/TreeValidator.cs.meta delete mode 100644 Assets/Visual Behavior Tree/Editor/TypeDependantDrawer.cs delete mode 100644 Assets/Visual Behavior Tree/Editor/TypeDependantDrawer.cs.meta delete mode 100644 Assets/Visual Behavior Tree/Editor/uVBT-Editor.asmdef.meta rename Assets/Visual Behavior Tree/Editor/{uVBT-Editor.asmdef => uVBT.Editor.asmdef} (93%) rename Assets/{Plugins/UniRx/Scripts/Async/Editor/UniRx.Async.Editor.asmdef.meta => Visual Behavior Tree/Editor/uVBT.Editor.asmdef.meta} (76%) create mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset create mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset.meta create mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset create mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset.meta create mode 100644 Assets/Visual Behavior Tree/Examples/TEST.asset create mode 100644 Assets/Visual Behavior Tree/Examples/TEST.asset.meta create mode 100644 Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs create mode 100644 Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs.meta delete mode 100644 Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef.meta rename Assets/Visual Behavior Tree/Tests/{uVBT-Tests.asmdef => uVBT.Tests.asmdef} (93%) rename Assets/{Plugins/UniRx/Scripts/Async/UniRx.Async.asmdef.meta => Visual Behavior Tree/Tests/uVBT.Tests.asmdef.meta} (76%) create mode 100644 ProjectSettings/VersionControlSettings.asset create mode 100644 UserSettings/EditorUserSettings.asset create mode 100644 stuff diff --git a/Assets/New Behavior Tree.asset b/Assets/New Behavior Tree.asset new file mode 100644 index 0000000..9ddf5d1 --- /dev/null +++ b/Assets/New Behavior Tree.asset @@ -0,0 +1,87 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7130206f8e2d7e4b94035cb63f37007, type: 3} + m_Name: New Behavior Tree + m_EditorClassIdentifier: + positions: + - serializedVersion: 2 + x: 55 + y: 150 + width: 200 + height: 150 + - serializedVersion: 2 + x: 322 + y: 172 + width: 200 + height: 150 + - serializedVersion: 2 + x: 568 + y: 82 + width: 200 + height: 150 + - serializedVersion: 2 + x: 805 + y: 39 + width: 200 + height: 150 + - serializedVersion: 2 + x: 570 + y: 227 + width: 200 + height: 150 + - serializedVersion: 2 + x: 810 + y: 347 + width: 200 + height: 150 + - serializedVersion: 2 + x: 1061 + y: 344 + width: 200 + height: 150 + - serializedVersion: 2 + x: 796 + y: 187 + width: 200 + height: 150 + - serializedVersion: 2 + x: 1060 + y: 187 + width: 200 + height: 150 + treeElements: "[\r\n {\r\n \"debugOutText\": \"AWOOOOOOOO\",\r\n \"ElementType\": + \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n \"HasChildren\": true,\r\n + \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n \"Depth\": -1,\r\n \"name\": + \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"SucceedPercentToSucceed\": + 69.0,\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Merge\",\r\n + \"HasChildren\": true,\r\n \"Name\": \"Merge\",\r\n \"ID\": 0,\r\n \"Depth\": + 0,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"debugOutText\": + \"ALSO AWOOO\",\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n + \"HasChildren\": true,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n + \"Depth\": 1,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"debugOutText\": null,\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n + \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n + \"Depth\": 2,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"ElementType\": \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"HasChildren\": + true,\r\n \"Name\": \"Inverter\",\r\n \"ID\": 0,\r\n \"Depth\": 1,\r\n + \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"ElementType\": + \"Assets.Scripts.AI.Components.Selector\",\r\n \"HasChildren\": true,\r\n + \"Name\": \"Selector\",\r\n \"ID\": 0,\r\n \"Depth\": 2,\r\n \"name\": + \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Sequencer\",\r\n + \"HasChildren\": false,\r\n \"Name\": \"Sequencer\",\r\n \"ID\": 0,\r\n + \"Depth\": 3,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"ElementType\": \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"HasChildren\": + true,\r\n \"Name\": \"Inverter\",\r\n \"ID\": 0,\r\n \"Depth\": 2,\r\n + \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"ElementType\": + \"Assets.Scripts.AI.Components.Sequencer\",\r\n \"HasChildren\": false,\r\n + \"Name\": \"Sequencer\",\r\n \"ID\": 0,\r\n \"Depth\": 3,\r\n \"name\": + \"\",\r\n \"hideFlags\": 0\r\n }\r\n]" diff --git a/Assets/Plugins/UniRx/Examples/UniRx.Examples.asmdef.meta b/Assets/New Behavior Tree.asset.meta similarity index 54% rename from Assets/Plugins/UniRx/Examples/UniRx.Examples.asmdef.meta rename to Assets/New Behavior Tree.asset.meta index 0380f9f..2db324f 100644 --- a/Assets/Plugins/UniRx/Examples/UniRx.Examples.asmdef.meta +++ b/Assets/New Behavior Tree.asset.meta @@ -1,7 +1,8 @@ fileFormatVersion: 2 -guid: 71799519d12379b49b6b53aea974bea5 -AssemblyDefinitionImporter: +guid: 7582ae5e6ac4036408cbbc9d5fd58439 +NativeFormatImporter: externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs b/Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs deleted file mode 100644 index 0c629da..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs +++ /dev/null @@ -1,90 +0,0 @@ -#if !(UNITY_METRO || UNITY_WP8) - -#if UNITY_2018_3_OR_NEWER -#pragma warning disable CS0618 -#endif - -using UnityEngine; - -namespace UniRx.Examples -{ - // sample script, attach your object. - public class Sample01_ObservableWWW : MonoBehaviour - { - void Start() - { - // Basic: Download from google. - { - ObservableWWW.Get("http://google.co.jp/") - .Subscribe( - x => Debug.Log(x.Substring(0, 100)), // onSuccess - ex => Debug.LogException(ex)); // onError - } - - // Linear Pattern with LINQ Query Expressions - // download after google, start bing download - { - var query = from google in ObservableWWW.Get("http://google.com/") - from bing in ObservableWWW.Get("http://bing.com/") - select new { google, bing }; - - var cancel = query.Subscribe(x => Debug.Log(x.google.Substring(0, 100) + ":" + x.bing.Substring(0, 100))); - - // Call Dispose is cancel downloading. - cancel.Dispose(); - } - - // Observable.WhenAll is for parallel asynchronous operation - // (It's like Observable.Zip but specialized for single async operations like Task.WhenAll of .NET 4) - { - var parallel = Observable.WhenAll( - ObservableWWW.Get("http://google.com/"), - ObservableWWW.Get("http://bing.com/"), - ObservableWWW.Get("http://unity3d.com/")); - - parallel.Subscribe(xs => - { - Debug.Log(xs[0].Substring(0, 100)); // google - Debug.Log(xs[1].Substring(0, 100)); // bing - Debug.Log(xs[2].Substring(0, 100)); // unity - }); - } - - // with Progress - { - // notifier for progress - var progressNotifier = new ScheduledNotifier(); - progressNotifier.Subscribe(x => Debug.Log(x)); // write www.progress - - // pass notifier to WWW.Get/Post - ObservableWWW.Get("http://google.com/", progress: progressNotifier).Subscribe(); - } - - // with Error - { - // If WWW has .error, ObservableWWW throws WWWErrorException to onError pipeline. - // WWWErrorException has RawErrorMessage, HasResponse, StatusCode, ResponseHeaders - ObservableWWW.Get("http://www.google.com/404") - .CatchIgnore((WWWErrorException ex) => - { - Debug.Log(ex.RawErrorMessage); - if (ex.HasResponse) - { - Debug.Log(ex.StatusCode); - } - foreach (var item in ex.ResponseHeaders) - { - Debug.Log(item.Key + ":" + item.Value); - } - }) - .Subscribe(); - } - } - } -} - -#endif - -#if UNITY_2018_3_OR_NEWER -#pragma warning restore CS0618 -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs.meta b/Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs.meta deleted file mode 100644 index bfc52d8..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: bf3770fc51ac89f45987dbde37ae81bd -timeCreated: 1455373901 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample02_ObservableTriggers.cs b/Assets/Plugins/UniRx/Examples/Sample02_ObservableTriggers.cs deleted file mode 100644 index c054aed..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample02_ObservableTriggers.cs +++ /dev/null @@ -1,24 +0,0 @@ -using UnityEngine; -using UniRx.Triggers; // Triggers Namepsace -using System; - -namespace UniRx.Examples -{ - public class Sample02_ObservableTriggers : MonoBehaviour - { - void Start() - { - // Get the plain object - var cube = GameObject.CreatePrimitive(PrimitiveType.Cube); - - // Add ObservableXxxTrigger for handle MonoBehaviour's event as Observable - cube.AddComponent() - .UpdateAsObservable() - .SampleFrame(30) - .Subscribe(x => Debug.Log("cube"), () => Debug.Log("destroy")); - - // destroy after 3 second:) - GameObject.Destroy(cube, 3f); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample02_ObservableTriggers.cs.meta b/Assets/Plugins/UniRx/Examples/Sample02_ObservableTriggers.cs.meta deleted file mode 100644 index 1ca1c6a..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample02_ObservableTriggers.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: cb5e978d683e94f4d9c2c81be80f93a7 -timeCreated: 1455373901 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample03_GameObjectAsObservable.cs b/Assets/Plugins/UniRx/Examples/Sample03_GameObjectAsObservable.cs deleted file mode 100644 index 2c0d0e4..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample03_GameObjectAsObservable.cs +++ /dev/null @@ -1,23 +0,0 @@ -#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO) - -using UnityEngine; -using UniRx.Triggers; // for enable gameObject.EventAsObservbale() - -namespace UniRx.Examples -{ - public class Sample03_GameObjectAsObservable : MonoBehaviour - { - void Start() - { - // All events can subscribe by ***AsObservable if enables UniRx.Triggers - this.OnMouseDownAsObservable() - .SelectMany(_ => this.gameObject.UpdateAsObservable()) - .TakeUntil(this.gameObject.OnMouseUpAsObservable()) - .Select(_ => Input.mousePosition) - .RepeatUntilDestroy(this) - .Subscribe(x => Debug.Log(x), ()=> Debug.Log("!!!" + "complete")); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample03_GameObjectAsObservable.cs.meta b/Assets/Plugins/UniRx/Examples/Sample03_GameObjectAsObservable.cs.meta deleted file mode 100644 index 9e027f8..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample03_GameObjectAsObservable.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 005e349e5ccdd2b47bddc813b81afe40 -timeCreated: 1455373897 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample04_ConvertFromUnityCallback.cs b/Assets/Plugins/UniRx/Examples/Sample04_ConvertFromUnityCallback.cs deleted file mode 100644 index 549d8c2..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample04_ConvertFromUnityCallback.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using UnityEngine; - -namespace UniRx.Examples -{ - public class Sample04_ConvertFromUnityCallback : MonoBehaviour - { - // This is about log but more reliable log sample => Sample11_Logger - - private class LogCallback - { - public string Condition; - public string StackTrace; - public UnityEngine.LogType LogType; - } - - static class LogHelper - { - // If static register callback, use Subject for event branching. - -#if (UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7) - static Subject subject; - - public static IObservable LogCallbackAsObservable() - { - if (subject == null) - { - subject = new Subject(); - - // Publish to Subject in callback - - - UnityEngine.Application.RegisterLogCallback((condition, stackTrace, type) => - { - subject.OnNext(new LogCallback { Condition = condition, StackTrace = stackTrace, LogType = type }); - }); - } - - return subject.AsObservable(); - } - -#else - // If standard evetns, you can use Observable.FromEvent. - - public static IObservable LogCallbackAsObservable() - { - return Observable.FromEvent( - h => (condition, stackTrace, type) => h(new LogCallback { Condition = condition, StackTrace = stackTrace, LogType = type }), - h => Application.logMessageReceived += h, h => Application.logMessageReceived -= h); - } -#endif - } - - void Awake() - { - // method is separatable and composable - LogHelper.LogCallbackAsObservable() - .Where(x => x.LogType == LogType.Warning) - .Subscribe(x => Debug.Log(x)); - - LogHelper.LogCallbackAsObservable() - .Where(x => x.LogType == LogType.Error) - .Subscribe(x => Debug.Log(x)); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample04_ConvertFromUnityCallback.cs.meta b/Assets/Plugins/UniRx/Examples/Sample04_ConvertFromUnityCallback.cs.meta deleted file mode 100644 index 4c68f0a..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample04_ConvertFromUnityCallback.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 73e69fd4bbb724045a4e06050fbc5af3 -timeCreated: 1455373899 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs b/Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs deleted file mode 100644 index 8c5a37a..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections; -using System.Threading; -using UnityEngine; -#if UNITY_2018_3_OR_NEWER -#pragma warning disable CS0618 -#endif - -namespace UniRx.Examples -{ - public class Sample05_ConvertFromCoroutine - { - // public method - public static IObservable GetWWW(string url) - { - // convert coroutine to IObservable - return Observable.FromCoroutine((observer, cancellationToken) => GetWWWCore(url, observer, cancellationToken)); - } - - // IEnumerator with callback - static IEnumerator GetWWWCore(string url, IObserver observer, CancellationToken cancellationToken) - { - var www = new UnityEngine.WWW(url); - while (!www.isDone && !cancellationToken.IsCancellationRequested) - { - yield return null; - } - - if (cancellationToken.IsCancellationRequested) yield break; - - if (www.error != null) - { - observer.OnError(new Exception(www.error)); - } - else - { - observer.OnNext(www.text); - observer.OnCompleted(); - } - } - } -} -#if UNITY_2018_3_OR_NEWER -#pragma warning restore CS0618 -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs.meta b/Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs.meta deleted file mode 100644 index 1a8a8b4..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 41f3df73f7da66b4980f6d9a86927796 -timeCreated: 1455373898 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs b/Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs deleted file mode 100644 index e7ec1da..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Collections; -using UnityEngine; - -namespace UniRx.Examples -{ - public class Sample06_ConvertToCoroutine : MonoBehaviour - { - // convert IObservable to Coroutine - void Start() - { - StartCoroutine(ComplexCoroutineTest()); - } - - IEnumerator ComplexCoroutineTest() - { - yield return new WaitForSeconds(1); - - var v = default(int); - yield return Observable.Range(1, 10).StartAsCoroutine(x => v = x); - - Debug.Log(v); // 10(callback is last value) - yield return new WaitForSeconds(3); - - yield return Observable.Return(100).StartAsCoroutine(x => v = x); - - Debug.Log(v); // 100 - } - - // Note:ToAwaitableEnumerator/StartAsCoroutine/LazyTask are obsolete way on Unity 5.3 - // You can use ToYieldInstruction. - -#if !(UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2) -#if UNITY_2018_3_OR_NEWER -#pragma warning disable CS0618 -#endif - - IEnumerator TestNewCustomYieldInstruction() - { - // wait Rx Observable. - yield return Observable.Timer(TimeSpan.FromSeconds(1)).ToYieldInstruction(); - - // you can change the scheduler(this is ignore Time.scale) - yield return Observable.Timer(TimeSpan.FromSeconds(1), Scheduler.MainThreadIgnoreTimeScale).ToYieldInstruction(); - - // get return value from ObservableYieldInstruction - var o = ObservableWWW.Get("http://unity3d.com/").ToYieldInstruction(throwOnError: false); - yield return o; - - if (o.HasError) { Debug.Log(o.Error.ToString()); } - if (o.HasResult) { Debug.Log(o.Result); } - - // other sample(wait until transform.position.y >= 100) - yield return this.ObserveEveryValueChanged(x => x.transform).FirstOrDefault(x => x.position.y >= 100).ToYieldInstruction(); - } -#if UNITY_2018_3_OR_NEWER -#pragma warning restore CS0618 -#endif -#endif - - } -} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs.meta b/Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs.meta deleted file mode 100644 index 30b592b..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample06_ConvertToCoroutine.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 5da8247fbc4a4c84e96a727b44903214 -timeCreated: 1455373899 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample07_OrchestratIEnumerator.cs b/Assets/Plugins/UniRx/Examples/Sample07_OrchestratIEnumerator.cs deleted file mode 100644 index fa0fcdc..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample07_OrchestratIEnumerator.cs +++ /dev/null @@ -1,45 +0,0 @@ -#pragma warning disable 0168 -#pragma warning disable 0219 - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using UnityEngine; - -namespace UniRx.Examples -{ - public class Sample07_OrchestratIEnumerator : MonoBehaviour - { - // two coroutines - IEnumerator AsyncA() - { - Debug.Log("a start"); - yield return new WaitForSeconds(3); - Debug.Log("a end"); - } - - IEnumerator AsyncB() - { - Debug.Log("b start"); - yield return new WaitForEndOfFrame(); - Debug.Log("b end"); - } - - void Start() - { - // after completed AsyncA, run AsyncB as continuous routine. - // UniRx expands SelectMany(IEnumerator) as SelectMany(IEnumerator.ToObservable()) - var cancel = Observable.FromCoroutine(AsyncA) - .SelectMany(AsyncB) - .Subscribe(); - - // If you want to stop Coroutine(as cancel), call subscription.Dispose() - // cancel.Dispose(); - } - } -} - -#pragma warning restore 0219 -#pragma warning restore 0168 \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample07_OrchestratIEnumerator.cs.meta b/Assets/Plugins/UniRx/Examples/Sample07_OrchestratIEnumerator.cs.meta deleted file mode 100644 index 9a1ae43..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample07_OrchestratIEnumerator.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d437607dfffa8ff428bda3366354078d -timeCreated: 1455373901 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample08_DetectDoubleClick.cs b/Assets/Plugins/UniRx/Examples/Sample08_DetectDoubleClick.cs deleted file mode 100644 index 1c880ed..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample08_DetectDoubleClick.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using UnityEngine; - -namespace UniRx.Examples -{ - public class Sample08_DetectDoubleClick : MonoBehaviour - { - void Start() - { - // Global event handling is very useful. - // UniRx can handle there events. - // Observable.EveryUpdate/EveryFixedUpdate/EveryEndOfFrame - // Observable.EveryApplicationFocus/EveryApplicationPause - // Observable.OnceApplicationQuit - - // This DoubleCLick Sample is from - // The introduction to Reactive Programming you've been missing - // https://gist.github.com/staltz/868e7e9bc2a7b8c1f754 - - var clickStream = Observable.EveryUpdate() - .Where(_ => Input.GetMouseButtonDown(0)); - - clickStream.Buffer(clickStream.Throttle(TimeSpan.FromMilliseconds(250))) - .Where(xs => xs.Count >= 2) - .Subscribe(xs => Debug.Log("DoubleClick Detected! Count:" + xs.Count)); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample08_DetectDoubleClick.cs.meta b/Assets/Plugins/UniRx/Examples/Sample08_DetectDoubleClick.cs.meta deleted file mode 100644 index 5b9112f..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample08_DetectDoubleClick.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: eb801bbfb1ffcd64389e90c8f2435b79 -timeCreated: 1455373902 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample09_EventHandling.cs b/Assets/Plugins/UniRx/Examples/Sample09_EventHandling.cs deleted file mode 100644 index 8ccd1db..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample09_EventHandling.cs +++ /dev/null @@ -1,69 +0,0 @@ -#pragma warning disable 0067 - -using System; -using UnityEngine; - -namespace UniRx.Examples -{ - public class Sample09_EventHandling : MonoBehaviour - { - public class MyEventArgs : EventArgs - { - public int MyProperty { get; set; } - } - - public event EventHandler FooBar; - public event Action FooFoo; - - CompositeDisposable disposables = new CompositeDisposable(); - - // Subject is Rx's native event expression and recommend way for use Rx as event. - // Subject.OnNext as fire event, - // expose IObserver is subscibable for external source, it's no need convert. - Subject onBarBar = new Subject(); - public IObservable OnBarBar { get { return onBarBar; } } - - void Start() - { - // convert to IO as (sender, eventArgs) - Observable.FromEventPattern, MyEventArgs>( - h => h.Invoke, h => FooBar += h, h => FooBar -= h) - .Subscribe() - .AddTo(disposables); // IDisposable can add to collection easily by AddTo - - // convert to IO, many situation this is useful than FromEventPattern - Observable.FromEvent, MyEventArgs>( - h => (sender, e) => h(e), h => FooBar += h, h => FooBar -= h) - .Subscribe() - .AddTo(disposables); - - // You can convert Action like event. - Observable.FromEvent( - h => FooFoo += h, h => FooFoo -= h) - .Subscribe() - .AddTo(disposables); - - // AOT Safe EventHandling, use dummy capture, see:https://github.com/neuecc/UniRx/wiki/AOT-Exception-Patterns-and-Hacks - var capture = 0; - Observable.FromEventPattern, MyEventArgs>(h => - { - capture.GetHashCode(); // dummy for AOT - return new EventHandler(h); - }, h => FooBar += h, h => FooBar -= h) - .Subscribe() - .AddTo(disposables); - - // Subject as like event. - OnBarBar.Subscribe().AddTo(disposables); - onBarBar.OnNext(1); // fire event - } - - void OnDestroy() - { - // manage subscription lifecycle - disposables.Dispose(); - } - } -} - -#pragma warning restore 0067 \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample09_EventHandling.cs.meta b/Assets/Plugins/UniRx/Examples/Sample09_EventHandling.cs.meta deleted file mode 100644 index 73b2354..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample09_EventHandling.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 95140e49213aa6f49a470a81873b87c0 -timeCreated: 1455373900 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample10_MainThreadDispatcher.cs b/Assets/Plugins/UniRx/Examples/Sample10_MainThreadDispatcher.cs deleted file mode 100644 index b2cafef..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample10_MainThreadDispatcher.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections; -using UnityEngine; - -namespace UniRx.Examples -{ - public class Sample10_MainThreadDispatcher - { - public void Run() - { - // MainThreadDispatcher is heart of Rx and Unity integration - - // StartCoroutine can start coroutine besides MonoBehaviour. - MainThreadDispatcher.StartCoroutine(TestAsync()); - - // We have two way of run coroutine, FromCoroutine or StartCoroutine. - // StartCoroutine is Unity primitive way and it's awaitable by yield return. - // FromCoroutine is Rx, it's composable and cancellable by subscription's IDisposable. - // FromCoroutine's overload can have return value, see:Sample05_ConvertFromCoroutine - Observable.FromCoroutine(TestAsync).Subscribe(); - - // Add Action to MainThreadDispatcher. Action is saved queue, run on next update. - MainThreadDispatcher.Post(_ => Debug.Log("test"), null); - - // Timebased operations is run on MainThread(as default) - // All timebased operation(Interval, Timer, Delay, Buffer, etc...)is single thread, thread safe! - Observable.Interval(TimeSpan.FromSeconds(1)) - .Subscribe(x => Debug.Log(x)); - - // Observable.Start use ThreadPool Scheduler as default. - // ObserveOnMainThread return to mainthread - Observable.Start(() => Unit.Default) // asynchronous work - .ObserveOnMainThread() - .Subscribe(x => Debug.Log(x)); - } - - IEnumerator TestAsync() - { - Debug.Log("a"); - yield return new WaitForSeconds(1); - Debug.Log("b"); - yield return new WaitForSeconds(1); - Debug.Log("c"); - yield return new WaitForSeconds(1); - Debug.Log("d"); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample10_MainThreadDispatcher.cs.meta b/Assets/Plugins/UniRx/Examples/Sample10_MainThreadDispatcher.cs.meta deleted file mode 100644 index 7335916..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample10_MainThreadDispatcher.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6a0b959735346af48b772254afc8afdd -timeCreated: 1455373899 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample11_Logger.cs b/Assets/Plugins/UniRx/Examples/Sample11_Logger.cs deleted file mode 100644 index 8de54d5..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample11_Logger.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections; -using UniRx.Diagnostics; -using UnityEngine; - -namespace UniRx.Examples -{ - public class Sample11_Logger - { - // UniRx.Diagnostics.Logger - // logger is threadsafe, define per class with name. - static readonly UniRx.Diagnostics.Logger logger = new UniRx.Diagnostics.Logger("Sample11"); - - // call once at applicationinit - public void ApplicationInitialize() - { - // Log as Stream, UniRx.Diagnostics.ObservableLogger.Listener is IObservable - // You can subscribe and output to any place. - ObservableLogger.Listener.LogToUnityDebug(); - - // for example, filter only Exception and upload to web. - // (make custom sink(IObserver) is better to use) - ObservableLogger.Listener - .Where(x => x.LogType == LogType.Exception) - .Subscribe(x => - { - // ObservableWWW.Post("", null).Subscribe(); - }); - } - - public void Run() - { - // Debug is write only DebugBuild. - logger.Debug("Debug Message"); - - // or other logging methods - logger.Log("Message"); - logger.Exception(new Exception("test exception")); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample11_Logger.cs.meta b/Assets/Plugins/UniRx/Examples/Sample11_Logger.cs.meta deleted file mode 100644 index d5fa22b..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample11_Logger.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f5aa72c61e2548a4bac4d65f93c63bf1 -timeCreated: 1455373902 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample12Scene.unity b/Assets/Plugins/UniRx/Examples/Sample12Scene.unity deleted file mode 100644 index dd99029..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample12Scene.unity +++ /dev/null @@ -1,1535 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -SceneSettings: - m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 6 - 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_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} ---- !u!157 &4 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 6 - m_GIWorkflowMode: 0 - m_LightmapsMode: 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: 3 - m_Resolution: 2 - m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 - m_AOMaxDistance: 1 - m_Padding: 2 - m_CompAOExponent: 0 - m_LightmapParameters: {fileID: 0} - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherRayCount: 1024 - m_ReflectionCompression: 2 - m_LightingDataAsset: {fileID: 0} - m_RuntimeCPUUsage: 25 ---- !u!196 &5 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - accuratePlacement: 0 - minRegionArea: 2 - cellSize: 0.16666667 - manualCellSize: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &33721919 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 33721920} - - 223: {fileID: 33721924} - - 114: {fileID: 33721923} - - 114: {fileID: 33721922} - - 114: {fileID: 33721921} - m_Layer: 5 - m_Name: Canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &33721920 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 33721919} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 921642174} - - {fileID: 530746210} - - {fileID: 46704896} - - {fileID: 579875960} - - {fileID: 1891604357} - m_Father: {fileID: 0} - m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} ---- !u!114 &33721921 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 33721919} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 18e34490a83a27e44adf93dd4ffd1f22, type: 3} - m_Name: - m_EditorClassIdentifier: - MyButton: {fileID: 921642175} - MyToggle: {fileID: 530746211} - MyInput: {fileID: 46704897} - MyText: {fileID: 579875961} - MySlider: {fileID: 1891604358} - IntRxProp: - value: 0 ---- !u!114 &33721922 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 33721919} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &33721923 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 33721919} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 ---- !u!223 &33721924 -Canvas: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 33721919} - m_Enabled: 1 - serializedVersion: 2 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!1 &46704895 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 46704896} - - 222: {fileID: 46704899} - - 114: {fileID: 46704898} - - 114: {fileID: 46704897} - m_Layer: 5 - m_Name: InputField - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &46704896 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 46704895} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 835857415} - - {fileID: 710358450} - m_Father: {fileID: 33721920} - m_RootOrder: 2 - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 277} - m_SizeDelta: {x: 160, y: 30} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &46704897 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 46704895} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 575553740, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 46704898} - m_TextComponent: {fileID: 710358451} - m_Placeholder: {fileID: 835857416} - m_ContentType: 0 - m_InputType: 0 - m_AsteriskChar: 42 - m_KeyboardType: 0 - m_LineType: 0 - m_HideMobileInput: 0 - m_CharacterValidation: 0 - m_CharacterLimit: 0 - m_OnEndEdit: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.InputField+SubmitEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null - m_OnValueChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.InputField+OnChangeEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null - m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_CustomCaretColor: 0 - m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412} - m_Text: - m_CaretBlinkRate: 1.7 - m_CaretWidth: 1 - m_ReadOnly: 0 ---- !u!114 &46704898 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 46704895} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &46704899 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 46704895} ---- !u!1 &163238468 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 163238469} - - 222: {fileID: 163238471} - - 114: {fileID: 163238470} - m_Layer: 5 - m_Name: Checkmark - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &163238469 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 163238468} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 1018308463} - m_RootOrder: 0 - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 20, y: 20} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &163238470 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 163238468} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &163238471 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 163238468} ---- !u!1 &530746209 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 530746210} - - 114: {fileID: 530746211} - m_Layer: 5 - m_Name: Toggle - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &530746210 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 530746209} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 1018308463} - - {fileID: 1527674668} - m_Father: {fileID: 33721920} - m_RootOrder: 1 - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -160, y: 294} - m_SizeDelta: {x: 160, y: 20} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &530746211 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 530746209} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 2109663825, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 1018308464} - toggleTransition: 1 - graphic: {fileID: 163238470} - m_Group: {fileID: 0} - onValueChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null - m_IsOn: 0 ---- !u!1 &579875959 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 579875960} - - 222: {fileID: 579875962} - - 114: {fileID: 579875961} - m_Layer: 5 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &579875960 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 579875959} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 33721920} - m_RootOrder: 3 - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 178} - m_SizeDelta: {x: 160, y: 30} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &579875961 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 579875959} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: New Text ---- !u!222 &579875962 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 579875959} ---- !u!1 &605953354 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 605953355} - m_Layer: 5 - m_Name: Handle Slide Area - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &605953355 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 605953354} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 1022847601} - m_Father: {fileID: 1891604357} - m_RootOrder: 2 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -20, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!1 &710358449 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 710358450} - - 222: {fileID: 710358452} - - 114: {fileID: 710358451} - m_Layer: 5 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &710358450 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 710358449} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 46704896} - m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -0.5} - m_SizeDelta: {x: -20, y: -13} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &710358451 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 710358449} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_AlignByGeometry: 0 - m_RichText: 0 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: ---- !u!222 &710358452 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 710358449} ---- !u!1 &801653541 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 801653542} - - 222: {fileID: 801653544} - - 114: {fileID: 801653543} - m_Layer: 5 - m_Name: Background - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &801653542 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 801653541} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 1891604357} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0.25} - m_AnchorMax: {x: 1, y: 0.75} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &801653543 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 801653541} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &801653544 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 801653541} ---- !u!1 &835857414 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 835857415} - - 222: {fileID: 835857417} - - 114: {fileID: 835857416} - m_Layer: 5 - m_Name: Placeholder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &835857415 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 835857414} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 46704896} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -0.5} - m_SizeDelta: {x: -20, y: -13} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &835857416 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 835857414} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 2 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Enter text... ---- !u!222 &835857417 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 835857414} ---- !u!1 &921642173 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 921642174} - - 222: {fileID: 921642177} - - 114: {fileID: 921642176} - - 114: {fileID: 921642175} - m_Layer: 5 - m_Name: Button - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &921642174 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 921642173} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 1781955689} - m_Father: {fileID: 33721920} - m_RootOrder: 0 - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -171, y: 218} - m_SizeDelta: {x: 160, y: 30} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &921642175 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 921642173} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 921642176} - m_OnClick: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null ---- !u!114 &921642176 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 921642173} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &921642177 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 921642173} ---- !u!1 &930565829 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 930565830} - - 222: {fileID: 930565832} - - 114: {fileID: 930565831} - m_Layer: 5 - m_Name: Fill - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &930565830 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 930565829} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 1807094062} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 10, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &930565831 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 930565829} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &930565832 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 930565829} ---- !u!1 &1018308462 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1018308463} - - 222: {fileID: 1018308465} - - 114: {fileID: 1018308464} - m_Layer: 5 - m_Name: Background - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1018308463 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1018308462} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 163238469} - m_Father: {fileID: 530746210} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 10, y: -10} - m_SizeDelta: {x: 20, y: 20} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1018308464 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1018308462} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &1018308465 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1018308462} ---- !u!1 &1022847600 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1022847601} - - 222: {fileID: 1022847603} - - 114: {fileID: 1022847602} - m_Layer: 5 - m_Name: Handle - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1022847601 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1022847600} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 605953355} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 20, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1022847602 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1022847600} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &1022847603 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1022847600} ---- !u!1 &1184379970 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1184379974} - - 114: {fileID: 1184379973} - - 114: {fileID: 1184379972} - - 114: {fileID: 1184379971} - m_Layer: 0 - m_Name: EventSystem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1184379971 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1184379970} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_ForceModuleActive: 0 ---- !u!114 &1184379972 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1184379970} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalAxis: Horizontal - m_VerticalAxis: Vertical - m_SubmitButton: Submit - m_CancelButton: Cancel - m_InputActionsPerSecond: 10 - m_RepeatDelay: 0.5 - m_ForceModuleActive: 0 ---- !u!114 &1184379973 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1184379970} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FirstSelected: {fileID: 0} - m_sendNavigationEvents: 1 - m_DragThreshold: 5 ---- !u!4 &1184379974 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1184379970} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 ---- !u!1 &1527674667 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1527674668} - - 222: {fileID: 1527674670} - - 114: {fileID: 1527674669} - m_Layer: 5 - m_Name: Label - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1527674668 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1527674667} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 530746210} - m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 9, y: -0.5} - m_SizeDelta: {x: -28, y: -3} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1527674669 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1527674667} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Toggle ---- !u!222 &1527674670 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1527674667} ---- !u!1 &1781955688 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1781955689} - - 222: {fileID: 1781955691} - - 114: {fileID: 1781955690} - m_Layer: 5 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1781955689 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1781955688} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 921642174} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1781955690 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1781955688} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Button ---- !u!222 &1781955691 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1781955688} ---- !u!1 &1807094061 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1807094062} - m_Layer: 5 - m_Name: Fill Area - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1807094062 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1807094061} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 930565830} - m_Father: {fileID: 1891604357} - m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 0.25} - m_AnchorMax: {x: 1, y: 0.75} - m_AnchoredPosition: {x: -5, y: 0} - m_SizeDelta: {x: -20, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!1 &1838497716 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1838497721} - - 20: {fileID: 1838497720} - - 92: {fileID: 1838497719} - - 124: {fileID: 1838497718} - - 81: {fileID: 1838497717} - 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 &1838497717 -AudioListener: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1838497716} - m_Enabled: 1 ---- !u!124 &1838497718 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1838497716} - m_Enabled: 1 ---- !u!92 &1838497719 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1838497716} - m_Enabled: 1 ---- !u!20 &1838497720 -Camera: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1838497716} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} - 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: 3 - m_HDR: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 - m_StereoMirrorMode: 0 ---- !u!4 &1838497721 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1838497716} - 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 ---- !u!1 &1891604356 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1891604357} - - 114: {fileID: 1891604358} - m_Layer: 5 - m_Name: Slider - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1891604357 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1891604356} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 801653542} - - {fileID: 1807094062} - - {fileID: 605953355} - m_Father: {fileID: 33721920} - m_RootOrder: 4 - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 102} - m_SizeDelta: {x: 160, y: 20} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1891604358 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1891604356} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -113659843, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 1022847602} - m_FillRect: {fileID: 930565830} - m_HandleRect: {fileID: 1022847601} - m_Direction: 0 - m_MinValue: 0 - m_MaxValue: 1 - m_WholeNumbers: 0 - m_Value: 1 - m_OnValueChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.Slider+SliderEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null diff --git a/Assets/Plugins/UniRx/Examples/Sample12Scene.unity.meta b/Assets/Plugins/UniRx/Examples/Sample12Scene.unity.meta deleted file mode 100644 index 43d6aba..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample12Scene.unity.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4a4aea8df1ad11c47a1db84432dd30f8 -timeCreated: 1455373896 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample12_ReactiveProperty.cs b/Assets/Plugins/UniRx/Examples/Sample12_ReactiveProperty.cs deleted file mode 100644 index e1e7d56..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample12_ReactiveProperty.cs +++ /dev/null @@ -1,77 +0,0 @@ -// for uGUI(from 4.6) -#if !(UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5) - -using System; -using UnityEngine; -using UnityEngine.UI; - -namespace UniRx.Examples -{ - public class Sample12_ReactiveProperty : MonoBehaviour - { - // Open Sample12Scene. Set from canvas - public Button MyButton; - public Toggle MyToggle; - public InputField MyInput; - public Text MyText; - public Slider MySlider; - - // You can monitor/modifie in inspector by SpecializedReactiveProperty - public IntReactiveProperty IntRxProp = new IntReactiveProperty(); - - Enemy enemy = new Enemy(1000); - - void Start() - { - // UnityEvent as Observable - // (shortcut, MyButton.OnClickAsObservable()) - MyButton.onClick.AsObservable().Subscribe(_ => enemy.CurrentHp.Value -= 99); - - // Toggle, Input etc as Observable(OnValueChangedAsObservable is helper for provide isOn value on subscribe) - // SubscribeToInteractable is UniRx.UI Extension Method, same as .interactable = x) - MyToggle.OnValueChangedAsObservable().SubscribeToInteractable(MyButton); - - // input shows delay after 1 second -#if !(UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2) - MyInput.OnValueChangedAsObservable() -#else - MyInput.OnValueChangeAsObservable() -#endif - .Where(x => x != null) - .Delay(TimeSpan.FromSeconds(1)) - .SubscribeToText(MyText); // SubscribeToText is UniRx.UI Extension Method - - // converting for human visibility - MySlider.OnValueChangedAsObservable() - .SubscribeToText(MyText, x => Math.Round(x, 2).ToString()); - - // from RxProp, CurrentHp changing(Button Click) is observable - enemy.CurrentHp.SubscribeToText(MyText); - enemy.IsDead.Where(isDead => isDead == true) - .Subscribe(_ => - { - MyToggle.interactable = MyButton.interactable = false; - }); - - // initial text:) - IntRxProp.SubscribeToText(MyText); - } - } - - // Reactive Notification Model - public class Enemy - { - public IReactiveProperty CurrentHp { get; private set; } - - public IReadOnlyReactiveProperty IsDead { get; private set; } - - public Enemy(int initialHp) - { - // Declarative Property - CurrentHp = new ReactiveProperty(initialHp); - IsDead = CurrentHp.Select(x => x <= 0).ToReactiveProperty(); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample12_ReactiveProperty.cs.meta b/Assets/Plugins/UniRx/Examples/Sample12_ReactiveProperty.cs.meta deleted file mode 100644 index 66c4ceb..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample12_ReactiveProperty.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 18e34490a83a27e44adf93dd4ffd1f22 -timeCreated: 1455373897 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample13Scene.unity b/Assets/Plugins/UniRx/Examples/Sample13Scene.unity deleted file mode 100644 index 169248e..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample13Scene.unity +++ /dev/null @@ -1,1300 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -SceneSettings: - m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 6 - 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_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} ---- !u!157 &4 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 6 - m_GIWorkflowMode: 0 - m_LightmapsMode: 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: 3 - m_Resolution: 2 - m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 - m_AOMaxDistance: 1 - m_Padding: 2 - m_CompAOExponent: 0 - m_LightmapParameters: {fileID: 0} - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherRayCount: 1024 - m_ReflectionCompression: 2 - m_LightingDataAsset: {fileID: 0} - m_RuntimeCPUUsage: 25 ---- !u!196 &5 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - accuratePlacement: 0 - minRegionArea: 2 - cellSize: 0.16666667 - manualCellSize: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &48390799 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 48390800} - - 222: {fileID: 48390802} - - 114: {fileID: 48390801} - m_Layer: 5 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &48390800 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 48390799} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 2136645852} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &48390801 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 48390799} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Clear Checked ---- !u!222 &48390802 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 48390799} ---- !u!1 &80191139 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 80191140} - - 114: {fileID: 80191141} - m_Layer: 5 - m_Name: TodoList - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &80191140 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 80191139} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 625561981} - m_RootOrder: 2 - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0.000030517578, y: -864} - m_SizeDelta: {x: 0, y: 744} - m_Pivot: {x: 0.5, y: 0} ---- !u!114 &80191141 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 80191139} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1297475563, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_ChildAlignment: 0 - m_Spacing: 0 - m_ChildForceExpandWidth: 1 - m_ChildForceExpandHeight: 1 ---- !u!1 &300470760 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 300470761} - - 114: {fileID: 300470762} - m_Layer: 0 - m_Name: ToDoScene - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &300470761 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 300470760} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 895588078} - m_Father: {fileID: 0} - m_RootOrder: 1 ---- !u!114 &300470762 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 300470760} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 022ecfa555367154c8cf87d61465f7e2, type: 3} - m_Name: - m_EditorClassIdentifier: - Title: {fileID: 852345258} - ToDoInput: {fileID: 566049662} - AddButton: {fileID: 611575448} - ClearButton: {fileID: 2136645853} - TodoList: {fileID: 80191139} - SampleItemPrefab: {fileID: 182208, guid: 173222196f3e1f0448b383f260df7d44, type: 2} ---- !u!1 &448872075 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 448872079} - - 114: {fileID: 448872078} - - 114: {fileID: 448872077} - - 114: {fileID: 448872076} - - 114: {fileID: 448872080} - m_Layer: 0 - m_Name: EventSystem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &448872076 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 448872075} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_ForceModuleActive: 0 ---- !u!114 &448872077 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 448872075} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalAxis: Horizontal - m_VerticalAxis: Vertical - m_SubmitButton: Submit - m_CancelButton: Cancel - m_InputActionsPerSecond: 10 - m_RepeatDelay: 0.5 - m_ForceModuleActive: 0 ---- !u!114 &448872078 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 448872075} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FirstSelected: {fileID: 0} - m_sendNavigationEvents: 1 - m_DragThreshold: 5 ---- !u!4 &448872079 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 448872075} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 ---- !u!114 &448872080 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 448872075} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalAxis: Horizontal - m_VerticalAxis: Vertical - m_SubmitButton: Submit - m_CancelButton: Cancel - m_InputActionsPerSecond: 10 - m_RepeatDelay: 0.5 - m_ForceModuleActive: 0 ---- !u!1 &566049660 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 566049661} - - 222: {fileID: 566049664} - - 114: {fileID: 566049663} - - 114: {fileID: 566049662} - m_Layer: 5 - m_Name: ToDoInput - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &566049661 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 566049660} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 2102338788} - - {fileID: 1368145207} - m_Father: {fileID: 650625965} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &566049662 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 566049660} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 575553740, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 566049663} - m_TextComponent: {fileID: 1368145205} - m_Placeholder: {fileID: 2102338789} - m_ContentType: 0 - m_InputType: 0 - m_AsteriskChar: 42 - m_KeyboardType: 0 - m_LineType: 0 - m_HideMobileInput: 0 - m_CharacterValidation: 0 - m_CharacterLimit: 0 - m_OnEndEdit: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.InputField+SubmitEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null - m_OnValueChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.InputField+OnChangeEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null - m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_CustomCaretColor: 0 - m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412} - m_Text: - m_CaretBlinkRate: 1.7 - m_CaretWidth: 1 - m_ReadOnly: 0 ---- !u!114 &566049663 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 566049660} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &566049664 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 566049660} ---- !u!1 &611575446 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 611575447} - - 222: {fileID: 611575450} - - 114: {fileID: 611575449} - - 114: {fileID: 611575448} - m_Layer: 5 - m_Name: AddButton - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &611575447 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 611575446} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 721405894} - m_Father: {fileID: 650625965} - m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &611575448 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 611575446} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 611575449} - m_OnClick: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null ---- !u!114 &611575449 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 611575446} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &611575450 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 611575446} ---- !u!1 &625561980 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 625561981} - - 222: {fileID: 625561983} - - 114: {fileID: 625561982} - m_Layer: 5 - m_Name: Panel - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &625561981 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 625561980} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 852345257} - - {fileID: 650625965} - - {fileID: 80191140} - m_Father: {fileID: 895588078} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &625561982 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 625561980} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0.392} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &625561983 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 625561980} ---- !u!1 &650625964 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 650625965} - - 114: {fileID: 650625966} - m_Layer: 5 - m_Name: InputArea - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &650625965 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 650625964} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 566049661} - - {fileID: 611575447} - - {fileID: 2136645852} - m_Father: {fileID: 625561981} - m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 50} - m_Pivot: {x: 0.5, y: 0} ---- !u!114 &650625966 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 650625964} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -405508275, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_ChildAlignment: 0 - m_Spacing: 0 - m_ChildForceExpandWidth: 1 - m_ChildForceExpandHeight: 1 ---- !u!1 &721405893 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 721405894} - - 222: {fileID: 721405896} - - 114: {fileID: 721405895} - m_Layer: 5 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &721405894 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 721405893} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 611575447} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &721405895 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 721405893} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Add ---- !u!222 &721405896 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 721405893} ---- !u!1 &852345256 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 852345257} - - 222: {fileID: 852345259} - - 114: {fileID: 852345258} - m_Layer: 5 - m_Name: Title - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &852345257 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 852345256} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 625561981} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 120} - m_Pivot: {x: 0, y: 1} ---- !u!114 &852345258 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 852345256} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 30 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_AlignByGeometry: 0 - m_RichText: 0 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: TODO App:) ---- !u!222 &852345259 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 852345256} ---- !u!1 &895588077 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 895588078} - - 223: {fileID: 895588081} - - 114: {fileID: 895588080} - - 114: {fileID: 895588079} - m_Layer: 5 - m_Name: Canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &895588078 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 895588077} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 625561981} - m_Father: {fileID: 300470761} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} ---- !u!114 &895588079 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 895588077} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &895588080 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 895588077} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 ---- !u!223 &895588081 -Canvas: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 895588077} - m_Enabled: 1 - serializedVersion: 2 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!1 &1368145204 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1368145207} - - 222: {fileID: 1368145206} - - 114: {fileID: 1368145205} - m_Layer: 5 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1368145205 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1368145204} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_AlignByGeometry: 0 - m_RichText: 0 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: ---- !u!222 &1368145206 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1368145204} ---- !u!224 &1368145207 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1368145204} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 566049661} - m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -0.5} - m_SizeDelta: {x: -20, y: -13} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!1 &2074703090 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 2074703095} - - 20: {fileID: 2074703094} - - 92: {fileID: 2074703093} - - 124: {fileID: 2074703092} - - 81: {fileID: 2074703091} - 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 &2074703091 -AudioListener: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2074703090} - m_Enabled: 1 ---- !u!124 &2074703092 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2074703090} - m_Enabled: 1 ---- !u!92 &2074703093 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2074703090} - m_Enabled: 1 ---- !u!20 &2074703094 -Camera: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2074703090} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} - 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: 3 - m_HDR: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 - m_StereoMirrorMode: 0 ---- !u!4 &2074703095 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2074703090} - 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 ---- !u!1 &2102338787 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 2102338788} - - 222: {fileID: 2102338790} - - 114: {fileID: 2102338789} - m_Layer: 5 - m_Name: Placeholder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2102338788 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2102338787} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 566049661} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -0.5} - m_SizeDelta: {x: -20, y: -13} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &2102338789 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2102338787} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 2 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: What needs to be done? ---- !u!222 &2102338790 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2102338787} ---- !u!1 &2136645851 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 2136645852} - - 222: {fileID: 2136645855} - - 114: {fileID: 2136645854} - - 114: {fileID: 2136645853} - m_Layer: 5 - m_Name: ClearButton - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2136645852 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2136645851} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 48390800} - m_Father: {fileID: 650625965} - m_RootOrder: 2 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &2136645853 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2136645851} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 2136645854} - m_OnClick: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null ---- !u!114 &2136645854 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2136645851} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &2136645855 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2136645851} diff --git a/Assets/Plugins/UniRx/Examples/Sample13Scene.unity.meta b/Assets/Plugins/UniRx/Examples/Sample13Scene.unity.meta deleted file mode 100644 index 42dc203..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample13Scene.unity.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b879645f640b02b43a8e78e210c1da1f -timeCreated: 1455373896 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample13_ToDoApp.cs b/Assets/Plugins/UniRx/Examples/Sample13_ToDoApp.cs deleted file mode 100644 index 159e932..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample13_ToDoApp.cs +++ /dev/null @@ -1,68 +0,0 @@ -// for uGUI(from 4.6) -#if !(UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5) - -using System.Linq; -using UnityEngine; -using UnityEngine.UI; -using System.Collections; -using UnityEngine.EventSystems; - -namespace UniRx.Examples -{ - public class Sample13_ToDoApp : MonoBehaviour - { - // Open Sample13Scene. Set from canvas - public Text Title; - public InputField ToDoInput; - public Button AddButton; - public Button ClearButton; - public GameObject TodoList; - - // prefab:) - public GameObject SampleItemPrefab; - - ReactiveCollection toDos = new ReactiveCollection(); - - void Start() - { - // merge Button click and push enter key on input field. - var submit = Observable.Merge( - AddButton.OnClickAsObservable().Select(_ => ToDoInput.text), - ToDoInput.OnEndEditAsObservable().Where(_ => Input.GetKeyDown(KeyCode.Return))); - - // add to reactive collection - submit.Where(x => x != "") - .Subscribe(x => - { - ToDoInput.text = ""; // clear input field - var item = Instantiate(SampleItemPrefab) as GameObject; - (item.GetComponentInChildren(typeof(Text)) as Text).text = x; - toDos.Add(item); - }); - - // Collection Change Handling - toDos.ObserveCountChanged().Subscribe(x => Title.text = "TODO App, ItemCount:" + x); - toDos.ObserveAdd().Subscribe(x => - { - x.Value.transform.SetParent(TodoList.transform, false); - }); - toDos.ObserveRemove().Subscribe(x => - { - GameObject.Destroy(x.Value); - }); - - // Clear - ClearButton.OnClickAsObservable() - .Subscribe(_ => - { - var removeTargets = toDos.Where(x => x.GetComponent().isOn).ToArray(); - foreach (var item in removeTargets) - { - toDos.Remove(item); - } - }); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Examples/Sample13_ToDoApp.cs.meta b/Assets/Plugins/UniRx/Examples/Sample13_ToDoApp.cs.meta deleted file mode 100644 index ca18a37..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample13_ToDoApp.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 022ecfa555367154c8cf87d61465f7e2 -timeCreated: 1455373897 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples/Sample13_ToDoItem.prefab b/Assets/Plugins/UniRx/Examples/Sample13_ToDoItem.prefab deleted file mode 100644 index 1a976a1..0000000 --- a/Assets/Plugins/UniRx/Examples/Sample13_ToDoItem.prefab +++ /dev/null @@ -1,284 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &152834 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 224: {fileID: 22461494} - - 222: {fileID: 22298102} - - 114: {fileID: 11434412} - m_Layer: 5 - m_Name: Background - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &172388 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 224: {fileID: 22491898} - - 222: {fileID: 22251748} - - 114: {fileID: 11438756} - m_Layer: 5 - m_Name: Label - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &174974 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 224: {fileID: 22463654} - - 222: {fileID: 22278786} - - 114: {fileID: 11497312} - m_Layer: 5 - m_Name: Checkmark - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &182208 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 224: {fileID: 22478562} - - 114: {fileID: 11479148} - m_Layer: 5 - m_Name: Sample13_ToDoItem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &11434412 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 152834} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!114 &11438756 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 172388} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1} - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 30 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: 'TODOITEM - -' ---- !u!114 &11479148 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 182208} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 2109663825, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} - m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} - m_ColorMultiplier: 1 - m_FadeDuration: .100000001 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 11434412} - toggleTransition: 1 - graphic: {fileID: 11497312} - m_Group: {fileID: 0} - onValueChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null - m_IsOn: 1 ---- !u!114 &11497312 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 174974} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &22251748 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 172388} ---- !u!222 &22278786 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 174974} ---- !u!222 &22298102 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 152834} ---- !u!224 &22461494 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 152834} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 22463654} - m_Father: {fileID: 22478562} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 10, y: -10} - m_SizeDelta: {x: 20, y: 30} - m_Pivot: {x: .5, y: .5} ---- !u!224 &22463654 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 174974} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 22461494} - m_RootOrder: 0 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 20, y: 30} - m_Pivot: {x: .5, y: .5} ---- !u!224 &22478562 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 182208} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 22461494} - - {fileID: 22491898} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} ---- !u!224 &22491898 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 172388} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 22478562} - m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 9, y: -.5} - m_SizeDelta: {x: -28, y: -3} - m_Pivot: {x: .5, y: .5} ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 182208} - m_IsPrefabParent: 1 diff --git a/Assets/Plugins/UniRx/Examples/UniRx.Examples.asmdef b/Assets/Plugins/UniRx/Examples/UniRx.Examples.asmdef deleted file mode 100644 index 6f5b9fd..0000000 --- a/Assets/Plugins/UniRx/Examples/UniRx.Examples.asmdef +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "UniRx.Examples", - "references": [ - "UniRx", - "UniRx.Async" - ], - "optionalUnityReferences": [ - "TestAssemblies" - ], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": false -} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/ReadMe.txt.meta b/Assets/Plugins/UniRx/ReadMe.txt.meta index 13251e7..cc7c516 100644 --- a/Assets/Plugins/UniRx/ReadMe.txt.meta +++ b/Assets/Plugins/UniRx/ReadMe.txt.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 52d665ea30c2a3a49a6fa4b3b5a0349a timeCreated: 1455373909 -licenseType: Pro +licenseType: Store TextScriptImporter: userData: assetBundleName: diff --git a/Assets/Plugins/UniRx/Scripts.meta b/Assets/Plugins/UniRx/Scripts.meta index ce2a6dd..31d66f2 100644 --- a/Assets/Plugins/UniRx/Scripts.meta +++ b/Assets/Plugins/UniRx/Scripts.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: fa640d68fc4eb2042bbb273d3e3e0d09 +guid: eaf9ac9937118834c86197511fd5317f folderAsset: yes +timeCreated: 1455373896 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/AsyncUnit.cs b/Assets/Plugins/UniRx/Scripts/Async/AsyncUnit.cs deleted file mode 100644 index 1a8f09d..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/AsyncUnit.cs +++ /dev/null @@ -1,28 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or - -using System; - -namespace UniRx.Async -{ - public struct AsyncUnit : IEquatable - { - public static readonly AsyncUnit Default = new AsyncUnit(); - - public override int GetHashCode() - { - return 0; - } - - public bool Equals(AsyncUnit other) - { - return true; - } - - public override string ToString() - { - return "()"; - } - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenEqualityComparer.cs b/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenEqualityComparer.cs deleted file mode 100644 index 72cdea2..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenEqualityComparer.cs +++ /dev/null @@ -1,25 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; - -namespace UniRx.Async -{ - public class CancellationTokenEqualityComparer : IEqualityComparer - { - public static readonly IEqualityComparer Default = new CancellationTokenEqualityComparer(); - - public bool Equals(CancellationToken x, CancellationToken y) - { - return x.Equals(y); - } - - public int GetHashCode(CancellationToken obj) - { - return obj.GetHashCode(); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenExtensions.cs deleted file mode 100644 index 8bfe4be..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenExtensions.cs +++ /dev/null @@ -1,76 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Threading; - -namespace UniRx.Async -{ - public static class CancellationTokenExtensions - { - static readonly Action cancellationTokenCallback = Callback; - - public static (UniTask, CancellationTokenRegistration) ToUniTask(this CancellationToken cts) - { - if (cts.IsCancellationRequested) - { - return (UniTask.FromCanceled(cts), default(CancellationTokenRegistration)); - } - - var promise = new UniTaskCompletionSource(); - return (promise.Task, cts.RegisterWithoutCaptureExecutionContext(cancellationTokenCallback, promise)); - } - - static void Callback(object state) - { - var promise = (UniTaskCompletionSource)state; - promise.TrySetResult(AsyncUnit.Default); - } - - public static CancellationTokenRegistration RegisterWithoutCaptureExecutionContext(this CancellationToken cancellationToken, Action callback) - { - var restoreFlow = false; - if (!ExecutionContext.IsFlowSuppressed()) - { - ExecutionContext.SuppressFlow(); - restoreFlow = true; - } - - try - { - return cancellationToken.Register(callback, false); - } - finally - { - if (restoreFlow) - { - ExecutionContext.RestoreFlow(); - } - } - } - - public static CancellationTokenRegistration RegisterWithoutCaptureExecutionContext(this CancellationToken cancellationToken, Action callback, object state) - { - var restoreFlow = false; - if (!ExecutionContext.IsFlowSuppressed()) - { - ExecutionContext.SuppressFlow(); - restoreFlow = true; - } - - try - { - return cancellationToken.Register(callback, state, false); - } - finally - { - if (restoreFlow) - { - ExecutionContext.RestoreFlow(); - } - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenSourceExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenSourceExtensions.cs deleted file mode 100644 index 17618d7..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenSourceExtensions.cs +++ /dev/null @@ -1,48 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Threading; -using UnityEngine; -using UniRx.Async.Triggers; -using System; - -namespace UniRx.Async -{ - public static class CancellationTokenSourceExtensions - { - public static void CancelAfterSlim(this CancellationTokenSource cts, int millisecondsDelay, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update) - { - var delay = UniTask.Delay(millisecondsDelay, ignoreTimeScale, delayTiming, cts.Token); - CancelAfterCore(cts, delay).Forget(); - } - - public static void CancelAfterSlim(this CancellationTokenSource cts, TimeSpan delayTimeSpan, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update) - { - var delay = UniTask.Delay(delayTimeSpan, ignoreTimeScale, delayTiming, cts.Token); - CancelAfterCore(cts, delay).Forget(); - } - - static async UniTaskVoid CancelAfterCore(CancellationTokenSource cts, UniTask delayTask) - { - var alreadyCanceled = await delayTask.SuppressCancellationThrow(); - if (!alreadyCanceled) - { - cts.Cancel(); - cts.Dispose(); - } - } - - public static void RegisterRaiseCancelOnDestroy(this CancellationTokenSource cts, Component component) - { - RegisterRaiseCancelOnDestroy(cts, component.gameObject); - } - - public static void RegisterRaiseCancelOnDestroy(this CancellationTokenSource cts, GameObject gameObject) - { - var trigger = gameObject.GetAsyncDestroyTrigger(); - trigger.AddCancellationTriggerOnDestory(cts); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices.meta b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices.meta deleted file mode 100644 index 92dc576..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 522257e0538442a4b8de8de73b45a855 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncMethodBuilderAttribute.cs b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncMethodBuilderAttribute.cs deleted file mode 100644 index b9658c9..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncMethodBuilderAttribute.cs +++ /dev/null @@ -1,18 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -namespace System.Runtime.CompilerServices -{ - public sealed class AsyncMethodBuilderAttribute : Attribute - { - public Type BuilderType { get; } - - public AsyncMethodBuilderAttribute(Type builderType) - { - BuilderType = builderType; - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncMethodBuilderAttribute.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncMethodBuilderAttribute.cs.meta deleted file mode 100644 index 19961df..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncMethodBuilderAttribute.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 02ce354d37b10454e8376062f7cbe57a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskMethodBuilder.cs b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskMethodBuilder.cs deleted file mode 100644 index 586f859..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskMethodBuilder.cs +++ /dev/null @@ -1,274 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Diagnostics; -using System.Runtime.CompilerServices; -using System.Security; - -namespace UniRx.Async.CompilerServices -{ - public struct AsyncUniTaskMethodBuilder - { - UniTaskCompletionSource promise; - Action moveNext; - - // 1. Static Create method. - [DebuggerHidden] - public static AsyncUniTaskMethodBuilder Create() - { - var builder = new AsyncUniTaskMethodBuilder(); - return builder; - } - - // 2. TaskLike Task property. - [DebuggerHidden] - public UniTask Task - { - get - { - if (promise != null) - { - return promise.Task; - } - - if (moveNext == null) - { - return UniTask.CompletedTask; - } - else - { - promise = new UniTaskCompletionSource(); - return promise.Task; - } - } - } - - // 3. SetException - [DebuggerHidden] - public void SetException(Exception exception) - { - if (promise == null) - { - promise = new UniTaskCompletionSource(); - } - if (exception is OperationCanceledException ex) - { - promise.TrySetCanceled(ex); - } - else - { - promise.TrySetException(exception); - } - } - - // 4. SetResult - [DebuggerHidden] - public void SetResult() - { - if (moveNext == null) - { - } - else - { - if (promise == null) - { - promise = new UniTaskCompletionSource(); - } - promise.TrySetResult(); - } - } - - // 5. AwaitOnCompleted - [DebuggerHidden] - public void AwaitOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine) - where TAwaiter : INotifyCompletion - where TStateMachine : IAsyncStateMachine - { - if (moveNext == null) - { - if (promise == null) - { - promise = new UniTaskCompletionSource(); // built future. - } - - var runner = new MoveNextRunner(); - moveNext = runner.Run; - runner.StateMachine = stateMachine; // set after create delegate. - } - - awaiter.OnCompleted(moveNext); - } - - // 6. AwaitUnsafeOnCompleted - [DebuggerHidden] - [SecuritySafeCritical] - public void AwaitUnsafeOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine) - where TAwaiter : ICriticalNotifyCompletion - where TStateMachine : IAsyncStateMachine - { - if (moveNext == null) - { - if (promise == null) - { - promise = new UniTaskCompletionSource(); // built future. - } - - var runner = new MoveNextRunner(); - moveNext = runner.Run; - runner.StateMachine = stateMachine; // set after create delegate. - } - - awaiter.UnsafeOnCompleted(moveNext); - } - - // 7. Start - [DebuggerHidden] - public void Start(ref TStateMachine stateMachine) - where TStateMachine : IAsyncStateMachine - { - stateMachine.MoveNext(); - } - - // 8. SetStateMachine - [DebuggerHidden] - public void SetStateMachine(IAsyncStateMachine stateMachine) - { - } - } - - - public struct AsyncUniTaskMethodBuilder - { - T result; - UniTaskCompletionSource promise; - Action moveNext; - - // 1. Static Create method. - [DebuggerHidden] - public static AsyncUniTaskMethodBuilder Create() - { - var builder = new AsyncUniTaskMethodBuilder(); - return builder; - } - - // 2. TaskLike Task property. - [DebuggerHidden] - public UniTask Task - { - get - { - if (promise != null) - { - return new UniTask(promise); - } - - if (moveNext == null) - { - return new UniTask(result); - } - else - { - promise = new UniTaskCompletionSource(); - return new UniTask(promise); - } - } - } - - // 3. SetException - [DebuggerHidden] - public void SetException(Exception exception) - { - if (promise == null) - { - promise = new UniTaskCompletionSource(); - } - if (exception is OperationCanceledException ex) - { - promise.TrySetCanceled(ex); - } - else - { - promise.TrySetException(exception); - } - } - - // 4. SetResult - [DebuggerHidden] - public void SetResult(T result) - { - if (moveNext == null) - { - this.result = result; - } - else - { - if (promise == null) - { - promise = new UniTaskCompletionSource(); - } - promise.TrySetResult(result); - } - } - - // 5. AwaitOnCompleted - [DebuggerHidden] - public void AwaitOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine) - where TAwaiter : INotifyCompletion - where TStateMachine : IAsyncStateMachine - { - if (moveNext == null) - { - if (promise == null) - { - promise = new UniTaskCompletionSource(); // built future. - } - - var runner = new MoveNextRunner(); - moveNext = runner.Run; - runner.StateMachine = stateMachine; // set after create delegate. - } - - awaiter.OnCompleted(moveNext); - } - - // 6. AwaitUnsafeOnCompleted - [DebuggerHidden] - [SecuritySafeCritical] - public void AwaitUnsafeOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine) - where TAwaiter : ICriticalNotifyCompletion - where TStateMachine : IAsyncStateMachine - { - if (moveNext == null) - { - if (promise == null) - { - promise = new UniTaskCompletionSource(); // built future. - } - - var runner = new MoveNextRunner(); - moveNext = runner.Run; - runner.StateMachine = stateMachine; // set after create delegate. - } - - awaiter.UnsafeOnCompleted(moveNext); - } - - // 7. Start - [DebuggerHidden] - public void Start(ref TStateMachine stateMachine) - where TStateMachine : IAsyncStateMachine - { - stateMachine.MoveNext(); - } - - // 8. SetStateMachine - [DebuggerHidden] - public void SetStateMachine(IAsyncStateMachine stateMachine) - { - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskMethodBuilder.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskMethodBuilder.cs.meta deleted file mode 100644 index ad43cfc..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskMethodBuilder.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 68d72a45afdec574ebc26e7de2c38330 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs deleted file mode 100644 index 2fcd55f..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs +++ /dev/null @@ -1,90 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Diagnostics; -using System.Runtime.CompilerServices; -using System.Security; - -namespace UniRx.Async.CompilerServices -{ - public struct AsyncUniTaskVoidMethodBuilder - { - Action moveNext; - - // 1. Static Create method. - [DebuggerHidden] - public static AsyncUniTaskVoidMethodBuilder Create() - { - var builder = new AsyncUniTaskVoidMethodBuilder(); - return builder; - } - - // 2. TaskLike Task property(void) - public UniTaskVoid Task => default(UniTaskVoid); - - // 3. SetException - [DebuggerHidden] - public void SetException(Exception exception) - { - UniTaskScheduler.PublishUnobservedTaskException(exception); - } - - // 4. SetResult - [DebuggerHidden] - public void SetResult() - { - // do nothing - } - - // 5. AwaitOnCompleted - [DebuggerHidden] - public void AwaitOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine) - where TAwaiter : INotifyCompletion - where TStateMachine : IAsyncStateMachine - { - if (moveNext == null) - { - var runner = new MoveNextRunner(); - moveNext = runner.Run; - runner.StateMachine = stateMachine; // set after create delegate. - } - - awaiter.OnCompleted(moveNext); - } - - // 6. AwaitUnsafeOnCompleted - [DebuggerHidden] - [SecuritySafeCritical] - public void AwaitUnsafeOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine) - where TAwaiter : ICriticalNotifyCompletion - where TStateMachine : IAsyncStateMachine - { - if (moveNext == null) - { - var runner = new MoveNextRunner(); - moveNext = runner.Run; - runner.StateMachine = stateMachine; // set after create delegate. - } - - awaiter.UnsafeOnCompleted(moveNext); - } - - // 7. Start - [DebuggerHidden] - public void Start(ref TStateMachine stateMachine) - where TStateMachine : IAsyncStateMachine - { - stateMachine.MoveNext(); - } - - // 8. SetStateMachine - [DebuggerHidden] - public void SetStateMachine(IAsyncStateMachine stateMachine) - { - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs.meta deleted file mode 100644 index 9bcc50e..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e891aaac17b933a47a9d7fa3b8e1226f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/MoveNextRunner.cs b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/MoveNextRunner.cs deleted file mode 100644 index ddf7a03..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/MoveNextRunner.cs +++ /dev/null @@ -1,23 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Diagnostics; -using System.Runtime.CompilerServices; - -namespace UniRx.Async.CompilerServices -{ - internal class MoveNextRunner - where TStateMachine : IAsyncStateMachine - { - public TStateMachine StateMachine; - - [DebuggerHidden] - public void Run() - { - StateMachine.MoveNext(); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/MoveNextRunner.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/MoveNextRunner.cs.meta deleted file mode 100644 index 2cb82e0..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/CompilerServices/MoveNextRunner.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 98649642833cabf44a9dc060ce4c84a1 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/DiagnosticsExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/DiagnosticsExtensions.cs deleted file mode 100644 index 041b0c3..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/DiagnosticsExtensions.cs +++ /dev/null @@ -1,270 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Security; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -namespace UniRx.Async -{ - public static class DiagnosticsExtensions - { - static bool displayFilenames = true; - - static readonly Regex typeBeautifyRegex = new Regex("`.+$", RegexOptions.Compiled); - - static readonly Dictionary builtInTypeNames = new Dictionary - { - { typeof(void), "void" }, - { typeof(bool), "bool" }, - { typeof(byte), "byte" }, - { typeof(char), "char" }, - { typeof(decimal), "decimal" }, - { typeof(double), "double" }, - { typeof(float), "float" }, - { typeof(int), "int" }, - { typeof(long), "long" }, - { typeof(object), "object" }, - { typeof(sbyte), "sbyte" }, - { typeof(short), "short" }, - { typeof(string), "string" }, - { typeof(uint), "uint" }, - { typeof(ulong), "ulong" }, - { typeof(ushort), "ushort" }, - { typeof(Task), "Task" }, - { typeof(UniTask), "UniTask" }, - { typeof(UniTaskVoid), "UniTaskVoid" } - }; - - public static string ToStringWithCleanupAsyncStackTrace(this Exception exception) - { - if (exception == null) return ""; - - String message = exception.Message; - String s; - - if (message == null || message.Length <= 0) - { - s = exception.GetType().ToString(); - } - else - { - s = exception.GetType().ToString() + ": " + message; - } - - if (exception.InnerException != null) - { - s = s + " ---> " + exception.InnerException.ToString() + Environment.NewLine + " Exception_EndOfInnerExceptionStack"; - } - - string stackTrace = new StackTrace(exception).CleanupAsyncStackTrace(); - if (stackTrace != null) - { - s += Environment.NewLine + stackTrace; - } - - return s; - } - - public static string CleanupAsyncStackTrace(this StackTrace stackTrace) - { - if (stackTrace == null) return ""; - - var sb = new StringBuilder(); - for (int i = 0; i < stackTrace.FrameCount; i++) - { - var sf = stackTrace.GetFrame(i); - - var mb = sf.GetMethod(); - - if (IgnoreLine(mb)) continue; - if (IsAsync(mb)) - { - sb.Append("async "); - TryResolveStateMachineMethod(ref mb, out var decType); - } - - // return type - if (mb is MethodInfo mi) - { - sb.Append(BeautifyType(mi.ReturnType, false)); - sb.Append(" "); - } - - // method name - sb.Append(BeautifyType(mb.DeclaringType, false)); - if (!mb.IsConstructor) - { - sb.Append("."); - } - sb.Append(mb.Name); - if (mb.IsGenericMethod) - { - sb.Append("<"); - foreach (var item in mb.GetGenericArguments()) - { - sb.Append(BeautifyType(item, true)); - } - sb.Append(">"); - } - - // parameter - sb.Append("("); - sb.Append(string.Join(", ", mb.GetParameters().Select(p => BeautifyType(p.ParameterType, true) + " " + p.Name))); - sb.Append(")"); - - // file name - if (displayFilenames && (sf.GetILOffset() != -1)) - { - String fileName = null; - - try - { - fileName = sf.GetFileName(); - } - catch (NotSupportedException) - { - displayFilenames = false; - } - catch (SecurityException) - { - displayFilenames = false; - } - - if (fileName != null) - { - sb.Append(' '); - sb.AppendFormat(CultureInfo.InvariantCulture, "in {0}:{1}", SimplifyPath(fileName), sf.GetFileLineNumber()); - } - } - - sb.AppendLine(); - } - return sb.ToString(); - } - - - static bool IsAsync(MethodBase methodInfo) - { - var declareType = methodInfo.DeclaringType; - return typeof(IAsyncStateMachine).IsAssignableFrom(declareType); - } - - // code from Ben.Demystifier/EnhancedStackTrace.Frame.cs - static bool TryResolveStateMachineMethod(ref MethodBase method, out Type declaringType) - { - declaringType = method.DeclaringType; - - var parentType = declaringType.DeclaringType; - if (parentType == null) - { - return false; - } - - var methods = parentType.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly); - if (methods == null) - { - return false; - } - - foreach (var candidateMethod in methods) - { - var attributes = candidateMethod.GetCustomAttributes(); - if (attributes == null) - { - continue; - } - - foreach (var asma in attributes) - { - if (asma.StateMachineType == declaringType) - { - method = candidateMethod; - declaringType = candidateMethod.DeclaringType; - // Mark the iterator as changed; so it gets the + annotation of the original method - // async statemachines resolve directly to their builder methods so aren't marked as changed - return asma is IteratorStateMachineAttribute; - } - } - } - - return false; - } - - static string BeautifyType(Type t, bool shortName) - { - if (builtInTypeNames.TryGetValue(t, out var builtin)) - { - return builtin; - } - if (t.IsGenericParameter) return t.Name; - if (t.IsArray) return BeautifyType(t.GetElementType(), shortName) + "[]"; - if (t.FullName?.StartsWith("System.ValueTuple") ?? false) - { - return "(" + string.Join(", ", t.GetGenericArguments().Select(x => BeautifyType(x, true))) + ")"; - } - if (!t.IsGenericType) return shortName ? t.Name : t.FullName ?? t.Name; - - var innerFormat = string.Join(", ", t.GetGenericArguments().Select(x => BeautifyType(x, true))); - - var genericType = t.GetGenericTypeDefinition().FullName; - if (genericType == "System.Threading.Tasks.Task`1") - { - genericType = "Task"; - } - - return typeBeautifyRegex.Replace(genericType, "") + "<" + innerFormat + ">"; - } - - static bool IgnoreLine(MethodBase methodInfo) - { - var declareType = methodInfo.DeclaringType.FullName; - if (declareType == "System.Threading.ExecutionContext") - { - return true; - } - else if (declareType.StartsWith("System.Runtime.CompilerServices")) - { - return true; - } - else if (declareType.StartsWith("UniRx.Async.CompilerServices")) - { - return true; - } - else if (declareType == "System.Threading.Tasks.AwaitTaskContinuation") - { - return true; - } - else if (declareType.StartsWith("System.Threading.Tasks.Task")) - { - return true; - } - - return false; - } - - static string SimplifyPath(string path) - { - var fi = new FileInfo(path); - if (fi.Directory == null) - { - return fi.Name; - } - else - { - return fi.Directory.Name + "/" + fi.Name; - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/DiagnosticsExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/DiagnosticsExtensions.cs.meta deleted file mode 100644 index 6c1f06c..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/DiagnosticsExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f80fb1c9ed4c99447be1b0a47a8d980b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Editor.meta b/Assets/Plugins/UniRx/Scripts/Async/Editor.meta deleted file mode 100644 index 40bc442..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Editor.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b137462cdaca62241abbbe13cdf5c8ec -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Editor/SplitterGUILayout.cs b/Assets/Plugins/UniRx/Scripts/Async/Editor/SplitterGUILayout.cs deleted file mode 100644 index bca6a95..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Editor/SplitterGUILayout.cs +++ /dev/null @@ -1,64 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Linq; -using System.Reflection; -using UnityEditor; -using UnityEngine; - -namespace UniRx.Async.Editor -{ - // reflection call of UnityEditor.SplitterGUILayout - internal static class SplitterGUILayout - { - static BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static; - - static Lazy splitterStateType = new Lazy(() => - { - var type = typeof(EditorWindow).Assembly.GetTypes().First(x => x.FullName == "UnityEditor.SplitterState"); - return type; - }); - - static Lazy splitterStateCtor = new Lazy(() => - { - var type = splitterStateType.Value; - return type.GetConstructor(flags, null, new Type[] { typeof(float[]), typeof(int[]), typeof(int[]) }, null); - }); - - static Lazy splitterGUILayoutType = new Lazy(() => - { - var type = typeof(EditorWindow).Assembly.GetTypes().First(x => x.FullName == "UnityEditor.SplitterGUILayout"); - return type; - }); - - static Lazy beginVerticalSplit = new Lazy(() => - { - var type = splitterGUILayoutType.Value; - return type.GetMethod("BeginVerticalSplit", flags, null, new Type[] { splitterStateType.Value, typeof(GUILayoutOption[]) }, null); - }); - - static Lazy endVerticalSplit = new Lazy(() => - { - var type = splitterGUILayoutType.Value; - return type.GetMethod("EndVerticalSplit", flags, null, Type.EmptyTypes, null); - }); - - public static object CreateSplitterState(float[] relativeSizes, int[] minSizes, int[] maxSizes) - { - return splitterStateCtor.Value.Invoke(new object[] { relativeSizes, minSizes, maxSizes }); - } - - public static void BeginVerticalSplit(object splitterState, params GUILayoutOption[] options) - { - beginVerticalSplit.Value.Invoke(null, new object[] { splitterState, options }); - } - - public static void EndVerticalSplit() - { - endVerticalSplit.Value.Invoke(null, Type.EmptyTypes); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Editor/SplitterGUILayout.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Editor/SplitterGUILayout.cs.meta deleted file mode 100644 index 4d718f4..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Editor/SplitterGUILayout.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 40ef2e46f900131419e869398a8d3c9d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniRx.Async.Editor.asmdef b/Assets/Plugins/UniRx/Scripts/Async/Editor/UniRx.Async.Editor.asmdef deleted file mode 100644 index 37c0de4..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniRx.Async.Editor.asmdef +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "UniRx.Async.Editor", - "references": [ - "UniRx.Async" - ], - "optionalUnityReferences": [], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false -} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerTreeView.cs b/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerTreeView.cs deleted file mode 100644 index 7e03931..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerTreeView.cs +++ /dev/null @@ -1,180 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System; -using UnityEditor.IMGUI.Controls; -using UniRx.Async.Internal; -using System.Text; - -namespace UniRx.Async.Editor -{ - public class UniTaskTrackerViewItem : TreeViewItem - { - public string TaskType { get; set; } - public string Elapsed { get; set; } - public string Status { get; set; } - - string position; - public string Position - { - get { return position; } - set - { - position = value; - PositionFirstLine = GetFirstLine(position); - } - } - - public string PositionFirstLine { get; private set; } - - static string GetFirstLine(string str) - { - var sb = new StringBuilder(); - for (int i = 0; i < str.Length; i++) - { - if (str[i] == '\r' || str[i] == '\n') - { - break; - } - sb.Append(str[i]); - } - return sb.ToString(); - } - - public UniTaskTrackerViewItem(int id) : base(id) - { - - } - } - - public class UniTaskTrackerTreeView : TreeView - { - const string sortedColumnIndexStateKey = "UniTaskTrackerTreeView_sortedColumnIndex"; - - public IReadOnlyList CurrentBindingItems; - - public UniTaskTrackerTreeView() - : this(new TreeViewState(), new MultiColumnHeader(new MultiColumnHeaderState(new[] - { - new MultiColumnHeaderState.Column() { headerContent = new GUIContent("TaskType"), width = 20}, - new MultiColumnHeaderState.Column() { headerContent = new GUIContent("Elapsed"), width = 10}, - new MultiColumnHeaderState.Column() { headerContent = new GUIContent("Status"), width = 10}, - new MultiColumnHeaderState.Column() { headerContent = new GUIContent("Position")}, - }))) - { - } - - UniTaskTrackerTreeView(TreeViewState state, MultiColumnHeader header) - : base(state, header) - { - rowHeight = 20; - showAlternatingRowBackgrounds = true; - showBorder = true; - header.sortingChanged += Header_sortingChanged; - - header.ResizeToFit(); - Reload(); - - header.sortedColumnIndex = SessionState.GetInt(sortedColumnIndexStateKey, 1); - } - - public void ReloadAndSort() - { - var currentSelected = this.state.selectedIDs; - Reload(); - Header_sortingChanged(this.multiColumnHeader); - this.state.selectedIDs = currentSelected; - } - - private void Header_sortingChanged(MultiColumnHeader multiColumnHeader) - { - SessionState.SetInt(sortedColumnIndexStateKey, multiColumnHeader.sortedColumnIndex); - var index = multiColumnHeader.sortedColumnIndex; - var ascending = multiColumnHeader.IsSortedAscending(multiColumnHeader.sortedColumnIndex); - - var items = rootItem.children.Cast(); - - IOrderedEnumerable orderedEnumerable; - switch (index) - { - case 0: - orderedEnumerable = ascending ? items.OrderBy(item => item.TaskType) : items.OrderByDescending(item => item.TaskType); - break; - case 1: - orderedEnumerable = ascending ? items.OrderBy(item => double.Parse(item.Elapsed)) : items.OrderByDescending(item => double.Parse(item.Elapsed)); - break; - case 2: - orderedEnumerable = ascending ? items.OrderBy(item => item.Status) : items.OrderByDescending(item => item.Elapsed); - break; - case 3: - orderedEnumerable = ascending ? items.OrderBy(item => item.Position) : items.OrderByDescending(item => item.PositionFirstLine); - break; - default: - throw new ArgumentOutOfRangeException(nameof(index), index, null); - } - - CurrentBindingItems = rootItem.children = orderedEnumerable.Cast().ToList(); - BuildRows(rootItem); - } - - protected override TreeViewItem BuildRoot() - { - var root = new TreeViewItem { depth = -1 }; - - var children = new List(); - - TaskTracker.ForEachActiveTask((trackingId, awaiterType, status, created, stackTrace) => - { - children.Add(new UniTaskTrackerViewItem(trackingId) { TaskType = awaiterType, Status = status.ToString(), Elapsed = (DateTime.UtcNow - created).TotalSeconds.ToString("00.00"), Position = stackTrace }); - }); - - CurrentBindingItems = children; - root.children = CurrentBindingItems as List; - return root; - } - - protected override bool CanMultiSelect(TreeViewItem item) - { - return false; - } - - protected override void RowGUI(RowGUIArgs args) - { - var item = args.item as UniTaskTrackerViewItem; - - for (var visibleColumnIndex = 0; visibleColumnIndex < args.GetNumVisibleColumns(); visibleColumnIndex++) - { - var rect = args.GetCellRect(visibleColumnIndex); - var columnIndex = args.GetColumn(visibleColumnIndex); - - var labelStyle = args.selected ? EditorStyles.whiteLabel : EditorStyles.label; - labelStyle.alignment = TextAnchor.MiddleLeft; - switch (columnIndex) - { - case 0: - EditorGUI.LabelField(rect, item.TaskType, labelStyle); - break; - case 1: - EditorGUI.LabelField(rect, item.Elapsed, labelStyle); - break; - case 2: - EditorGUI.LabelField(rect, item.Status, labelStyle); - break; - case 3: - EditorGUI.LabelField(rect, item.PositionFirstLine, labelStyle); - break; - default: - throw new ArgumentOutOfRangeException(nameof(columnIndex), columnIndex, null); - } - } - } - } - -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerTreeView.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerTreeView.cs.meta deleted file mode 100644 index 9b34d7b..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerTreeView.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 52e2d973a2156674e8c1c9433ed031f7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerWindow.cs b/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerWindow.cs deleted file mode 100644 index 5acb2c4..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerWindow.cs +++ /dev/null @@ -1,211 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System; -using UnityEditor.IMGUI.Controls; -using UniRx.Async.Internal; - -namespace UniRx.Async.Editor -{ - public class UniTaskTrackerWindow : EditorWindow - { - static int interval; - - static UniTaskTrackerWindow window; - - [MenuItem("Window/UniRx/UniTask Tracker")] - public static void OpenWindow() - { - if (window != null) - { - window.Close(); - } - - // will called OnEnable(singleton instance will be set). - GetWindow("UniTask Tracker").Show(); - } - - static readonly GUILayoutOption[] EmptyLayoutOption = new GUILayoutOption[0]; - - UniTaskTrackerTreeView treeView; - object splitterState; - - void OnEnable() - { - window = this; // set singleton. - splitterState = SplitterGUILayout.CreateSplitterState(new float[] { 75f, 25f }, new int[] { 32, 32 }, null); - treeView = new UniTaskTrackerTreeView(); - TaskTracker.EditorEnableState.EnableAutoReload = EditorPrefs.GetBool(TaskTracker.EnableAutoReloadKey, false); - TaskTracker.EditorEnableState.EnableTracking = EditorPrefs.GetBool(TaskTracker.EnableTrackingKey, false); - TaskTracker.EditorEnableState.EnableStackTrace = EditorPrefs.GetBool(TaskTracker.EnableStackTraceKey, false); - } - - void OnGUI() - { - // Head - RenderHeadPanel(); - - // Splittable - SplitterGUILayout.BeginVerticalSplit(this.splitterState, EmptyLayoutOption); - { - // Column Tabble - RenderTable(); - - // StackTrace details - RenderDetailsPanel(); - } - SplitterGUILayout.EndVerticalSplit(); - } - - #region HeadPanel - - public static bool EnableAutoReload => TaskTracker.EditorEnableState.EnableAutoReload; - public static bool EnableTracking => TaskTracker.EditorEnableState.EnableTracking; - public static bool EnableStackTrace => TaskTracker.EditorEnableState.EnableStackTrace; - static readonly GUIContent EnableAutoReloadHeadContent = EditorGUIUtility.TrTextContent("Enable AutoReload", "Reload automatically.", (Texture)null); - static readonly GUIContent ReloadHeadContent = EditorGUIUtility.TrTextContent("Reload", "Reload View.", (Texture)null); - static readonly GUIContent GCHeadContent = EditorGUIUtility.TrTextContent("GC.Collect", "Invoke GC.Collect.", (Texture)null); - static readonly GUIContent EnableTrackingHeadContent = EditorGUIUtility.TrTextContent("Enable Tracking", "Start to track async/await UniTask. Performance impact: low", (Texture)null); - static readonly GUIContent EnableStackTraceHeadContent = EditorGUIUtility.TrTextContent("Enable StackTrace", "Capture StackTrace when task is started. Performance impact: high", (Texture)null); - - // [Enable Tracking] | [Enable StackTrace] - void RenderHeadPanel() - { - EditorGUILayout.BeginVertical(EmptyLayoutOption); - EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, EmptyLayoutOption); - - if (GUILayout.Toggle(EnableAutoReload, EnableAutoReloadHeadContent, EditorStyles.toolbarButton, EmptyLayoutOption) != EnableAutoReload) - { - TaskTracker.EditorEnableState.EnableAutoReload = !EnableAutoReload; - } - - if (GUILayout.Toggle(EnableTracking, EnableTrackingHeadContent, EditorStyles.toolbarButton, EmptyLayoutOption) != EnableTracking) - { - TaskTracker.EditorEnableState.EnableTracking = !EnableTracking; - } - - if (GUILayout.Toggle(EnableStackTrace, EnableStackTraceHeadContent, EditorStyles.toolbarButton, EmptyLayoutOption) != EnableStackTrace) - { - TaskTracker.EditorEnableState.EnableStackTrace = !EnableStackTrace; - } - - GUILayout.FlexibleSpace(); - - if (GUILayout.Button(ReloadHeadContent, EditorStyles.toolbarButton, EmptyLayoutOption)) - { - TaskTracker.CheckAndResetDirty(); - treeView.ReloadAndSort(); - Repaint(); - } - - if (GUILayout.Button(GCHeadContent, EditorStyles.toolbarButton, EmptyLayoutOption)) - { - GC.Collect(0); - } - - EditorGUILayout.EndHorizontal(); - EditorGUILayout.EndVertical(); - } - - #endregion - - #region TableColumn - - Vector2 tableScroll; - GUIStyle tableListStyle; - - void RenderTable() - { - if (tableListStyle == null) - { - tableListStyle = new GUIStyle("CN Box"); - tableListStyle.margin.top = 0; - tableListStyle.padding.left = 3; - } - - EditorGUILayout.BeginVertical(tableListStyle, EmptyLayoutOption); - - this.tableScroll = EditorGUILayout.BeginScrollView(this.tableScroll, new GUILayoutOption[] - { - GUILayout.ExpandWidth(true), - GUILayout.MaxWidth(2000f) - }); - var controlRect = EditorGUILayout.GetControlRect(new GUILayoutOption[] - { - GUILayout.ExpandHeight(true), - GUILayout.ExpandWidth(true) - }); - - - treeView?.OnGUI(controlRect); - - EditorGUILayout.EndScrollView(); - EditorGUILayout.EndVertical(); - } - - private void Update() - { - if (EnableAutoReload) - { - if (interval++ % 120 == 0) - { - if (TaskTracker.CheckAndResetDirty()) - { - treeView.ReloadAndSort(); - Repaint(); - } - } - } - } - - #endregion - - #region Details - - static GUIStyle detailsStyle; - Vector2 detailsScroll; - - void RenderDetailsPanel() - { - if (detailsStyle == null) - { - detailsStyle = new GUIStyle(EditorStyles.wordWrappedLabel); - detailsStyle.wordWrap = false; - detailsStyle.stretchHeight = true; - detailsStyle.margin.right = 15; - } - - string message = ""; - var selected = treeView.state.selectedIDs; - if (selected.Count > 0) - { - var first = selected[0]; - var item = treeView.CurrentBindingItems.FirstOrDefault(x => x.id == first) as UniTaskTrackerViewItem; - if (item != null) - { - message = item.Position; - } - } - - detailsScroll = EditorGUILayout.BeginScrollView(this.detailsScroll, EmptyLayoutOption); - var vector = detailsStyle.CalcSize(new GUIContent(message)); - EditorGUILayout.SelectableLabel(message, detailsStyle, new GUILayoutOption[] - { - GUILayout.ExpandHeight(true), - GUILayout.ExpandWidth(true), - GUILayout.MinWidth(vector.x), - GUILayout.MinHeight(vector.y) - }); - EditorGUILayout.EndScrollView(); - } - - #endregion - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerWindow.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerWindow.cs.meta deleted file mode 100644 index ba1b704..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniTaskTrackerWindow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5bee3e3860e37484aa3b861bf76d129f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/EnumerableAsyncExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/EnumerableAsyncExtensions.cs deleted file mode 100644 index 344ccc4..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/EnumerableAsyncExtensions.cs +++ /dev/null @@ -1,36 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections.Generic; - -namespace UniRx.Async -{ - public static class EnumerableAsyncExtensions - { - // overload resolver - .Select(async x => { }) : IEnumerable> - - public static IEnumerable Select(this IEnumerable source, Func selector) - { - return System.Linq.Enumerable.Select(source, selector); - } - - public static IEnumerable> Select(this IEnumerable source, Func> selector) - { - return System.Linq.Enumerable.Select(source, selector); - } - - public static IEnumerable Select(this IEnumerable source, Func selector) - { - return System.Linq.Enumerable.Select(source, selector); - } - - public static IEnumerable> Select(this IEnumerable source, Func> selector) - { - return System.Linq.Enumerable.Select(source, selector); - } - } -} - - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/EnumerableAsyncExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/EnumerableAsyncExtensions.cs.meta deleted file mode 100644 index d2e4930..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/EnumerableAsyncExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ff50260d74bd54c4b92cf99895549445 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/EnumeratorAsyncExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/EnumeratorAsyncExtensions.cs deleted file mode 100644 index 5f3411e..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/EnumeratorAsyncExtensions.cs +++ /dev/null @@ -1,149 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections; -using System.Runtime.ExceptionServices; -using System.Threading; -using UniRx.Async.Internal; - -namespace UniRx.Async -{ - public static class EnumeratorAsyncExtensions - { - public static IAwaiter GetAwaiter(this IEnumerator enumerator) - { - var awaiter = new EnumeratorAwaiter(enumerator, CancellationToken.None); - if (!awaiter.IsCompleted) - { - PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, awaiter); - } - return awaiter; - } - - public static UniTask ToUniTask(this IEnumerator enumerator) - { - var awaiter = new EnumeratorAwaiter(enumerator, CancellationToken.None); - if (!awaiter.IsCompleted) - { - PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, awaiter); - } - return new UniTask(awaiter); - } - - public static UniTask ConfigureAwait(this IEnumerator enumerator, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken)) - { - var awaiter = new EnumeratorAwaiter(enumerator, cancellationToken); - if (!awaiter.IsCompleted) - { - PlayerLoopHelper.AddAction(timing, awaiter); - } - return new UniTask(awaiter); - } - - class EnumeratorAwaiter : IAwaiter, IPlayerLoopItem - { - IEnumerator innerEnumerator; - CancellationToken cancellationToken; - Action continuation; - AwaiterStatus status; - ExceptionDispatchInfo exception; - - public EnumeratorAwaiter(IEnumerator innerEnumerator, CancellationToken cancellationToken) - { - if (cancellationToken.IsCancellationRequested) - { - status = AwaiterStatus.Canceled; - return; - } - - this.innerEnumerator = innerEnumerator; - this.status = AwaiterStatus.Pending; - this.cancellationToken = cancellationToken; - this.continuation = null; - - TaskTracker.TrackActiveTask(this, 2); - } - - public bool IsCompleted => status.IsCompleted(); - - public AwaiterStatus Status => status; - - public void GetResult() - { - switch (status) - { - case AwaiterStatus.Succeeded: - break; - case AwaiterStatus.Pending: - Error.ThrowNotYetCompleted(); - break; - case AwaiterStatus.Faulted: - exception.Throw(); - break; - case AwaiterStatus.Canceled: - Error.ThrowOperationCanceledException(); - break; - default: - break; - } - } - - public bool MoveNext() - { - if (cancellationToken.IsCancellationRequested) - { - InvokeContinuation(AwaiterStatus.Canceled); - return false; - } - - var success = false; - try - { - if (innerEnumerator.MoveNext()) - { - return true; - } - else - { - success = true; - } - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - } - - InvokeContinuation(success ? AwaiterStatus.Succeeded : AwaiterStatus.Faulted); - return false; - } - - void InvokeContinuation(AwaiterStatus status) - { - this.status = status; - var cont = this.continuation; - - // cleanup - TaskTracker.RemoveTracking(this); - this.continuation = null; - this.cancellationToken = CancellationToken.None; - this.innerEnumerator = null; - - if (cont != null) cont.Invoke(); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - Error.ThrowWhenContinuationIsAlreadyRegistered(this.continuation); - this.continuation = continuation; - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/EnumeratorAsyncExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/EnumeratorAsyncExtensions.cs.meta deleted file mode 100644 index a07b336..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/EnumeratorAsyncExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: bc661232f11e4a741af54ba1c175d5ee -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/IAwaiter.cs b/Assets/Plugins/UniRx/Scripts/Async/IAwaiter.cs deleted file mode 100644 index 6450ea5..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/IAwaiter.cs +++ /dev/null @@ -1,64 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 - -using System.Runtime.CompilerServices; - -namespace UniRx.Async -{ - public enum AwaiterStatus - { - /// The operation has not yet completed. - Pending = 0, - /// The operation completed successfully. - Succeeded = 1, - /// The operation completed with an error. - Faulted = 2, - /// The operation completed due to cancellation. - Canceled = 3 - } - - public interface IAwaiter : ICriticalNotifyCompletion - { - AwaiterStatus Status { get; } - bool IsCompleted { get; } - void GetResult(); - } - - public interface IAwaiter : IAwaiter - { - new T GetResult(); - } - - public static class AwaiterStatusExtensions - { - /// != Pending. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsCompleted(this AwaiterStatus status) - { - return status != AwaiterStatus.Pending; - } - - /// == Succeeded. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsCompletedSuccessfully(this AwaiterStatus status) - { - return status == AwaiterStatus.Succeeded; - } - - /// == Canceled. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsCanceled(this AwaiterStatus status) - { - return status == AwaiterStatus.Canceled; - } - - /// == Faulted. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsFaulted(this AwaiterStatus status) - { - return status == AwaiterStatus.Faulted; - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/IAwaiter.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/IAwaiter.cs.meta deleted file mode 100644 index b225d1c..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/IAwaiter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3e4d023d8404ab742b5e808c98097c3c -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal.meta deleted file mode 100644 index 969dff2..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6e46ed1732c4cff4991621cfd4743590 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs deleted file mode 100644 index 75bc2f9..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs +++ /dev/null @@ -1,152 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Threading; - -namespace UniRx.Async.Internal -{ - // Same interface as System.Buffers.ArrayPool but only provides Shared. - - public sealed class ArrayPool // public, can use from other assembly. - { - // Same size as System.Buffers.DefaultArrayPool - const int DefaultMaxNumberOfArraysPerBucket = 50; - - static readonly T[] EmptyArray = new T[0]; - - public static readonly ArrayPool Shared = new ArrayPool(); - - readonly MinimumQueue[] buckets; - readonly SpinLock[] locks; - - ArrayPool() - { - // see: GetQueueIndex - buckets = new MinimumQueue[18]; - locks = new SpinLock[18]; - for (int i = 0; i < buckets.Length; i++) - { - buckets[i] = new MinimumQueue(4); - locks[i] = new SpinLock(false); - } - } - - public T[] Rent(int minimumLength) - { - if (minimumLength < 0) - { - throw new ArgumentOutOfRangeException("minimumLength"); - } - else if (minimumLength == 0) - { - return EmptyArray; - } - - var size = CalculateSize(minimumLength); - var index = GetQueueIndex(size); - if (index != -1) - { - var q = buckets[index]; - var lockTaken = false; - try - { - locks[index].Enter(ref lockTaken); - - if (q.Count != 0) - { - return q.Dequeue(); - } - } - finally - { - if (lockTaken) locks[index].Exit(false); - } - } - - return new T[size]; - } - - public void Return(T[] array, bool clearArray = false) - { - if (array == null || array.Length == 0) - { - return; - } - - var index = GetQueueIndex(array.Length); - if (index != -1) - { - if (clearArray) - { - Array.Clear(array, 0, array.Length); - } - - var q = buckets[index]; - var lockTaken = false; - - try - { - locks[index].Enter(ref lockTaken); - - if (q.Count > DefaultMaxNumberOfArraysPerBucket) - { - return; - } - - q.Enqueue(array); - } - finally - { - if (lockTaken) locks[index].Exit(false); - } - } - } - - static int CalculateSize(int size) - { - size--; - size |= size >> 1; - size |= size >> 2; - size |= size >> 4; - size |= size >> 8; - size |= size >> 16; - size += 1; - - if (size < 8) - { - size = 8; - } - - return size; - } - - static int GetQueueIndex(int size) - { - switch (size) - { - case 8: return 0; - case 16: return 1; - case 32: return 2; - case 64: return 3; - case 128: return 4; - case 256: return 5; - case 512: return 6; - case 1024: return 7; - case 2048: return 8; - case 4096: return 9; - case 8192: return 10; - case 16384: return 11; - case 32768: return 12; - case 65536: return 13; - case 131072: return 14; - case 262144: return 15; - case 524288: return 16; - case 1048576: return 17; // max array length - default: - return -1; - } - } - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs.meta deleted file mode 100644 index 693816c..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPool.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f83ebad81fb89fb4882331616ca6d248 -timeCreated: 1532361008 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs deleted file mode 100644 index 5f9ae6a..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs +++ /dev/null @@ -1,112 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; - -namespace UniRx.Async.Internal -{ - public static class ArrayPoolUtil - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void EnsureCapacity(ref T[] array, int index, ArrayPool pool) - { - if (array.Length <= index) - { - EnsureCapacityCore(ref array, index, pool); - } - } - - [MethodImpl(MethodImplOptions.NoInlining)] - static void EnsureCapacityCore(ref T[] array, int index, ArrayPool pool) - { - if (array.Length <= index) - { - var newSize = array.Length * 2; - var newArray = pool.Rent((index < newSize) ? newSize : (index * 2)); - Array.Copy(array, 0, newArray, 0, array.Length); - - pool.Return(array, clearArray: !RuntimeHelpersAbstraction.IsWellKnownNoReferenceContainsType()); - - array = newArray; - } - } - - public static RentArray Materialize(IEnumerable source) - { - if (source is T[] array) - { - return new RentArray(array, array.Length, null); - } - - var defaultCount = 4; - if (source is ICollection coll) - { - defaultCount = coll.Count; - var pool = ArrayPool.Shared; - var buffer = pool.Rent(defaultCount); - coll.CopyTo(buffer, 0); - return new RentArray(buffer, coll.Count, pool); - } - else if (source is IReadOnlyCollection rcoll) - { - defaultCount = rcoll.Count; - } - - if (defaultCount == 0) - { - return new RentArray(Array.Empty(), 0, null); - } - - { - var pool = ArrayPool.Shared; - - var index = 0; - var buffer = pool.Rent(defaultCount); - foreach (var item in source) - { - EnsureCapacity(ref buffer, index, pool); - buffer[index++] = item; - } - - return new RentArray(buffer, index, pool); - } - } - - public struct RentArray : IDisposable - { - public readonly T[] Array; - public readonly int Length; - ArrayPool pool; - - public RentArray(T[] array, int length, ArrayPool pool) - { - this.Array = array; - this.Length = length; - this.pool = pool; - } - - public void Dispose() - { - DisposeManually(!RuntimeHelpersAbstraction.IsWellKnownNoReferenceContainsType()); - } - - public void DisposeManually(bool clearArray) - { - if (pool != null) - { - if (clearArray) - { - System.Array.Clear(Array, 0, Length); - } - - pool.Return(Array, clearArray: false); - pool = null; - } - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs.meta deleted file mode 100644 index e06ec65..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayPoolUtil.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 424cc208fb61d4e448b08fcfa0eee25e -timeCreated: 1532361007 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs deleted file mode 100644 index 114a103..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs +++ /dev/null @@ -1,75 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; - -namespace UniRx.Async.Internal -{ - public static class ArrayUtil - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void EnsureCapacity(ref T[] array, int index) - { - if (array.Length <= index) - { - EnsureCore(ref array, index); - } - } - - // rare case, no inlining. - [MethodImpl(MethodImplOptions.NoInlining)] - static void EnsureCore(ref T[] array, int index) - { - var newSize = array.Length * 2; - var newArray = new T[(index < newSize) ? newSize : (index * 2)]; - Array.Copy(array, 0, newArray, 0, array.Length); - - array = newArray; - } - - /// - /// Optimizing utility to avoid .ToArray() that creates buffer copy(cut to just size). - /// - public static (T[] array, int length) Materialize(IEnumerable source) - { - if (source is T[] array) - { - return (array, array.Length); - } - - var defaultCount = 4; - if (source is ICollection coll) - { - defaultCount = coll.Count; - var buffer = new T[defaultCount]; - coll.CopyTo(buffer, 0); - return (buffer, defaultCount); - } - else if (source is IReadOnlyCollection rcoll) - { - defaultCount = rcoll.Count; - } - - if (defaultCount == 0) - { - return (Array.Empty(), 0); - } - - { - var index = 0; - var buffer = new T[defaultCount]; - foreach (var item in source) - { - EnsureCapacity(ref buffer, index); - buffer[index++] = item; - } - - return (buffer, index); - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs.meta deleted file mode 100644 index 645fc4e..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ArrayUtil.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 23146a82ec99f2542a87971c8d3d7988 -timeCreated: 1532361007 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/CancellationTokenHelper.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/CancellationTokenHelper.cs deleted file mode 100644 index 93b3f52..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/CancellationTokenHelper.cs +++ /dev/null @@ -1,32 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Threading; - -namespace UniRx.Async.Internal -{ - public static class CancellationTokenHelper - { - public static bool TrySetOrLinkCancellationToken(ref CancellationToken field, CancellationToken newCancellationToken) - { - if (newCancellationToken == CancellationToken.None) - { - return false; - } - else if (field == CancellationToken.None) - { - field = newCancellationToken; - return true; - } - else if (field == newCancellationToken) - { - return false; - } - - field = CancellationTokenSource.CreateLinkedTokenSource(field, newCancellationToken).Token; - return true; - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/CancellationTokenHelper.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/CancellationTokenHelper.cs.meta deleted file mode 100644 index bf09591..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/CancellationTokenHelper.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 53d1b536fc7e2d4458294ee2c7d9b743 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ContinuationQueue.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/ContinuationQueue.cs deleted file mode 100644 index 41bb5be..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ContinuationQueue.cs +++ /dev/null @@ -1,115 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Threading; - -namespace UniRx.Async.Internal -{ - internal class ContinuationQueue - { - const int MaxArrayLength = 0X7FEFFFFF; - const int InitialSize = 16; - - SpinLock gate = new SpinLock(); - bool dequing = false; - - int actionListCount = 0; - Action[] actionList = new Action[InitialSize]; - - int waitingListCount = 0; - Action[] waitingList = new Action[InitialSize]; - - public void Enqueue(Action continuation) - { - bool lockTaken = false; - try - { - gate.Enter(ref lockTaken); - - if (dequing) - { - // Ensure Capacity - if (waitingList.Length == waitingListCount) - { - var newLength = waitingListCount * 2; - if ((uint)newLength > MaxArrayLength) newLength = MaxArrayLength; - - var newArray = new Action[newLength]; - Array.Copy(waitingList, newArray, waitingListCount); - waitingList = newArray; - } - waitingList[waitingListCount] = continuation; - waitingListCount++; - } - else - { - // Ensure Capacity - if (actionList.Length == actionListCount) - { - var newLength = actionListCount * 2; - if ((uint)newLength > MaxArrayLength) newLength = MaxArrayLength; - - var newArray = new Action[newLength]; - Array.Copy(actionList, newArray, actionListCount); - actionList = newArray; - } - actionList[actionListCount] = continuation; - actionListCount++; - } - } - finally - { - if (lockTaken) gate.Exit(false); - } - } - - public void Run() - { - { - bool lockTaken = false; - try - { - gate.Enter(ref lockTaken); - if (actionListCount == 0) return; - dequing = true; - } - finally - { - if (lockTaken) gate.Exit(false); - } - } - - for (int i = 0; i < actionListCount; i++) - { - var action = actionList[i]; - actionList[i] = null; - - action(); - } - - { - bool lockTaken = false; - try - { - gate.Enter(ref lockTaken); - dequing = false; - - var swapTempActionList = actionList; - - actionListCount = waitingListCount; - actionList = waitingList; - - waitingListCount = 0; - waitingList = swapTempActionList; - } - finally - { - if (lockTaken) gate.Exit(false); - } - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ContinuationQueue.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/ContinuationQueue.cs.meta deleted file mode 100644 index b04e541..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ContinuationQueue.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f66c32454e50f2546b17deadc80a4c77 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs deleted file mode 100644 index 378af62..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs +++ /dev/null @@ -1,63 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Runtime.CompilerServices; - -namespace UniRx.Async.Internal -{ - internal static class Error - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void ThrowArgumentNullException(T value, string paramName) - where T : class - { - if (value == null) ThrowArgumentNullExceptionCore(paramName); - } - - [MethodImpl(MethodImplOptions.NoInlining)] - static void ThrowArgumentNullExceptionCore(string paramName) - { - throw new ArgumentNullException(paramName); - } - - [MethodImpl(MethodImplOptions.NoInlining)] - public static void ThrowArgumentException(string message) - { - throw new ArgumentException(message); - } - - [MethodImpl(MethodImplOptions.NoInlining)] - public static void ThrowNotYetCompleted() - { - throw new InvalidOperationException("Not yet completed."); - } - - [MethodImpl(MethodImplOptions.NoInlining)] - public static T ThrowNotYetCompleted() - { - throw new InvalidOperationException("Not yet completed."); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void ThrowWhenContinuationIsAlreadyRegistered(T continuationField) - where T : class - { - if (continuationField != null) ThrowInvalidOperationExceptionCore("continuation is already registered."); - } - - [MethodImpl(MethodImplOptions.NoInlining)] - static void ThrowInvalidOperationExceptionCore(string message) - { - throw new InvalidOperationException(message); - } - - [MethodImpl(MethodImplOptions.NoInlining)] - public static void ThrowOperationCanceledException() - { - throw new OperationCanceledException(); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs.meta deleted file mode 100644 index 2e5d219..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/Error.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 5f39f495294d4604b8082202faf98554 -timeCreated: 1532361007 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/Hack.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/Hack.cs deleted file mode 100644 index 7c600d0..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/Hack.cs +++ /dev/null @@ -1,23 +0,0 @@ -#if NET_4_6 || NET_STANDARD_2_0 || CSHARP_7_OR_LATER - -using System; - -namespace UniRx.Async.Internal -{ - internal static class FuncExtensions - { - // avoid lambda capture - - internal static Action AsFuncOfT(this Action action) - { - return new Action(action.Invoke); - } - - static void Invoke(this Action action, T unused) - { - action(); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/Hack.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/Hack.cs.meta deleted file mode 100644 index e77edfc..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/Hack.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4d5a9a3e1f0f069478969f752fde29a9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/LazyPromise.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/LazyPromise.cs deleted file mode 100644 index e62fd59..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/LazyPromise.cs +++ /dev/null @@ -1,130 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Threading; - -namespace UniRx.Async.Internal -{ - internal sealed class LazyPromise : IAwaiter - { - Func factory; - UniTask value; - - public LazyPromise(Func factory) - { - this.factory = factory; - } - - void Create() - { - var f = Interlocked.Exchange(ref factory, null); - if (f != null) - { - value = f(); - } - } - - public bool IsCompleted - { - get - { - Create(); - return value.IsCompleted; - } - } - - public AwaiterStatus Status - { - get - { - Create(); - return value.Status; - } - } - - public void GetResult() - { - Create(); - value.GetResult(); - } - - void IAwaiter.GetResult() - { - GetResult(); - } - - public void UnsafeOnCompleted(Action continuation) - { - Create(); - value.GetAwaiter().UnsafeOnCompleted(continuation); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - } - - internal sealed class LazyPromise : IAwaiter - { - Func> factory; - UniTask value; - - public LazyPromise(Func> factory) - { - this.factory = factory; - } - - void Create() - { - var f = Interlocked.Exchange(ref factory, null); - if (f != null) - { - value = f(); - } - } - - public bool IsCompleted - { - get - { - Create(); - return value.IsCompleted; - } - } - - public AwaiterStatus Status - { - get - { - Create(); - return value.Status; - } - } - - public T GetResult() - { - Create(); - return value.Result; - } - - void IAwaiter.GetResult() - { - GetResult(); - } - - public void UnsafeOnCompleted(Action continuation) - { - Create(); - value.GetAwaiter().UnsafeOnCompleted(continuation); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/LazyPromise.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/LazyPromise.cs.meta deleted file mode 100644 index ee8f3f7..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/LazyPromise.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fe7a4187b7f89f84582fd1e466a7f27e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/MinimumQueue.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/MinimumQueue.cs deleted file mode 100644 index 0cc40cd..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/MinimumQueue.cs +++ /dev/null @@ -1,122 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member -#endif - -using System; -using System.Runtime.CompilerServices; - -namespace UniRx.Async.Internal -{ - // optimized version of Standard Queue. - public class MinimumQueue - { - const int MinimumGrow = 4; - const int GrowFactor = 200; - - T[] array; - int head; - int tail; - int size; - - public MinimumQueue(int capacity) - { - if (capacity < 0) throw new ArgumentOutOfRangeException("capacity"); - array = new T[capacity]; - head = tail = size = 0; - } - - public int Count - { -#if NET_4_6 || NET_STANDARD_2_0 - [MethodImpl(MethodImplOptions.AggressiveInlining)] -#endif - get { return size; } - } - - public T Peek() - { - if (size == 0) ThrowForEmptyQueue(); - return array[head]; - } - -#if NET_4_6 || NET_STANDARD_2_0 - [MethodImpl(MethodImplOptions.AggressiveInlining)] -#endif - public void Enqueue(T item) - { - if (size == array.Length) - { - Grow(); - } - - array[tail] = item; - MoveNext(ref tail); - size++; - } - -#if NET_4_6 || NET_STANDARD_2_0 - [MethodImpl(MethodImplOptions.AggressiveInlining)] -#endif - public T Dequeue() - { - if (size == 0) ThrowForEmptyQueue(); - - int head = this.head; - T[] array = this.array; - T removed = array[head]; - array[head] = default(T); - MoveNext(ref this.head); - size--; - return removed; - } - - void Grow() - { - int newcapacity = (int)((long)array.Length * (long)GrowFactor / 100); - if (newcapacity < array.Length + MinimumGrow) - { - newcapacity = array.Length + MinimumGrow; - } - SetCapacity(newcapacity); - } - - void SetCapacity(int capacity) - { - T[] newarray = new T[capacity]; - if (size > 0) - { - if (head < tail) - { - Array.Copy(array, head, newarray, 0, size); - } - else - { - Array.Copy(array, head, newarray, 0, array.Length - head); - Array.Copy(array, 0, newarray, array.Length - head, tail); - } - } - - array = newarray; - head = 0; - tail = (size == capacity) ? 0 : size; - } - -#if NET_4_6 || NET_STANDARD_2_0 - [MethodImpl(MethodImplOptions.AggressiveInlining)] -#endif - void MoveNext(ref int index) - { - int tmp = index + 1; - if (tmp == array.Length) - { - tmp = 0; - } - index = tmp; - } - - void ThrowForEmptyQueue() - { - throw new InvalidOperationException("EmptyQueue"); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/MinimumQueue.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/MinimumQueue.cs.meta deleted file mode 100644 index dc06736..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/MinimumQueue.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7d63add489ccc99498114d79702b904d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/PlayerLoopRunner.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/PlayerLoopRunner.cs deleted file mode 100644 index 86da337..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/PlayerLoopRunner.cs +++ /dev/null @@ -1,153 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - -using System; -using UnityEngine; - -namespace UniRx.Async.Internal -{ - internal sealed class PlayerLoopRunner - { - const int InitialSize = 16; - - readonly object runningAndQueueLock = new object(); - readonly object arrayLock = new object(); - readonly Action unhandledExceptionCallback; - - int tail = 0; - bool running = false; - IPlayerLoopItem[] loopItems = new IPlayerLoopItem[InitialSize]; - MinimumQueue waitQueue = new MinimumQueue(InitialSize); - - public PlayerLoopRunner() - { - this.unhandledExceptionCallback = ex => Debug.LogException(ex); - } - - public void AddAction(IPlayerLoopItem item) - { - lock (runningAndQueueLock) - { - if (running) - { - waitQueue.Enqueue(item); - return; - } - } - - lock (arrayLock) - { - // Ensure Capacity - if (loopItems.Length == tail) - { - Array.Resize(ref loopItems, checked(tail * 2)); - } - loopItems[tail++] = item; - } - } - - public void Run() - { - lock (runningAndQueueLock) - { - running = true; - } - - lock (arrayLock) - { - var j = tail - 1; - - // eliminate array-bound check for i - for (int i = 0; i < loopItems.Length; i++) - { - var action = loopItems[i]; - if (action != null) - { - try - { - if (!action.MoveNext()) - { - loopItems[i] = null; - } - else - { - continue; // next i - } - } - catch (Exception ex) - { - loopItems[i] = null; - try - { - unhandledExceptionCallback(ex); - } - catch { } - } - } - - // find null, loop from tail - while (i < j) - { - var fromTail = loopItems[j]; - if (fromTail != null) - { - try - { - if (!fromTail.MoveNext()) - { - loopItems[j] = null; - j--; - continue; // next j - } - else - { - // swap - loopItems[i] = fromTail; - loopItems[j] = null; - j--; - goto NEXT_LOOP; // next i - } - } - catch (Exception ex) - { - loopItems[j] = null; - j--; - try - { - unhandledExceptionCallback(ex); - } - catch { } - continue; // next j - } - } - else - { - j--; - } - } - - tail = i; // loop end - break; // LOOP END - - NEXT_LOOP: - continue; - } - - - lock (runningAndQueueLock) - { - running = false; - while (waitQueue.Count != 0) - { - if (loopItems.Length == tail) - { - Array.Resize(ref loopItems, checked(tail * 2)); - } - loopItems[tail++] = waitQueue.Dequeue(); - } - } - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/PlayerLoopRunner.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/PlayerLoopRunner.cs.meta deleted file mode 100644 index 603dbc9..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/PlayerLoopRunner.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 340c6d420bb4f484aa8683415ea92571 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/PromiseHelper.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/PromiseHelper.cs deleted file mode 100644 index 33b3a54..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/PromiseHelper.cs +++ /dev/null @@ -1,34 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; - -namespace UniRx.Async.Internal -{ - public static class PromiseHelper - { - public static void TrySetResultAll(IEnumerable source, T value) - where TPromise : class, IResolvePromise - { - var rentArray = ArrayPoolUtil.Materialize(source); - var clearArray = true; - try - { - var array = rentArray.Array; - var len = rentArray.Length; - for (int i = 0; i < len; i++) - { - array[i].TrySetResult(value); - array[i] = null; - } - clearArray = false; - } - finally - { - rentArray.DisposeManually(clearArray); - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ReusablePromise.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/ReusablePromise.cs deleted file mode 100644 index f8fd318..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ReusablePromise.cs +++ /dev/null @@ -1,399 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Diagnostics; -using System.Runtime.ExceptionServices; -using System.Threading; - -namespace UniRx.Async.Internal -{ - // 'public', user can use this(but be careful). - - public abstract class ReusablePromise : IAwaiter - { - ExceptionDispatchInfo exception; - object continuation; // Action or Queue - AwaiterStatus status; - - public UniTask Task => new UniTask(this); - - // can override for control 'start/reset' timing. - public virtual bool IsCompleted => status.IsCompleted(); - - public virtual void GetResult() - { - switch (status) - { - case AwaiterStatus.Succeeded: - return; - case AwaiterStatus.Faulted: - exception.Throw(); - break; - case AwaiterStatus.Canceled: - throw new OperationCanceledException(); - default: - break; - } - - throw new InvalidOperationException("Invalid Status:" + status); - } - - public AwaiterStatus Status => status; - - void IAwaiter.GetResult() - { - GetResult(); - } - - public void ResetStatus(bool forceReset) - { - if (forceReset) - { - status = AwaiterStatus.Pending; - } - else if (status == AwaiterStatus.Succeeded) - { - status = AwaiterStatus.Pending; - } - } - - public virtual bool TrySetCanceled() - { - if (status == AwaiterStatus.Pending) - { - status = AwaiterStatus.Canceled; - TryInvokeContinuation(); - return true; - } - return false; - } - - public virtual bool TrySetException(Exception ex) - { - if (status == AwaiterStatus.Pending) - { - status = AwaiterStatus.Faulted; - exception = ExceptionDispatchInfo.Capture(ex); - TryInvokeContinuation(); - return true; - } - return false; - } - - public virtual bool TrySetResult() - { - if (status == AwaiterStatus.Pending) - { - status = AwaiterStatus.Succeeded; - TryInvokeContinuation(); - return true; - } - return false; - } - - void TryInvokeContinuation() - { - if (continuation == null) return; - - if (continuation is Action act) - { - continuation = null; - act(); - } - else - { - // reuse Queue(don't null clear) - var q = (MinimumQueue)continuation; - var size = q.Count; - for (int i = 0; i < size; i++) - { - q.Dequeue().Invoke(); - } - } - } - - public void OnCompleted(Action action) - { - UnsafeOnCompleted(action); - } - - public void UnsafeOnCompleted(Action action) - { - if (continuation == null) - { - continuation = action; - return; - } - else - { - if (continuation is Action act) - { - var q = new MinimumQueue(4); - q.Enqueue(act); - q.Enqueue(action); - continuation = q; - return; - } - else - { - ((MinimumQueue)continuation).Enqueue(action); - } - } - } - } - - public abstract class ReusablePromise : IAwaiter - { - T result; - ExceptionDispatchInfo exception; - object continuation; // Action or Queue - AwaiterStatus status; - - public UniTask Task => new UniTask(this); - - // can override for control 'start/reset' timing. - public virtual bool IsCompleted => status.IsCompleted(); - - protected T RawResult => result; - - protected void ForceSetResult(T result) - { - this.result = result; - } - - public virtual T GetResult() - { - switch (status) - { - case AwaiterStatus.Succeeded: - return result; - case AwaiterStatus.Faulted: - exception.Throw(); - break; - case AwaiterStatus.Canceled: - throw new OperationCanceledException(); - default: - break; - } - - throw new InvalidOperationException("Invalid Status:" + status); - } - - public AwaiterStatus Status => status; - - void IAwaiter.GetResult() - { - GetResult(); - } - - public void ResetStatus(bool forceReset) - { - if (forceReset) - { - status = AwaiterStatus.Pending; - } - else if (status == AwaiterStatus.Succeeded) - { - status = AwaiterStatus.Pending; - } - } - - public virtual bool TrySetCanceled() - { - if (status == AwaiterStatus.Pending) - { - status = AwaiterStatus.Canceled; - TryInvokeContinuation(); - return true; - } - return false; - } - - public virtual bool TrySetException(Exception ex) - { - if (status == AwaiterStatus.Pending) - { - status = AwaiterStatus.Faulted; - exception = ExceptionDispatchInfo.Capture(ex); - TryInvokeContinuation(); - return true; - } - return false; - } - - public virtual bool TrySetResult(T result) - { - if (status == AwaiterStatus.Pending) - { - status = AwaiterStatus.Succeeded; - this.result = result; - TryInvokeContinuation(); - return true; - } - return false; - } - - protected void TryInvokeContinuation() - { - if (continuation == null) return; - - if (continuation is Action act) - { - continuation = null; - act(); - } - else - { - // reuse Queue(don't null clear) - var q = (MinimumQueue)continuation; - var size = q.Count; - for (int i = 0; i < size; i++) - { - q.Dequeue().Invoke(); - } - } - } - - public void OnCompleted(Action action) - { - UnsafeOnCompleted(action); - } - - public void UnsafeOnCompleted(Action action) - { - if (continuation == null) - { - continuation = action; - return; - } - else - { - if (continuation is Action act) - { - var q = new MinimumQueue(4); - q.Enqueue(act); - q.Enqueue(action); - continuation = q; - return; - } - else - { - ((MinimumQueue)continuation).Enqueue(action); - } - } - } - } - -#if !UniRxLibrary - - public abstract class PlayerLoopReusablePromiseBase : ReusablePromise, IPlayerLoopItem - { - readonly PlayerLoopTiming timing; - protected readonly CancellationToken cancellationToken; - bool isRunning = false; - -#if UNITY_EDITOR - string capturedStackTraceForDebugging; -#endif - - public PlayerLoopReusablePromiseBase(PlayerLoopTiming timing, CancellationToken cancellationToken, int skipTrackFrameCountAdditive) - { - this.timing = timing; - this.cancellationToken = cancellationToken; - -#if UNITY_EDITOR - this.capturedStackTraceForDebugging = TaskTracker.CaptureStackTrace(skipTrackFrameCountAdditive + 1); // 1 is self, -#endif - } - - public override bool IsCompleted - { - get - { - if (Status == AwaiterStatus.Canceled || Status == AwaiterStatus.Faulted) return true; - - if (!isRunning) - { - isRunning = true; - ResetStatus(false); - OnRunningStart(); -#if UNITY_EDITOR - TaskTracker.TrackActiveTask(this, capturedStackTraceForDebugging); -#endif - PlayerLoopHelper.AddAction(timing, this); - } - return false; - } - } - - protected abstract void OnRunningStart(); - - protected void Complete() - { - isRunning = false; -#if UNITY_EDITOR - TaskTracker.RemoveTracking(this); -#endif - } - - public abstract bool MoveNext(); - } - - public abstract class PlayerLoopReusablePromiseBase : ReusablePromise, IPlayerLoopItem - { - readonly PlayerLoopTiming timing; - protected readonly CancellationToken cancellationToken; - bool isRunning = false; - -#if UNITY_EDITOR - string capturedStackTraceForDebugging; -#endif - - public PlayerLoopReusablePromiseBase(PlayerLoopTiming timing, CancellationToken cancellationToken, int skipTrackFrameCountAdditive) - { - this.timing = timing; - this.cancellationToken = cancellationToken; - -#if UNITY_EDITOR - this.capturedStackTraceForDebugging = TaskTracker.CaptureStackTrace(skipTrackFrameCountAdditive + 1); // 1 is self, -#endif - } - - public override bool IsCompleted - { - get - { - if (Status == AwaiterStatus.Canceled || Status == AwaiterStatus.Faulted) return true; - - if (!isRunning) - { - isRunning = true; - ResetStatus(false); - OnRunningStart(); -#if UNITY_EDITOR - TaskTracker.TrackActiveTask(this, capturedStackTraceForDebugging); -#endif - PlayerLoopHelper.AddAction(timing, this); - } - return false; - } - } - - protected abstract void OnRunningStart(); - - protected void Complete() - { - isRunning = false; -#if UNITY_EDITOR - TaskTracker.RemoveTracking(this); -#endif - } - - public abstract bool MoveNext(); - } - -#endif -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/ReusablePromise.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/ReusablePromise.cs.meta deleted file mode 100644 index d86918f..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/ReusablePromise.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a8cfc99b5928c0242919aac2121b02bb -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs deleted file mode 100644 index 2bf4ceb..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs +++ /dev/null @@ -1,62 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -#if !UniRxLibrary -using UnityEngine; -#endif - -namespace UniRx.Async.Internal -{ - public static class RuntimeHelpersAbstraction - { - // If we can use RuntimeHelpers.IsReferenceOrContainsReferences(.NET Core 2.0), use it. - public static bool IsWellKnownNoReferenceContainsType() - { - return WellKnownNoReferenceContainsType.IsWellKnownType; - } - - static bool WellKnownNoReferenceContainsTypeInitialize(Type t) - { - // The primitive types are Boolean, Byte, SByte, Int16, UInt16, Int32, UInt32, Int64, UInt64, IntPtr, UIntPtr, Char, Double, and Single. - if (t.IsPrimitive) return true; - - if (t.IsEnum) return true; - if (t == typeof(DateTime)) return true; - if (t == typeof(DateTimeOffset)) return true; - if (t == typeof(Guid)) return true; - if (t == typeof(decimal)) return true; - - // unwrap nullable - if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>)) - { - return WellKnownNoReferenceContainsTypeInitialize(t.GetGenericArguments()[0]); - } - -#if !UniRxLibrary - // or add other wellknown types(Vector, etc...) here - if (t == typeof(Vector2)) return true; - if (t == typeof(Vector3)) return true; - if (t == typeof(Vector4)) return true; - if (t == typeof(Color)) return true; - if (t == typeof(Rect)) return true; - if (t == typeof(Bounds)) return true; - if (t == typeof(Quaternion)) return true; -#endif - - return false; - } - - static class WellKnownNoReferenceContainsType - { - public static readonly bool IsWellKnownType; - - static WellKnownNoReferenceContainsType() - { - IsWellKnownType = WellKnownNoReferenceContainsTypeInitialize(typeof(T)); - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs.meta deleted file mode 100644 index 4254391..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/RuntimeHelpersAbstraction.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 94975e4d4e0c0ea4ba787d3872ce9bb4 -timeCreated: 1532361007 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/TaskTracker.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/TaskTracker.cs deleted file mode 100644 index 4585c27..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/TaskTracker.cs +++ /dev/null @@ -1,150 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Threading; - -namespace UniRx.Async.Internal -{ - public static class TaskTracker - { -#if UNITY_EDITOR - - static int trackingId = 0; - - public const string EnableAutoReloadKey = "UniTaskTrackerWindow_EnableAutoReloadKey"; - public const string EnableTrackingKey = "UniTaskTrackerWindow_EnableTrackingKey"; - public const string EnableStackTraceKey = "UniTaskTrackerWindow_EnableStackTraceKey"; - - public static class EditorEnableState - { - static bool enableAutoReload; - public static bool EnableAutoReload - { - get { return enableAutoReload; } - set - { - enableAutoReload = value; - UnityEditor.EditorPrefs.SetBool(EnableAutoReloadKey, value); - } - } - - static bool enableTracking; - public static bool EnableTracking - { - get { return enableTracking; } - set - { - enableTracking = value; - UnityEditor.EditorPrefs.SetBool(EnableTrackingKey, value); - } - } - - static bool enableStackTrace; - public static bool EnableStackTrace - { - get { return enableStackTrace; } - set - { - enableStackTrace = value; - UnityEditor.EditorPrefs.SetBool(EnableStackTraceKey, value); - } - } - } - -#endif - - - static List> listPool = new List>(); - - static readonly WeakDictionary tracking = new WeakDictionary(); - - [Conditional("UNITY_EDITOR")] - public static void TrackActiveTask(IAwaiter task, int skipFrame = 1) - { -#if UNITY_EDITOR - dirty = true; - if (!EditorEnableState.EnableTracking) return; - var stackTrace = EditorEnableState.EnableStackTrace ? new StackTrace(skipFrame, true).CleanupAsyncStackTrace() : ""; - tracking.TryAdd(task, (Interlocked.Increment(ref trackingId), DateTime.UtcNow, stackTrace)); -#endif - } - - [Conditional("UNITY_EDITOR")] - public static void TrackActiveTask(IAwaiter task, string stackTrace) - { -#if UNITY_EDITOR - dirty = true; - if (!EditorEnableState.EnableTracking) return; - var success = tracking.TryAdd(task, (Interlocked.Increment(ref trackingId), DateTime.UtcNow, stackTrace)); -#endif - } - - public static string CaptureStackTrace(int skipFrame) - { -#if UNITY_EDITOR - if (!EditorEnableState.EnableTracking) return ""; - var stackTrace = EditorEnableState.EnableStackTrace ? new StackTrace(skipFrame + 1, true).CleanupAsyncStackTrace() : ""; - return stackTrace; -#else - return null; -#endif - } - - [Conditional("UNITY_EDITOR")] - public static void RemoveTracking(IAwaiter task) - { -#if UNITY_EDITOR - dirty = true; - if (!EditorEnableState.EnableTracking) return; - var success = tracking.TryRemove(task); -#endif - } - - static bool dirty; - - public static bool CheckAndResetDirty() - { - var current = dirty; - dirty = false; - return current; - } - - /// (trackingId, awaiterType, awaiterStatus, createdTime, stackTrace) - public static void ForEachActiveTask(Action action) - { - lock (listPool) - { - var count = tracking.ToList(ref listPool, clear: false); - try - { - for (int i = 0; i < count; i++) - { - string typeName = null; - var keyType = listPool[i].Key.GetType(); - if (keyType.IsNested) - { - typeName = keyType.DeclaringType.Name + "." + keyType.Name; - } - else - { - typeName = keyType.Name; - } - - action(listPool[i].Value.trackingId, typeName, listPool[i].Key.Status, listPool[i].Value.addTime, listPool[i].Value.stackTrace); - listPool[i] = new KeyValuePair(null, (0, default(DateTime), null)); // clear - } - } - catch - { - listPool.Clear(); - throw; - } - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/TaskTracker.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/TaskTracker.cs.meta deleted file mode 100644 index 5563bf7..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/TaskTracker.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a203c73eb4ccdbb44bddfd82d38fdda9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/WeakDictionary.cs b/Assets/Plugins/UniRx/Scripts/Async/Internal/WeakDictionary.cs deleted file mode 100644 index e4b395e..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/WeakDictionary.cs +++ /dev/null @@ -1,334 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections.Generic; -using System.Threading; - -namespace UniRx.Async.Internal -{ - // Add, Remove, Enumerate with sweep. All operations are thread safe(in spinlock). - public class WeakDictionary - where TKey : class - { - Entry[] buckets; - int size; - SpinLock gate; // mutable struct(not readonly) - - readonly float loadFactor; - readonly IEqualityComparer keyEqualityComparer; - - public WeakDictionary(int capacity = 4, float loadFactor = 0.75f, IEqualityComparer keyComparer = null) - { - var tableSize = CalculateCapacity(capacity, loadFactor); - this.buckets = new Entry[tableSize]; - this.loadFactor = loadFactor; - this.gate = new SpinLock(false); - this.keyEqualityComparer = keyComparer ?? EqualityComparer.Default; - } - - public bool TryAdd(TKey key, TValue value) - { - bool lockTaken = false; - try - { - gate.Enter(ref lockTaken); - return TryAddInternal(key, value); - } - finally - { - if (lockTaken) gate.Exit(false); - } - } - - public bool TryGetValue(TKey key, out TValue value) - { - bool lockTaken = false; - try - { - if (TryGetEntry(key, out _, out var entry)) - { - value = entry.Value; - return true; - } - - value = default(TValue); - return false; - } - finally - { - if (lockTaken) gate.Exit(false); - } - } - - public bool TryRemove(TKey key) - { - bool lockTaken = false; - try - { - if (TryGetEntry(key, out var hashIndex, out var entry)) - { - Remove(hashIndex, entry); - return true; - } - - return false; - } - finally - { - if (lockTaken) gate.Exit(false); - } - } - - bool TryAddInternal(TKey key, TValue value) - { - var nextCapacity = CalculateCapacity(size + 1, loadFactor); - - TRY_ADD_AGAIN: - if (buckets.Length < nextCapacity) - { - // rehash - var nextBucket = new Entry[nextCapacity]; - for (int i = 0; i < buckets.Length; i++) - { - var e = buckets[i]; - while (e != null) - { - AddToBuckets(nextBucket, key, e.Value, e.Hash); - e = e.Next; - } - } - - buckets = nextBucket; - goto TRY_ADD_AGAIN; - } - else - { - // add entry - var successAdd = AddToBuckets(buckets, key, value, keyEqualityComparer.GetHashCode(key)); - if (successAdd) size++; - return successAdd; - } - } - - bool AddToBuckets(Entry[] targetBuckets, TKey newKey, TValue value, int keyHash) - { - var h = keyHash; - var hashIndex = h & (targetBuckets.Length - 1); - - TRY_ADD_AGAIN: - if (targetBuckets[hashIndex] == null) - { - targetBuckets[hashIndex] = new Entry - { - Key = new WeakReference(newKey, false), - Value = value, - Hash = h - }; - - return true; - } - else - { - // add to last. - var entry = targetBuckets[hashIndex]; - while (entry != null) - { - if (entry.Key.TryGetTarget(out var target)) - { - if (keyEqualityComparer.Equals(newKey, target)) - { - return false; // duplicate - } - } - else - { - Remove(hashIndex, entry); - if (targetBuckets[hashIndex] == null) goto TRY_ADD_AGAIN; // add new entry - } - - if (entry.Next != null) - { - entry = entry.Next; - } - else - { - // found last - entry.Next = new Entry - { - Key = new WeakReference(newKey, false), - Value = value, - Hash = h - }; - entry.Next.Prev = entry; - } - } - - return false; - } - } - - bool TryGetEntry(TKey key, out int hashIndex, out Entry entry) - { - var table = buckets; - var hash = keyEqualityComparer.GetHashCode(key); - hashIndex = hash & table.Length - 1; - entry = table[hashIndex]; - - while (entry != null) - { - if (entry.Key.TryGetTarget(out var target)) - { - if (keyEqualityComparer.Equals(key, target)) - { - return true; - } - } - else - { - // sweap - Remove(hashIndex, entry); - } - - entry = entry.Next; - } - - return false; - } - - void Remove(int hashIndex, Entry entry) - { - if (entry.Prev == null && entry.Next == null) - { - buckets[hashIndex] = null; - } - else - { - if (entry.Prev == null) - { - buckets[hashIndex] = entry.Next; - } - if (entry.Prev != null) - { - entry.Prev.Next = entry.Next; - } - if (entry.Next != null) - { - entry.Next.Prev = entry.Prev; - } - } - size--; - } - - public List> ToList() - { - var list = new List>(size); - ToList(ref list, false); - return list; - } - - // avoid allocate everytime. - public int ToList(ref List> list, bool clear = true) - { - if (clear) - { - list.Clear(); - } - - var listIndex = 0; - - bool lockTaken = false; - try - { - for (int i = 0; i < buckets.Length; i++) - { - var entry = buckets[i]; - while (entry != null) - { - if (entry.Key.TryGetTarget(out var target)) - { - var item = new KeyValuePair(target, entry.Value); - if (listIndex < list.Count) - { - list[listIndex++] = item; - } - else - { - list.Add(item); - listIndex++; - } - } - else - { - // sweap - Remove(i, entry); - } - - entry = entry.Next; - } - } - } - finally - { - if (lockTaken) gate.Exit(false); - } - - return listIndex; - } - - static int CalculateCapacity(int collectionSize, float loadFactor) - { - var size = (int)(((float)collectionSize) / loadFactor); - - size--; - size |= size >> 1; - size |= size >> 2; - size |= size >> 4; - size |= size >> 8; - size |= size >> 16; - size += 1; - - if (size < 8) - { - size = 8; - } - return size; - } - - class Entry - { - public WeakReference Key; - public TValue Value; - public int Hash; - public Entry Prev; - public Entry Next; - - // debug only - public override string ToString() - { - if (Key.TryGetTarget(out var target)) - { - return target + "(" + Count() + ")"; - } - else - { - return "(Dead)"; - } - } - - int Count() - { - var count = 1; - var n = this; - while (n.Next != null) - { - count++; - n = n.Next; - } - return count; - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/WeakDictionary.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Internal/WeakDictionary.cs.meta deleted file mode 100644 index 9dc1672..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/WeakDictionary.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6c78563864409714593226af59bcb6f3 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/PlayerLoopHelper.cs b/Assets/Plugins/UniRx/Scripts/Async/PlayerLoopHelper.cs deleted file mode 100644 index c7ab469..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/PlayerLoopHelper.cs +++ /dev/null @@ -1,125 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Linq; -using UnityEngine; -using UnityEngine.Experimental.LowLevel; -using UniRx.Async.Internal; -using System.Threading; - -namespace UniRx.Async -{ - public static class UniTaskLoopRunners - { - public struct UniTaskLoopRunnerInitialization { }; - public struct UniTaskLoopRunnerEarlyUpdate { }; - public struct UniTaskLoopRunnerFixedUpdate { }; - public struct UniTaskLoopRunnerPreUpdate { }; - public struct UniTaskLoopRunnerUpdate { }; - public struct UniTaskLoopRunnerPreLateUpdate { }; - public struct UniTaskLoopRunnerPostLateUpdate { }; - - // Yield - - public struct UniTaskLoopRunnerYieldInitialization { }; - public struct UniTaskLoopRunnerYieldEarlyUpdate { }; - public struct UniTaskLoopRunnerYieldFixedUpdate { }; - public struct UniTaskLoopRunnerYieldPreUpdate { }; - public struct UniTaskLoopRunnerYieldUpdate { }; - public struct UniTaskLoopRunnerYieldPreLateUpdate { }; - public struct UniTaskLoopRunnerYieldPostLateUpdate { }; - } - - public enum PlayerLoopTiming - { - Initialization = 0, - EarlyUpdate = 1, - FixedUpdate = 2, - PreUpdate = 3, - Update = 4, - PreLateUpdate = 5, - PostLateUpdate = 6 - } - - public interface IPlayerLoopItem - { - bool MoveNext(); - } - - public static class PlayerLoopHelper - { - public static SynchronizationContext UnitySynchronizationContext => unitySynchronizationContetext; - public static int MainThreadId => mainThreadId; - - static int mainThreadId; - static SynchronizationContext unitySynchronizationContetext; - static ContinuationQueue[] yielders; - static PlayerLoopRunner[] runners; - - static PlayerLoopSystem[] InsertRunner(PlayerLoopSystem loopSystem, Type loopRunnerYieldType, ContinuationQueue cq, Type loopRunnerType, PlayerLoopRunner runner) - { - var yieldLoop = new PlayerLoopSystem - { - type = loopRunnerYieldType, - updateDelegate = cq.Run - }; - - var runnerLoop = new PlayerLoopSystem - { - type = loopRunnerType, - updateDelegate = runner.Run - }; - - var dest = new PlayerLoopSystem[loopSystem.subSystemList.Length + 2]; - Array.Copy(loopSystem.subSystemList, 0, dest, 2, loopSystem.subSystemList.Length); - dest[0] = yieldLoop; - dest[1] = runnerLoop; - return dest; - } - - [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] - static void Init() - { - // capture default(unity) sync-context. - unitySynchronizationContetext = SynchronizationContext.Current; - mainThreadId = Thread.CurrentThread.ManagedThreadId; - - if (runners != null) return; // already initialized - - var playerLoop = PlayerLoop.GetDefaultPlayerLoop(); - Initialize(ref playerLoop); - } - - public static void Initialize(ref PlayerLoopSystem playerLoop) - { - yielders = new ContinuationQueue[7]; - runners = new PlayerLoopRunner[7]; - - var copyList = playerLoop.subSystemList.ToArray(); - - copyList[0].subSystemList = InsertRunner(copyList[0], typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldInitialization), yielders[0] = new ContinuationQueue(), typeof(UniTaskLoopRunners.UniTaskLoopRunnerInitialization), runners[0] = new PlayerLoopRunner()); - copyList[1].subSystemList = InsertRunner(copyList[1], typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldEarlyUpdate), yielders[1] = new ContinuationQueue(), typeof(UniTaskLoopRunners.UniTaskLoopRunnerEarlyUpdate), runners[1] = new PlayerLoopRunner()); - copyList[2].subSystemList = InsertRunner(copyList[2], typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldFixedUpdate), yielders[2] = new ContinuationQueue(), typeof(UniTaskLoopRunners.UniTaskLoopRunnerFixedUpdate), runners[2] = new PlayerLoopRunner()); - copyList[3].subSystemList = InsertRunner(copyList[3], typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldPreUpdate), yielders[3] = new ContinuationQueue(), typeof(UniTaskLoopRunners.UniTaskLoopRunnerPreUpdate), runners[3] = new PlayerLoopRunner()); - copyList[4].subSystemList = InsertRunner(copyList[4], typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldUpdate), yielders[4] = new ContinuationQueue(), typeof(UniTaskLoopRunners.UniTaskLoopRunnerUpdate), runners[4] = new PlayerLoopRunner()); - copyList[5].subSystemList = InsertRunner(copyList[5], typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldPreLateUpdate), yielders[5] = new ContinuationQueue(), typeof(UniTaskLoopRunners.UniTaskLoopRunnerPreLateUpdate), runners[5] = new PlayerLoopRunner()); - copyList[6].subSystemList = InsertRunner(copyList[6], typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldPostLateUpdate), yielders[6] = new ContinuationQueue(), typeof(UniTaskLoopRunners.UniTaskLoopRunnerPostLateUpdate), runners[6] = new PlayerLoopRunner()); - - playerLoop.subSystemList = copyList; - PlayerLoop.SetPlayerLoop(playerLoop); - } - - public static void AddAction(PlayerLoopTiming timing, IPlayerLoopItem action) - { - runners[(int)timing].AddAction(action); - } - - public static void AddContinuation(PlayerLoopTiming timing, Action continuation) - { - yielders[(int)timing].Enqueue(continuation); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/PlayerLoopHelper.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/PlayerLoopHelper.cs.meta deleted file mode 100644 index 2487ef7..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/PlayerLoopHelper.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 15fb5b85042f19640b973ce651795aca -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Progress.cs b/Assets/Plugins/UniRx/Scripts/Async/Progress.cs deleted file mode 100644 index a9e76b7..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Progress.cs +++ /dev/null @@ -1,87 +0,0 @@ -#if NET_4_6 || NET_STANDARD_2_0 || CSHARP_7_OR_LATER -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections.Generic; - -namespace UniRx.Async -{ - /// - /// Lightweight IProgress[T] factory. - /// - public static class Progress - { - public static IProgress Create(Action handler) - { - if (handler == null) return NullProgress.Instance; - return new AnonymousProgress(handler); - } - - public static IProgress CreateOnlyValueChanged(Action handler, IEqualityComparer comparer = null) - { - if (handler == null) return NullProgress.Instance; - return new OnlyValueChangedProgress(handler, comparer ?? UnityEqualityComparer.GetDefault()); - } - - sealed class NullProgress : IProgress - { - public static readonly IProgress Instance = new NullProgress(); - - NullProgress() - { - - } - - public void Report(T value) - { - } - } - - sealed class AnonymousProgress : IProgress - { - readonly Action action; - - public AnonymousProgress(Action action) - { - this.action = action; - } - - public void Report(T value) - { - action(value); - } - } - - sealed class OnlyValueChangedProgress : IProgress - { - readonly Action action; - readonly IEqualityComparer comparer; - bool isFirstCall; - T latestValue; - - public OnlyValueChangedProgress(Action action, IEqualityComparer comparer) - { - this.action = action; - this.comparer = comparer; - this.isFirstCall = true; - } - - public void Report(T value) - { - if (isFirstCall) - { - isFirstCall = false; - } - else if (comparer.Equals(value, latestValue)) - { - return; - } - - latestValue = value; - action(value); - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Progress.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Progress.cs.meta deleted file mode 100644 index f0e1f19..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Progress.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e3377e2ae934ed54fb8fd5388e2d9eb9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers.meta deleted file mode 100644 index 5745b55..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e58eeef192ba04048b140d02356c2225 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAnimatorTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAnimatorTrigger.cs deleted file mode 100644 index 00b66cb..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAnimatorTrigger.cs +++ /dev/null @@ -1,54 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncAnimatorTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onAnimatorIK; - AsyncTriggerPromiseDictionary onAnimatorIKs; - AsyncTriggerPromise onAnimatorMove; - AsyncTriggerPromiseDictionary onAnimatorMoves; - - - protected override IEnumerable GetPromises() - { - return Concat(onAnimatorIK, onAnimatorIKs, onAnimatorMove, onAnimatorMoves); - } - - - void OnAnimatorIK(int layerIndex) - { - TrySetResult(onAnimatorIK, onAnimatorIKs, layerIndex); - } - - - public UniTask OnAnimatorIKAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onAnimatorIK, ref onAnimatorIKs, cancellationToken); - } - - - void OnAnimatorMove() - { - TrySetResult(onAnimatorMove, onAnimatorMoves, AsyncUnit.Default); - } - - - public UniTask OnAnimatorMoveAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onAnimatorMove, ref onAnimatorMoves, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAnimatorTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAnimatorTrigger.cs.meta deleted file mode 100644 index 29b2826..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAnimatorTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ae912c37ac7f4cd42b25f22452435103 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAwakeTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAwakeTrigger.cs deleted file mode 100644 index 0710dcb..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAwakeTrigger.cs +++ /dev/null @@ -1,55 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using UnityEngine; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncAwakeTrigger : MonoBehaviour - { - bool called = false; - UniTaskCompletionSource promise; - - void Awake() - { - called = true; - promise?.TrySetResult(); - } - - public UniTask AwakeAsync() - { - if (called) return UniTask.CompletedTask; - PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, new AwakeMonitor(this)); - return new UniTask(promise ?? (promise = new UniTaskCompletionSource())); - } - - private void OnDestroy() - { - promise?.TrySetCanceled(); - } - - class AwakeMonitor : IPlayerLoopItem - { - readonly AsyncAwakeTrigger trigger; - - public AwakeMonitor(AsyncAwakeTrigger trigger) - { - this.trigger = trigger; - } - - public bool MoveNext() - { - if (trigger.called) return false; - if (trigger == null) - { - trigger.OnDestroy(); - return false; - } - return true; - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAwakeTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAwakeTrigger.cs.meta deleted file mode 100644 index 097fdb6..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncAwakeTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ef2840a2586894741a0ae211b8fd669b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncBeginDragTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncBeginDragTrigger.cs deleted file mode 100644 index bef1037..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncBeginDragTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncBeginDragTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onBeginDrag; - AsyncTriggerPromiseDictionary onBeginDrags; - - - protected override IEnumerable GetPromises() - { - return Concat(onBeginDrag, onBeginDrags); - } - - - void OnBeginDrag(PointerEventData eventData) - { - TrySetResult(onBeginDrag, onBeginDrags, eventData); - } - - - public UniTask OnBeginDragAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onBeginDrag, ref onBeginDrags, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncBeginDragTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncBeginDragTrigger.cs.meta deleted file mode 100644 index d4a44e9..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncBeginDragTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 171fd2191eb22af4fbd92b51815ca757 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCancelTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCancelTrigger.cs deleted file mode 100644 index f484e59..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCancelTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncCancelTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onCancel; - AsyncTriggerPromiseDictionary onCancels; - - - protected override IEnumerable GetPromises() - { - return Concat(onCancel, onCancels); - } - - - void OnCancel(BaseEventData eventData) - { - TrySetResult(onCancel, onCancels, eventData); - } - - - public UniTask OnCancelAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onCancel, ref onCancels, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCancelTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCancelTrigger.cs.meta deleted file mode 100644 index 285efd5..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCancelTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 291886b6e5f2d044a85b2a4dedcaca97 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCanvasGroupChangedTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCanvasGroupChangedTrigger.cs deleted file mode 100644 index 98fb776..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCanvasGroupChangedTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncCanvasGroupChangedTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onCanvasGroupChanged; - AsyncTriggerPromiseDictionary onCanvasGroupChangeds; - - - protected override IEnumerable GetPromises() - { - return Concat(onCanvasGroupChanged, onCanvasGroupChangeds); - } - - - void OnCanvasGroupChanged() - { - TrySetResult(onCanvasGroupChanged, onCanvasGroupChangeds, AsyncUnit.Default); - } - - - public UniTask OnCanvasGroupChangedAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onCanvasGroupChanged, ref onCanvasGroupChangeds, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCanvasGroupChangedTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCanvasGroupChangedTrigger.cs.meta deleted file mode 100644 index d0ebc56..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCanvasGroupChangedTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: eddba832648f83046a320ffcacfc771d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollision2DTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollision2DTrigger.cs deleted file mode 100644 index c3f0c9c..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollision2DTrigger.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncCollision2DTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onCollisionEnter2D; - AsyncTriggerPromiseDictionary onCollisionEnter2Ds; - AsyncTriggerPromise onCollisionExit2D; - AsyncTriggerPromiseDictionary onCollisionExit2Ds; - AsyncTriggerPromise onCollisionStay2D; - AsyncTriggerPromiseDictionary onCollisionStay2Ds; - - - protected override IEnumerable GetPromises() - { - return Concat(onCollisionEnter2D, onCollisionEnter2Ds, onCollisionExit2D, onCollisionExit2Ds, onCollisionStay2D, onCollisionStay2Ds); - } - - - void OnCollisionEnter2D(Collision2D coll) - { - TrySetResult(onCollisionEnter2D, onCollisionEnter2Ds, coll); - } - - - public UniTask OnCollisionEnter2DAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onCollisionEnter2D, ref onCollisionEnter2Ds, cancellationToken); - } - - - void OnCollisionExit2D(Collision2D coll) - { - TrySetResult(onCollisionExit2D, onCollisionExit2Ds, coll); - } - - - public UniTask OnCollisionExit2DAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onCollisionExit2D, ref onCollisionExit2Ds, cancellationToken); - } - - - void OnCollisionStay2D(Collision2D coll) - { - TrySetResult(onCollisionStay2D, onCollisionStay2Ds, coll); - } - - - public UniTask OnCollisionStay2DAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onCollisionStay2D, ref onCollisionStay2Ds, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollision2DTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollision2DTrigger.cs.meta deleted file mode 100644 index ad81300..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollision2DTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fbeb63f69bedec44f8003730887f914b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollisionTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollisionTrigger.cs deleted file mode 100644 index 3534c69..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollisionTrigger.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncCollisionTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onCollisionEnter; - AsyncTriggerPromiseDictionary onCollisionEnters; - AsyncTriggerPromise onCollisionExit; - AsyncTriggerPromiseDictionary onCollisionExits; - AsyncTriggerPromise onCollisionStay; - AsyncTriggerPromiseDictionary onCollisionStays; - - - protected override IEnumerable GetPromises() - { - return Concat(onCollisionEnter, onCollisionEnters, onCollisionExit, onCollisionExits, onCollisionStay, onCollisionStays); - } - - - void OnCollisionEnter(Collision collision) - { - TrySetResult(onCollisionEnter, onCollisionEnters, collision); - } - - - public UniTask OnCollisionEnterAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onCollisionEnter, ref onCollisionEnters, cancellationToken); - } - - - void OnCollisionExit(Collision collisionInfo) - { - TrySetResult(onCollisionExit, onCollisionExits, collisionInfo); - } - - - public UniTask OnCollisionExitAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onCollisionExit, ref onCollisionExits, cancellationToken); - } - - - void OnCollisionStay(Collision collisionInfo) - { - TrySetResult(onCollisionStay, onCollisionStays, collisionInfo); - } - - - public UniTask OnCollisionStayAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onCollisionStay, ref onCollisionStays, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollisionTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollisionTrigger.cs.meta deleted file mode 100644 index ebcc28e..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncCollisionTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 72db4a683be8f6a428823502599014a9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDeselectTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDeselectTrigger.cs deleted file mode 100644 index 18ac7d0..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDeselectTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncDeselectTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onDeselect; - AsyncTriggerPromiseDictionary onDeselects; - - - protected override IEnumerable GetPromises() - { - return Concat(onDeselect, onDeselects); - } - - - void OnDeselect(BaseEventData eventData) - { - TrySetResult(onDeselect, onDeselects, eventData); - } - - - public UniTask OnDeselectAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onDeselect, ref onDeselects, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDeselectTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDeselectTrigger.cs.meta deleted file mode 100644 index 9509524..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDeselectTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 30faa9be5bd883e488bdc52f4825c4da -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDestroyTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDestroyTrigger.cs deleted file mode 100644 index f5a6ed6..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDestroyTrigger.cs +++ /dev/null @@ -1,93 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Threading; -using UniRx.Async.Internal; -using UnityEngine; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncDestroyTrigger : MonoBehaviour - { - bool called = false; - UniTaskCompletionSource promise; - CancellationTokenSource cancellationTokenSource; // main cancellation - object canellationTokenSourceOrQueue; // external from AddCancellationTriggerOnDestory - - public CancellationToken CancellationToken - { - get - { - if (cancellationTokenSource == null) - { - cancellationTokenSource = new CancellationTokenSource(); - } - return cancellationTokenSource.Token; - } - } - - /// This function is called when the MonoBehaviour will be destroyed. - void OnDestroy() - { - called = true; - promise?.TrySetResult(); - cancellationTokenSource?.Cancel(); - cancellationTokenSource?.Dispose(); - if (canellationTokenSourceOrQueue != null) - { - if (canellationTokenSourceOrQueue is CancellationTokenSource cts) - { - cts.Cancel(); - cts.Dispose(); - } - else - { - var q = (MinimumQueue)canellationTokenSourceOrQueue; - while (q.Count != 0) - { - var c = q.Dequeue(); - c.Cancel(); - c.Dispose(); - } - } - canellationTokenSourceOrQueue = null; - } - } - - /// This function is called when the MonoBehaviour will be destroyed. - public UniTask OnDestroyAsync() - { - if (called) return UniTask.CompletedTask; - return new UniTask(promise ?? (promise = new UniTaskCompletionSource())); - } - - /// Add Cancellation Triggers on destroy - public void AddCancellationTriggerOnDestory(CancellationTokenSource cts) - { - if (called) - { - cts.Cancel(); - cts.Dispose(); - } - - if (canellationTokenSourceOrQueue == null) - { - canellationTokenSourceOrQueue = cts; - } - else if (canellationTokenSourceOrQueue is CancellationTokenSource c) - { - var q = new MinimumQueue(4); - q.Enqueue(c); - q.Enqueue(cts); - canellationTokenSourceOrQueue = q; - } - else - { - ((MinimumQueue)canellationTokenSourceOrQueue).Enqueue(cts); - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDestroyTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDestroyTrigger.cs.meta deleted file mode 100644 index 6450049..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDestroyTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f4afdcb1cbadf954ba8b1cf465429e17 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDragTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDragTrigger.cs deleted file mode 100644 index 46ad8d9..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDragTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncDragTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onDrag; - AsyncTriggerPromiseDictionary onDrags; - - - protected override IEnumerable GetPromises() - { - return Concat(onDrag, onDrags); - } - - - void OnDrag(PointerEventData eventData) - { - TrySetResult(onDrag, onDrags, eventData); - } - - - public UniTask OnDragAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onDrag, ref onDrags, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDragTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDragTrigger.cs.meta deleted file mode 100644 index d259f40..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDragTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 52242547ba60ea74f8a2e3bbab5fcdfa -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDropTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDropTrigger.cs deleted file mode 100644 index 8993952..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDropTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncDropTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onDrop; - AsyncTriggerPromiseDictionary onDrops; - - - protected override IEnumerable GetPromises() - { - return Concat(onDrop, onDrops); - } - - - void OnDrop(PointerEventData eventData) - { - TrySetResult(onDrop, onDrops, eventData); - } - - - public UniTask OnDropAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onDrop, ref onDrops, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDropTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDropTrigger.cs.meta deleted file mode 100644 index 2a15847..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncDropTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 42d65fd5e4be25f41a927eca25b0acf7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEnableDisableTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEnableDisableTrigger.cs deleted file mode 100644 index 092b97f..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEnableDisableTrigger.cs +++ /dev/null @@ -1,55 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncEnableDisableTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onEnable; - AsyncTriggerPromiseDictionary onEnables; - AsyncTriggerPromise onDisable; - AsyncTriggerPromiseDictionary onDisables; - - - protected override IEnumerable GetPromises() - { - return Concat(onEnable, onEnables, onDisable, onDisables); - } - - - void OnEnable() - { - TrySetResult(onEnable, onEnables, AsyncUnit.Default); - } - - - public UniTask OnEnableAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onEnable, ref onEnables, cancellationToken); - } - - - void OnDisable() - { - TrySetResult(onDisable, onDisables, AsyncUnit.Default); - } - - - public UniTask OnDisableAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onDisable, ref onDisables, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEnableDisableTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEnableDisableTrigger.cs.meta deleted file mode 100644 index 8e61a0f..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEnableDisableTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d0bf9142b63b4cb43b693f0b83b3dbe7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEndDragTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEndDragTrigger.cs deleted file mode 100644 index cbaa823..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEndDragTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncEndDragTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onEndDrag; - AsyncTriggerPromiseDictionary onEndDrags; - - - protected override IEnumerable GetPromises() - { - return Concat(onEndDrag, onEndDrags); - } - - - void OnEndDrag(PointerEventData eventData) - { - TrySetResult(onEndDrag, onEndDrags, eventData); - } - - - public UniTask OnEndDragAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onEndDrag, ref onEndDrags, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEndDragTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEndDragTrigger.cs.meta deleted file mode 100644 index 98f67b8..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEndDragTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8298d43de348acc4aa4e7dbf30472dbf -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEventTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEventTrigger.cs deleted file mode 100644 index 218fedc..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEventTrigger.cs +++ /dev/null @@ -1,264 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncEventTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onDeselect; - AsyncTriggerPromiseDictionary onDeselects; - AsyncTriggerPromise onMove; - AsyncTriggerPromiseDictionary onMoves; - AsyncTriggerPromise onPointerDown; - AsyncTriggerPromiseDictionary onPointerDowns; - AsyncTriggerPromise onPointerEnter; - AsyncTriggerPromiseDictionary onPointerEnters; - AsyncTriggerPromise onPointerExit; - AsyncTriggerPromiseDictionary onPointerExits; - AsyncTriggerPromise onPointerUp; - AsyncTriggerPromiseDictionary onPointerUps; - AsyncTriggerPromise onSelect; - AsyncTriggerPromiseDictionary onSelects; - AsyncTriggerPromise onPointerClick; - AsyncTriggerPromiseDictionary onPointerClicks; - AsyncTriggerPromise onSubmit; - AsyncTriggerPromiseDictionary onSubmits; - AsyncTriggerPromise onDrag; - AsyncTriggerPromiseDictionary onDrags; - AsyncTriggerPromise onBeginDrag; - AsyncTriggerPromiseDictionary onBeginDrags; - AsyncTriggerPromise onEndDrag; - AsyncTriggerPromiseDictionary onEndDrags; - AsyncTriggerPromise onDrop; - AsyncTriggerPromiseDictionary onDrops; - AsyncTriggerPromise onUpdateSelected; - AsyncTriggerPromiseDictionary onUpdateSelecteds; - AsyncTriggerPromise onInitializePotentialDrag; - AsyncTriggerPromiseDictionary onInitializePotentialDrags; - AsyncTriggerPromise onCancel; - AsyncTriggerPromiseDictionary onCancels; - AsyncTriggerPromise onScroll; - AsyncTriggerPromiseDictionary onScrolls; - - - protected override IEnumerable GetPromises() - { - return Concat(onDeselect, onDeselects, onMove, onMoves, onPointerDown, onPointerDowns, onPointerEnter, onPointerEnters, onPointerExit, onPointerExits, onPointerUp, onPointerUps, onSelect, onSelects, onPointerClick, onPointerClicks, onSubmit, onSubmits, onDrag, onDrags, onBeginDrag, onBeginDrags, onEndDrag, onEndDrags, onDrop, onDrops, onUpdateSelected, onUpdateSelecteds, onInitializePotentialDrag, onInitializePotentialDrags, onCancel, onCancels, onScroll, onScrolls); - } - - void OnDeselect(BaseEventData eventData) - { - TrySetResult(onDeselect, onDeselects, eventData); - } - - - public UniTask OnDeselectAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onDeselect, ref onDeselects, cancellationToken); - } - - - void OnMove(AxisEventData eventData) - { - TrySetResult(onMove, onMoves, eventData); - } - - - public UniTask OnMoveAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onMove, ref onMoves, cancellationToken); - } - - - void OnPointerDown(PointerEventData eventData) - { - TrySetResult(onPointerDown, onPointerDowns, eventData); - } - - - public UniTask OnPointerDownAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onPointerDown, ref onPointerDowns, cancellationToken); - } - - - void OnPointerEnter(PointerEventData eventData) - { - TrySetResult(onPointerEnter, onPointerEnters, eventData); - } - - - public UniTask OnPointerEnterAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onPointerEnter, ref onPointerEnters, cancellationToken); - } - - - void OnPointerExit(PointerEventData eventData) - { - TrySetResult(onPointerExit, onPointerExits, eventData); - } - - - public UniTask OnPointerExitAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onPointerExit, ref onPointerExits, cancellationToken); - } - - - void OnPointerUp(PointerEventData eventData) - { - TrySetResult(onPointerUp, onPointerUps, eventData); - } - - - public UniTask OnPointerUpAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onPointerUp, ref onPointerUps, cancellationToken); - } - - - void OnSelect(BaseEventData eventData) - { - TrySetResult(onSelect, onSelects, eventData); - } - - - public UniTask OnSelectAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onSelect, ref onSelects, cancellationToken); - } - - - void OnPointerClick(PointerEventData eventData) - { - TrySetResult(onPointerClick, onPointerClicks, eventData); - } - - - public UniTask OnPointerClickAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onPointerClick, ref onPointerClicks, cancellationToken); - } - - - void OnSubmit(BaseEventData eventData) - { - TrySetResult(onSubmit, onSubmits, eventData); - } - - - public UniTask OnSubmitAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onSubmit, ref onSubmits, cancellationToken); - } - - - void OnDrag(PointerEventData eventData) - { - TrySetResult(onDrag, onDrags, eventData); - } - - - public UniTask OnDragAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onDrag, ref onDrags, cancellationToken); - } - - - void OnBeginDrag(PointerEventData eventData) - { - TrySetResult(onBeginDrag, onBeginDrags, eventData); - } - - - public UniTask OnBeginDragAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onBeginDrag, ref onBeginDrags, cancellationToken); - } - - - void OnEndDrag(PointerEventData eventData) - { - TrySetResult(onEndDrag, onEndDrags, eventData); - } - - - public UniTask OnEndDragAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onEndDrag, ref onEndDrags, cancellationToken); - } - - - void OnDrop(PointerEventData eventData) - { - TrySetResult(onDrop, onDrops, eventData); - } - - - public UniTask OnDropAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onDrop, ref onDrops, cancellationToken); - } - - - void OnUpdateSelected(BaseEventData eventData) - { - TrySetResult(onUpdateSelected, onUpdateSelecteds, eventData); - } - - - public UniTask OnUpdateSelectedAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onUpdateSelected, ref onUpdateSelecteds, cancellationToken); - } - - - void OnInitializePotentialDrag(PointerEventData eventData) - { - TrySetResult(onInitializePotentialDrag, onInitializePotentialDrags, eventData); - } - - - public UniTask OnInitializePotentialDragAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onInitializePotentialDrag, ref onInitializePotentialDrags, cancellationToken); - } - - - void OnCancel(BaseEventData eventData) - { - TrySetResult(onCancel, onCancels, eventData); - } - - - public UniTask OnCancelAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onCancel, ref onCancels, cancellationToken); - } - - - void OnScroll(PointerEventData eventData) - { - TrySetResult(onScroll, onScrolls, eventData); - } - - - public UniTask OnScrollAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onScroll, ref onScrolls, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEventTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEventTrigger.cs.meta deleted file mode 100644 index c901478..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncEventTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 89997820797ad6d43b17971a8bd0d8fe -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncFixedUpdateTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncFixedUpdateTrigger.cs deleted file mode 100644 index 8cfc821..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncFixedUpdateTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncFixedUpdateTrigger : AsyncTriggerBase - { - AsyncTriggerPromise fixedUpdate; - AsyncTriggerPromiseDictionary fixedUpdates; - - - protected override IEnumerable GetPromises() - { - return Concat(fixedUpdate, fixedUpdates); - } - - - void FixedUpdate() - { - TrySetResult(fixedUpdate, fixedUpdates, AsyncUnit.Default); - } - - - public UniTask FixedUpdateAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref fixedUpdate, ref fixedUpdates, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncFixedUpdateTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncFixedUpdateTrigger.cs.meta deleted file mode 100644 index 7154af6..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncFixedUpdateTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c74b906c4294aaa4e900f6e7f8b36df6 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncInitializePotentialDragTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncInitializePotentialDragTrigger.cs deleted file mode 100644 index 59e04b4..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncInitializePotentialDragTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncInitializePotentialDragTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onInitializePotentialDrag; - AsyncTriggerPromiseDictionary onInitializePotentialDrags; - - - protected override IEnumerable GetPromises() - { - return Concat(onInitializePotentialDrag, onInitializePotentialDrags); - } - - - void OnInitializePotentialDrag(PointerEventData eventData) - { - TrySetResult(onInitializePotentialDrag, onInitializePotentialDrags, eventData); - } - - - public UniTask OnInitializePotentialDragAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onInitializePotentialDrag, ref onInitializePotentialDrags, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncInitializePotentialDragTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncInitializePotentialDragTrigger.cs.meta deleted file mode 100644 index 0df8a5b..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncInitializePotentialDragTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ae0733adc239a324f8b934ffb119abd8 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncJointTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncJointTrigger.cs deleted file mode 100644 index 9321182..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncJointTrigger.cs +++ /dev/null @@ -1,55 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncJointTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onJointBreak; - AsyncTriggerPromiseDictionary onJointBreaks; - AsyncTriggerPromise onJointBreak2D; - AsyncTriggerPromiseDictionary onJointBreak2Ds; - - - protected override IEnumerable GetPromises() - { - return Concat(onJointBreak, onJointBreaks, onJointBreak2D, onJointBreak2Ds); - } - - - void OnJointBreak(float breakForce) - { - TrySetResult(onJointBreak, onJointBreaks, breakForce); - } - - - public UniTask OnJointBreakAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onJointBreak, ref onJointBreaks, cancellationToken); - } - - - void OnJointBreak2D(Joint2D brokenJoint) - { - TrySetResult(onJointBreak2D, onJointBreak2Ds, brokenJoint); - } - - - public UniTask OnJointBreak2DAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onJointBreak2D, ref onJointBreak2Ds, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncJointTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncJointTrigger.cs.meta deleted file mode 100644 index 8220736..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncJointTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 04dc74e7b2368094f9153921804a1fb7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncLateUpdateTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncLateUpdateTrigger.cs deleted file mode 100644 index e88dfd8..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncLateUpdateTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncLateUpdateTrigger : AsyncTriggerBase - { - AsyncTriggerPromise lateUpdate; - AsyncTriggerPromiseDictionary lateUpdates; - - - protected override IEnumerable GetPromises() - { - return Concat(lateUpdate, lateUpdates); - } - - - void LateUpdate() - { - TrySetResult(lateUpdate, lateUpdates, AsyncUnit.Default); - } - - - public UniTask LateUpdateAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref lateUpdate, ref lateUpdates, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncLateUpdateTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncLateUpdateTrigger.cs.meta deleted file mode 100644 index 391059d..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncLateUpdateTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a4fb2b4c09cb4ec4a82b934f2038eb36 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMouseTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMouseTrigger.cs deleted file mode 100644 index 243fb00..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMouseTrigger.cs +++ /dev/null @@ -1,129 +0,0 @@ - -#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO) - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncMouseTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onMouseDown; - AsyncTriggerPromiseDictionary onMouseDowns; - AsyncTriggerPromise onMouseDrag; - AsyncTriggerPromiseDictionary onMouseDrags; - AsyncTriggerPromise onMouseEnter; - AsyncTriggerPromiseDictionary onMouseEnters; - AsyncTriggerPromise onMouseExit; - AsyncTriggerPromiseDictionary onMouseExits; - AsyncTriggerPromise onMouseOver; - AsyncTriggerPromiseDictionary onMouseOvers; - AsyncTriggerPromise onMouseUp; - AsyncTriggerPromiseDictionary onMouseUps; - AsyncTriggerPromise onMouseUpAsButton; - AsyncTriggerPromiseDictionary onMouseUpAsButtons; - - - protected override IEnumerable GetPromises() - { - return Concat(onMouseDown, onMouseDowns, onMouseDrag, onMouseDrags, onMouseEnter, onMouseEnters, onMouseExit, onMouseExits, onMouseOver, onMouseOvers, onMouseUp, onMouseUps, onMouseUpAsButton, onMouseUpAsButtons); - } - - - void OnMouseDown() - { - TrySetResult(onMouseDown, onMouseDowns, AsyncUnit.Default); - } - - - public UniTask OnMouseDownAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onMouseDown, ref onMouseDowns, cancellationToken); - } - - - void OnMouseDrag() - { - TrySetResult(onMouseDrag, onMouseDrags, AsyncUnit.Default); - } - - - public UniTask OnMouseDragAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onMouseDrag, ref onMouseDrags, cancellationToken); - } - - - void OnMouseEnter() - { - TrySetResult(onMouseEnter, onMouseEnters, AsyncUnit.Default); - } - - - public UniTask OnMouseEnterAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onMouseEnter, ref onMouseEnters, cancellationToken); - } - - - void OnMouseExit() - { - TrySetResult(onMouseExit, onMouseExits, AsyncUnit.Default); - } - - - public UniTask OnMouseExitAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onMouseExit, ref onMouseExits, cancellationToken); - } - - - void OnMouseOver() - { - TrySetResult(onMouseOver, onMouseOvers, AsyncUnit.Default); - } - - - public UniTask OnMouseOverAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onMouseOver, ref onMouseOvers, cancellationToken); - } - - - void OnMouseUp() - { - TrySetResult(onMouseUp, onMouseUps, AsyncUnit.Default); - } - - - public UniTask OnMouseUpAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onMouseUp, ref onMouseUps, cancellationToken); - } - - - void OnMouseUpAsButton() - { - TrySetResult(onMouseUpAsButton, onMouseUpAsButtons, AsyncUnit.Default); - } - - - public UniTask OnMouseUpAsButtonAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onMouseUpAsButton, ref onMouseUpAsButtons, cancellationToken); - } - - - } -} - -#endif - - -#endif diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMouseTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMouseTrigger.cs.meta deleted file mode 100644 index 9e8706f..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMouseTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 57ad5120e9c4d424484c963791467272 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMoveTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMoveTrigger.cs deleted file mode 100644 index cab098c..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMoveTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncMoveTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onMove; - AsyncTriggerPromiseDictionary onMoves; - - - protected override IEnumerable GetPromises() - { - return Concat(onMove, onMoves); - } - - - void OnMove(AxisEventData eventData) - { - TrySetResult(onMove, onMoves, eventData); - } - - - public UniTask OnMoveAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onMove, ref onMoves, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMoveTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMoveTrigger.cs.meta deleted file mode 100644 index 2ea01b7..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncMoveTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 1699926e875c24d4aa34bc8817f96f0e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncParticleTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncParticleTrigger.cs deleted file mode 100644 index 4e22b36..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncParticleTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncParticleTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onParticleCollision; - AsyncTriggerPromiseDictionary onParticleCollisions; - - - protected override IEnumerable GetPromises() - { - return Concat(onParticleCollision, onParticleCollisions); - } - - - void OnParticleCollision(GameObject other) - { - TrySetResult(onParticleCollision, onParticleCollisions, other); - } - - - public UniTask OnParticleCollisionAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onParticleCollision, ref onParticleCollisions, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncParticleTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncParticleTrigger.cs.meta deleted file mode 100644 index 4a162c7..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncParticleTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 27d3f2efd47fb1d4fb2e9130f97ea8aa -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerClickTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerClickTrigger.cs deleted file mode 100644 index 64b902d..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerClickTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncPointerClickTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onPointerClick; - AsyncTriggerPromiseDictionary onPointerClicks; - - - protected override IEnumerable GetPromises() - { - return Concat(onPointerClick, onPointerClicks); - } - - - void OnPointerClick(PointerEventData eventData) - { - TrySetResult(onPointerClick, onPointerClicks, eventData); - } - - - public UniTask OnPointerClickAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onPointerClick, ref onPointerClicks, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerClickTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerClickTrigger.cs.meta deleted file mode 100644 index 67447a7..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerClickTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 9f8865abf2db3d248b3730cdb18bb8b7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerDownTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerDownTrigger.cs deleted file mode 100644 index 2e32bfc..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerDownTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncPointerDownTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onPointerDown; - AsyncTriggerPromiseDictionary onPointerDowns; - - - protected override IEnumerable GetPromises() - { - return Concat(onPointerDown, onPointerDowns); - } - - - void OnPointerDown(PointerEventData eventData) - { - TrySetResult(onPointerDown, onPointerDowns, eventData); - } - - - public UniTask OnPointerDownAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onPointerDown, ref onPointerDowns, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerDownTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerDownTrigger.cs.meta deleted file mode 100644 index 851cfe4..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerDownTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7c5132395605eaa498a7efedee5acdd7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerEnterTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerEnterTrigger.cs deleted file mode 100644 index 36ed2e3..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerEnterTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncPointerEnterTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onPointerEnter; - AsyncTriggerPromiseDictionary onPointerEnters; - - - protected override IEnumerable GetPromises() - { - return Concat(onPointerEnter, onPointerEnters); - } - - - void OnPointerEnter(PointerEventData eventData) - { - TrySetResult(onPointerEnter, onPointerEnters, eventData); - } - - - public UniTask OnPointerEnterAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onPointerEnter, ref onPointerEnters, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerEnterTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerEnterTrigger.cs.meta deleted file mode 100644 index 9a01b93..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerEnterTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 18887d476d48533498efd14224a2f651 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerExitTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerExitTrigger.cs deleted file mode 100644 index 3cf2575..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerExitTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncPointerExitTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onPointerExit; - AsyncTriggerPromiseDictionary onPointerExits; - - - protected override IEnumerable GetPromises() - { - return Concat(onPointerExit, onPointerExits); - } - - - void OnPointerExit(PointerEventData eventData) - { - TrySetResult(onPointerExit, onPointerExits, eventData); - } - - - public UniTask OnPointerExitAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onPointerExit, ref onPointerExits, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerExitTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerExitTrigger.cs.meta deleted file mode 100644 index 39ab381..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerExitTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 9e3ed09876a11a84794795809ebee243 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerUpTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerUpTrigger.cs deleted file mode 100644 index 4f56fa9..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerUpTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncPointerUpTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onPointerUp; - AsyncTriggerPromiseDictionary onPointerUps; - - - protected override IEnumerable GetPromises() - { - return Concat(onPointerUp, onPointerUps); - } - - - void OnPointerUp(PointerEventData eventData) - { - TrySetResult(onPointerUp, onPointerUps, eventData); - } - - - public UniTask OnPointerUpAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onPointerUp, ref onPointerUps, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerUpTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerUpTrigger.cs.meta deleted file mode 100644 index 7be4e27..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncPointerUpTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7a0493ea32f81314cbbaf2b635ba3167 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncRectTransformTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncRectTransformTrigger.cs deleted file mode 100644 index 4fab679..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncRectTransformTrigger.cs +++ /dev/null @@ -1,55 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncRectTransformTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onRectTransformDimensionsChange; - AsyncTriggerPromiseDictionary onRectTransformDimensionsChanges; - AsyncTriggerPromise onRectTransformRemoved; - AsyncTriggerPromiseDictionary onRectTransformRemoveds; - - - protected override IEnumerable GetPromises() - { - return Concat(onRectTransformDimensionsChange, onRectTransformDimensionsChanges, onRectTransformRemoved, onRectTransformRemoveds); - } - - - void OnRectTransformDimensionsChange() - { - TrySetResult(onRectTransformDimensionsChange, onRectTransformDimensionsChanges, AsyncUnit.Default); - } - - - public UniTask OnRectTransformDimensionsChangeAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onRectTransformDimensionsChange, ref onRectTransformDimensionsChanges, cancellationToken); - } - - - void OnRectTransformRemoved() - { - TrySetResult(onRectTransformRemoved, onRectTransformRemoveds, AsyncUnit.Default); - } - - - public UniTask OnRectTransformRemovedAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onRectTransformRemoved, ref onRectTransformRemoveds, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncRectTransformTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncRectTransformTrigger.cs.meta deleted file mode 100644 index 98c4f70..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncRectTransformTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: dfe3470221c66c84397c0783c62b24e7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncScrollTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncScrollTrigger.cs deleted file mode 100644 index 7a28c64..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncScrollTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncScrollTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onScroll; - AsyncTriggerPromiseDictionary onScrolls; - - - protected override IEnumerable GetPromises() - { - return Concat(onScroll, onScrolls); - } - - - void OnScroll(PointerEventData eventData) - { - TrySetResult(onScroll, onScrolls, eventData); - } - - - public UniTask OnScrollAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onScroll, ref onScrolls, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncScrollTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncScrollTrigger.cs.meta deleted file mode 100644 index 541bdbe..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncScrollTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7c751e9d3deb97d4d8691a8a583c2afd -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSelectTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSelectTrigger.cs deleted file mode 100644 index 093ec79..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSelectTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncSelectTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onSelect; - AsyncTriggerPromiseDictionary onSelects; - - - protected override IEnumerable GetPromises() - { - return Concat(onSelect, onSelects); - } - - - void OnSelect(BaseEventData eventData) - { - TrySetResult(onSelect, onSelects, eventData); - } - - - public UniTask OnSelectAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onSelect, ref onSelects, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSelectTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSelectTrigger.cs.meta deleted file mode 100644 index dd4563b..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSelectTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fcc2347251a4fc5498a03f0c17382920 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncStartTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncStartTrigger.cs deleted file mode 100644 index 4c65c8c..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncStartTrigger.cs +++ /dev/null @@ -1,64 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using UnityEngine; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncStartTrigger : MonoBehaviour - { - bool awakeCalled = false; - bool called = false; - UniTaskCompletionSource promise; - - void Awake() - { - awakeCalled = true; - } - - void Start() - { - called = true; - promise?.TrySetResult(); - } - - public UniTask StartAsync() - { - if (called) return UniTask.CompletedTask; - if (!awakeCalled) - { - PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, new AwakeMonitor(this)); - } - return new UniTask(promise ?? (promise = new UniTaskCompletionSource())); - } - - private void OnDestroy() - { - promise?.TrySetCanceled(); - } - - class AwakeMonitor : IPlayerLoopItem - { - readonly AsyncStartTrigger trigger; - - public AwakeMonitor(AsyncStartTrigger trigger) - { - this.trigger = trigger; - } - - public bool MoveNext() - { - if (trigger.awakeCalled) return false; - if (trigger == null) - { - trigger.OnDestroy(); - return false; - } - return true; - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncStartTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncStartTrigger.cs.meta deleted file mode 100644 index 9ef06e8..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncStartTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b4fd0f75e54ec3d4fbcb7fc65b11646b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSubmitTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSubmitTrigger.cs deleted file mode 100644 index 0dd4206..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSubmitTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncSubmitTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onSubmit; - AsyncTriggerPromiseDictionary onSubmits; - - - protected override IEnumerable GetPromises() - { - return Concat(onSubmit, onSubmits); - } - - - void OnSubmit(BaseEventData eventData) - { - TrySetResult(onSubmit, onSubmits, eventData); - } - - - public UniTask OnSubmitAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onSubmit, ref onSubmits, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSubmitTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSubmitTrigger.cs.meta deleted file mode 100644 index 16b6b05..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncSubmitTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 97e85abc2d7ec0c44adfbe5ee971aad3 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTransformChangedTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTransformChangedTrigger.cs deleted file mode 100644 index acad97e..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTransformChangedTrigger.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncTransformChangedTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onBeforeTransformParentChanged; - AsyncTriggerPromiseDictionary onBeforeTransformParentChangeds; - AsyncTriggerPromise onTransformParentChanged; - AsyncTriggerPromiseDictionary onTransformParentChangeds; - AsyncTriggerPromise onTransformChildrenChanged; - AsyncTriggerPromiseDictionary onTransformChildrenChangeds; - - - protected override IEnumerable GetPromises() - { - return Concat(onBeforeTransformParentChanged, onBeforeTransformParentChangeds, onTransformParentChanged, onTransformParentChangeds, onTransformChildrenChanged, onTransformChildrenChangeds); - } - - - void OnBeforeTransformParentChanged() - { - TrySetResult(onBeforeTransformParentChanged, onBeforeTransformParentChangeds, AsyncUnit.Default); - } - - - public UniTask OnBeforeTransformParentChangedAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onBeforeTransformParentChanged, ref onBeforeTransformParentChangeds, cancellationToken); - } - - - void OnTransformParentChanged() - { - TrySetResult(onTransformParentChanged, onTransformParentChangeds, AsyncUnit.Default); - } - - - public UniTask OnTransformParentChangedAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onTransformParentChanged, ref onTransformParentChangeds, cancellationToken); - } - - - void OnTransformChildrenChanged() - { - TrySetResult(onTransformChildrenChanged, onTransformChildrenChangeds, AsyncUnit.Default); - } - - - public UniTask OnTransformChildrenChangedAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onTransformChildrenChanged, ref onTransformChildrenChangeds, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTransformChangedTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTransformChangedTrigger.cs.meta deleted file mode 100644 index 60b6c38..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTransformChangedTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 053f983cd760f5e4394be8fd657243c1 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTrigger2DTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTrigger2DTrigger.cs deleted file mode 100644 index dc33415..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTrigger2DTrigger.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncTrigger2DTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onTriggerEnter2D; - AsyncTriggerPromiseDictionary onTriggerEnter2Ds; - AsyncTriggerPromise onTriggerExit2D; - AsyncTriggerPromiseDictionary onTriggerExit2Ds; - AsyncTriggerPromise onTriggerStay2D; - AsyncTriggerPromiseDictionary onTriggerStay2Ds; - - - protected override IEnumerable GetPromises() - { - return Concat(onTriggerEnter2D, onTriggerEnter2Ds, onTriggerExit2D, onTriggerExit2Ds, onTriggerStay2D, onTriggerStay2Ds); - } - - - void OnTriggerEnter2D(Collider2D other) - { - TrySetResult(onTriggerEnter2D, onTriggerEnter2Ds, other); - } - - - public UniTask OnTriggerEnter2DAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onTriggerEnter2D, ref onTriggerEnter2Ds, cancellationToken); - } - - - void OnTriggerExit2D(Collider2D other) - { - TrySetResult(onTriggerExit2D, onTriggerExit2Ds, other); - } - - - public UniTask OnTriggerExit2DAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onTriggerExit2D, ref onTriggerExit2Ds, cancellationToken); - } - - - void OnTriggerStay2D(Collider2D other) - { - TrySetResult(onTriggerStay2D, onTriggerStay2Ds, other); - } - - - public UniTask OnTriggerStay2DAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onTriggerStay2D, ref onTriggerStay2Ds, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTrigger2DTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTrigger2DTrigger.cs.meta deleted file mode 100644 index 8d88bad..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTrigger2DTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 102f8eba36bc2a54e878e67aca9686e5 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerBase.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerBase.cs deleted file mode 100644 index ceb4f7f..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerBase.cs +++ /dev/null @@ -1,271 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections.Generic; -using System.Threading; -using UniRx.Async.Internal; -using UnityEngine; - -namespace UniRx.Async.Triggers -{ - public interface ICancelablePromise - { - CancellationToken RegisteredCancellationToken { get; } - bool TrySetCanceled(); - } - - public class AsyncTriggerPromise : ReusablePromise, IPromise, ICancelablePromise - { - public CancellationToken RegisteredCancellationToken { get; private set; } - - public AsyncTriggerPromise() - : this(CancellationToken.None) - { - } - - public AsyncTriggerPromise(CancellationToken cancellationToken) - { - this.RegisteredCancellationToken = cancellationToken; - TaskTracker.TrackActiveTask(this); - } - - public override T GetResult() - { - if (Status == AwaiterStatus.Pending) return RawResult; - return base.GetResult(); - } - - public override bool TrySetResult(T result) - { - if (Status == AwaiterStatus.Pending) - { - // keep status as Pending. - this.ForceSetResult(result); - TryInvokeContinuation(); - return true; - } - return false; - } - - public override bool TrySetCanceled() - { - if (Status == AwaiterStatus.Canceled) return false; - TaskTracker.RemoveTracking(this); - return base.TrySetCanceled(); - } - } - - public interface ICancellationTokenKeyDictionary - { - void Remove(CancellationToken token); - } - - public class AsyncTriggerPromiseDictionary : - Dictionary>, - ICancellationTokenKeyDictionary, - IEnumerable - { - public AsyncTriggerPromiseDictionary() - : base(CancellationTokenEqualityComparer.Default) - { - } - - IEnumerator IEnumerable.GetEnumerator() - { - return Values.GetEnumerator(); - } - - void ICancellationTokenKeyDictionary.Remove(CancellationToken token) - { - this.Remove(token); - } - } - - public abstract class AsyncTriggerBase : MonoBehaviour - { - static readonly Action Callback = CancelCallback; - - bool calledAwake = false; - bool destroyCalled = false; - CancellationTokenRegistration[] registeredCancellations; - int registeredCancellationsCount; - - protected abstract IEnumerable GetPromises(); - - static protected IEnumerable Concat(ICancelablePromise p1, IEnumerable p1s) - { - if (p1 != null) yield return p1; - if (p1s != null) foreach (var item in p1s) yield return item; - } - - static protected IEnumerable Concat( - ICancelablePromise p1, IEnumerable p1s, - ICancelablePromise p2, IEnumerable p2s) - { - if (p1 != null) yield return p1; - if (p1s != null) foreach (var item in p1s) yield return item; - if (p2 != null) yield return p2; - if (p2s != null) foreach (var item in p2s) yield return item; - } - - static protected IEnumerable Concat( - ICancelablePromise p1, IEnumerable p1s, - ICancelablePromise p2, IEnumerable p2s, - ICancelablePromise p3, IEnumerable p3s) - { - if (p1 != null) yield return p1; - if (p1s != null) foreach (var item in p1s) yield return item; - if (p2 != null) yield return p2; - if (p2s != null) foreach (var item in p2s) yield return item; - if (p3 != null) yield return p3; - if (p3s != null) foreach (var item in p3s) yield return item; - } - - static protected IEnumerable Concat( - ICancelablePromise p1, IEnumerable p1s, - ICancelablePromise p2, IEnumerable p2s, - ICancelablePromise p3, IEnumerable p3s, - ICancelablePromise p4, IEnumerable p4s) - { - if (p1 != null) yield return p1; - if (p1s != null) foreach (var item in p1s) yield return item; - if (p2 != null) yield return p2; - if (p2s != null) foreach (var item in p2s) yield return item; - if (p3 != null) yield return p3; - if (p3s != null) foreach (var item in p3s) yield return item; - if (p4 != null) yield return p4; - if (p4s != null) foreach (var item in p4s) yield return item; - } - - // otherwise... - static protected IEnumerable Concat(params object[] promises) - { - foreach (var item in promises) - { - if (item is ICancelablePromise p) - { - yield return p; - } - else if (item is IEnumerable ps) - { - foreach (var p2 in ps) - { - yield return p2; - } - } - } - } - - protected UniTask GetOrAddPromise(ref AsyncTriggerPromise promise, ref AsyncTriggerPromiseDictionary promises, CancellationToken cancellationToken) - { - if (destroyCalled) return UniTask.FromCanceled(); - - if (!cancellationToken.CanBeCanceled) - { - if (promise == null) - { - promise = new AsyncTriggerPromise(); - if (!calledAwake) - { - PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, new AwakeMonitor(this)); - } - } - return promise.Task; - } - - if (promises == null) promises = new AsyncTriggerPromiseDictionary(); - - if (promises.TryGetValue(cancellationToken, out var cancellablePromise)) - { - return cancellablePromise.Task; - } - - cancellablePromise = new AsyncTriggerPromise(); - promises.Add(cancellationToken, cancellablePromise); - if (!calledAwake) - { - PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, new AwakeMonitor(this)); - } - - var registrationToken = cancellationToken.RegisterWithoutCaptureExecutionContext(Callback, Tuple.Create((ICancellationTokenKeyDictionary)promises, (ICancelablePromise)cancellablePromise)); - if (registeredCancellations == null) - { - registeredCancellations = ArrayPool.Shared.Rent(4); - } - ArrayPoolUtil.EnsureCapacity(ref registeredCancellations, registeredCancellationsCount + 1, ArrayPool.Shared); - registeredCancellations[registeredCancellationsCount++] = registrationToken; - - return cancellablePromise.Task; - } - - static void CancelCallback(object state) - { - var tuple = (Tuple)state; - var dict = tuple.Item1; - var promise = tuple.Item2; - - promise.TrySetCanceled(); - dict.Remove(promise.RegisteredCancellationToken); - } - - protected void TrySetResult(ReusablePromise promise, AsyncTriggerPromiseDictionary promises, T value) - { - if (promise != null) - { - promise.TrySetResult(value); - } - if (promises != null) - { - PromiseHelper.TrySetResultAll(promises.Values, value); - } - } - - void Awake() - { - calledAwake = true; - } - - void OnDestroy() - { - if (destroyCalled) return; - destroyCalled = true; - foreach (var item in GetPromises()) - { - item.TrySetCanceled(); - } - if (registeredCancellations != null) - { - for (int i = 0; i < registeredCancellationsCount; i++) - { - registeredCancellations[i].Dispose(); - registeredCancellations[i] = default(CancellationTokenRegistration); - } - ArrayPool.Shared.Return(registeredCancellations); - } - } - - class AwakeMonitor : IPlayerLoopItem - { - readonly AsyncTriggerBase trigger; - - public AwakeMonitor(AsyncTriggerBase trigger) - { - this.trigger = trigger; - } - - public bool MoveNext() - { - if (trigger.calledAwake) return false; - if (trigger == null) - { - trigger.OnDestroy(); - return false; - } - return true; - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerBase.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerBase.cs.meta deleted file mode 100644 index e101ea2..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerBase.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 2c0c2bcee832c6641b25949c412f020f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerExtensions.cs deleted file mode 100644 index 8413968..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerExtensions.cs +++ /dev/null @@ -1,511 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Threading; -using UnityEngine; - -namespace UniRx.Async.Triggers -{ - public static class AsyncTriggerExtensions - { - // Util. - - static T GetOrAddComponent(GameObject gameObject) - where T : Component - { - var component = gameObject.GetComponent(); - if (component == null) - { - component = gameObject.AddComponent(); - } - - return component; - } - - // Special for single operation. - - /// This function is called when the MonoBehaviour will be destroyed. - public static UniTask OnDestroyAsync(this GameObject gameObject) - { - return gameObject.GetAsyncDestroyTrigger().OnDestroyAsync(); - } - - /// This function is called when the MonoBehaviour will be destroyed. - public static UniTask OnDestroyAsync(this Component component) - { - return component.GetAsyncDestroyTrigger().OnDestroyAsync(); - } - - /// This CancellationToken is canceled when the MonoBehaviour will be destroyed. - public static CancellationToken GetCancellationTokenOnDestroy(this GameObject gameObject) - { - return gameObject.GetAsyncDestroyTrigger().CancellationToken; - } - - /// This CancellationToken is canceled when the MonoBehaviour will be destroyed. - public static CancellationToken GetCancellationTokenOnDestroy(this Component component) - { - return component.GetAsyncDestroyTrigger().CancellationToken; - } - - public static UniTask StartAsync(this GameObject gameObject) - { - return gameObject.GetAsyncStartTrigger().StartAsync(); - } - - public static UniTask StartAsync(this Component component) - { - return component.GetAsyncStartTrigger().StartAsync(); - } - - public static UniTask AwakeAsync(this GameObject gameObject) - { - return gameObject.GetAsyncAwakeTrigger().AwakeAsync(); - } - - public static UniTask AwakeAsync(this Component component) - { - return component.GetAsyncAwakeTrigger().AwakeAsync(); - } - - // Get Triggers. - - /// Get for OnAnimatorIKAsync | OnAnimatorMoveAsync. - public static AsyncAnimatorTrigger GetAsyncAnimatorTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnAnimatorIKAsync | OnAnimatorMoveAsync. - public static AsyncAnimatorTrigger GetAsyncAnimatorTrigger(this Component component) - { - return component.gameObject.GetAsyncAnimatorTrigger(); - } - - /// Get for AwakeAsync. - public static AsyncAwakeTrigger GetAsyncAwakeTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for AwakeAsync. - public static AsyncAwakeTrigger GetAsyncAwakeTrigger(this Component component) - { - return component.gameObject.GetAsyncAwakeTrigger(); - } - - /// Get for OnBeginDragAsync. - public static AsyncBeginDragTrigger GetAsyncBeginDragTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnBeginDragAsync. - public static AsyncBeginDragTrigger GetAsyncBeginDragTrigger(this Component component) - { - return component.gameObject.GetAsyncBeginDragTrigger(); - } - - /// Get for OnCancelAsync. - public static AsyncCancelTrigger GetAsyncCancelTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnCancelAsync. - public static AsyncCancelTrigger GetAsyncCancelTrigger(this Component component) - { - return component.gameObject.GetAsyncCancelTrigger(); - } - - /// Get for OnCanvasGroupChangedAsync. - public static AsyncCanvasGroupChangedTrigger GetAsyncCanvasGroupChangedTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnCanvasGroupChangedAsync. - public static AsyncCanvasGroupChangedTrigger GetAsyncCanvasGroupChangedTrigger(this Component component) - { - return component.gameObject.GetAsyncCanvasGroupChangedTrigger(); - } - - /// Get for OnCollisionEnter2DAsync | OnCollisionExit2DAsync | OnCollisionStay2DAsync. - public static AsyncCollision2DTrigger GetAsyncCollision2DTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnCollisionEnter2DAsync | OnCollisionExit2DAsync | OnCollisionStay2DAsync. - public static AsyncCollision2DTrigger GetAsyncCollision2DTrigger(this Component component) - { - return component.gameObject.GetAsyncCollision2DTrigger(); - } - - /// Get for OnCollisionEnterAsync | OnCollisionExitAsync | OnCollisionStayAsync. - public static AsyncCollisionTrigger GetAsyncCollisionTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnCollisionEnterAsync | OnCollisionExitAsync | OnCollisionStayAsync. - public static AsyncCollisionTrigger GetAsyncCollisionTrigger(this Component component) - { - return component.gameObject.GetAsyncCollisionTrigger(); - } - - /// Get for OnDeselectAsync. - public static AsyncDeselectTrigger GetAsyncDeselectTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnDeselectAsync. - public static AsyncDeselectTrigger GetAsyncDeselectTrigger(this Component component) - { - return component.gameObject.GetAsyncDeselectTrigger(); - } - - /// Get for OnDestroyAsync. - public static AsyncDestroyTrigger GetAsyncDestroyTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnDestroyAsync. - public static AsyncDestroyTrigger GetAsyncDestroyTrigger(this Component component) - { - return component.gameObject.GetAsyncDestroyTrigger(); - } - - /// Get for OnDragAsync. - public static AsyncDragTrigger GetAsyncDragTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnDragAsync. - public static AsyncDragTrigger GetAsyncDragTrigger(this Component component) - { - return component.gameObject.GetAsyncDragTrigger(); - } - - /// Get for OnDropAsync. - public static AsyncDropTrigger GetAsyncDropTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnDropAsync. - public static AsyncDropTrigger GetAsyncDropTrigger(this Component component) - { - return component.gameObject.GetAsyncDropTrigger(); - } - - /// Get for OnEnableAsync | OnDisableAsync. - public static AsyncEnableDisableTrigger GetAsyncEnableDisableTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnEnableAsync | OnDisableAsync. - public static AsyncEnableDisableTrigger GetAsyncEnableDisableTrigger(this Component component) - { - return component.gameObject.GetAsyncEnableDisableTrigger(); - } - - /// Get for OnEndDragAsync. - public static AsyncEndDragTrigger GetAsyncEndDragTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnEndDragAsync. - public static AsyncEndDragTrigger GetAsyncEndDragTrigger(this Component component) - { - return component.gameObject.GetAsyncEndDragTrigger(); - } - - /// Get for FixedUpdateAsync. - public static AsyncFixedUpdateTrigger GetAsyncFixedUpdateTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for FixedUpdateAsync. - public static AsyncFixedUpdateTrigger GetAsyncFixedUpdateTrigger(this Component component) - { - return component.gameObject.GetAsyncFixedUpdateTrigger(); - } - - /// Get for OnInitializePotentialDragAsync. - public static AsyncInitializePotentialDragTrigger GetAsyncInitializePotentialDragTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnInitializePotentialDragAsync. - public static AsyncInitializePotentialDragTrigger GetAsyncInitializePotentialDragTrigger(this Component component) - { - return component.gameObject.GetAsyncInitializePotentialDragTrigger(); - } - - /// Get for OnJointBreakAsync. - public static AsyncJointTrigger GetAsyncJointTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnJointBreakAsync. - public static AsyncJointTrigger GetAsyncJointTrigger(this Component component) - { - return component.gameObject.GetAsyncJointTrigger(); - } - - /// Get for LateUpdateAsync. - public static AsyncLateUpdateTrigger GetAsyncLateUpdateTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for LateUpdateAsync. - public static AsyncLateUpdateTrigger GetAsyncLateUpdateTrigger(this Component component) - { - return component.gameObject.GetAsyncLateUpdateTrigger(); - } - -#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO) - - /// Get for OnMouseDownAsync | OnMouseDragAsync | OnMouseEnterAsync | OnMouseExitAsync | OnMouseOverAsync | OnMouseUpAsync | OnMouseUpAsButtonAsync. - public static AsyncMouseTrigger GetAsyncMouseTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnMouseDownAsync | OnMouseDragAsync | OnMouseEnterAsync | OnMouseExitAsync | OnMouseOverAsync | OnMouseUpAsync | OnMouseUpAsButtonAsync. - public static AsyncMouseTrigger GetAsyncMouseTrigger(this Component component) - { - return component.gameObject.GetAsyncMouseTrigger(); - } - -#endif - - /// Get for OnMoveAsync. - public static AsyncMoveTrigger GetAsyncMoveTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnMoveAsync. - public static AsyncMoveTrigger GetAsyncMoveTrigger(this Component component) - { - return component.gameObject.GetAsyncMoveTrigger(); - } - - /// Get for OnParticleCollisionAsync | OnParticleTriggerAsync. - public static AsyncParticleTrigger GetAsyncParticleTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnParticleCollisionAsync | OnParticleTriggerAsync. - public static AsyncParticleTrigger GetAsyncParticleTrigger(this Component component) - { - return component.gameObject.GetAsyncParticleTrigger(); - } - - /// Get for OnPointerClickAsync. - public static AsyncPointerClickTrigger GetAsyncPointerClickTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnPointerClickAsync. - public static AsyncPointerClickTrigger GetAsyncPointerClickTrigger(this Component component) - { - return component.gameObject.GetAsyncPointerClickTrigger(); - } - - /// Get for OnPointerDownAsync. - public static AsyncPointerDownTrigger GetAsyncPointerDownTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnPointerDownAsync. - public static AsyncPointerDownTrigger GetAsyncPointerDownTrigger(this Component component) - { - return component.gameObject.GetAsyncPointerDownTrigger(); - } - - /// Get for OnPointerEnterAsync. - public static AsyncPointerEnterTrigger GetAsyncPointerEnterTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnPointerEnterAsync. - public static AsyncPointerEnterTrigger GetAsyncPointerEnterTrigger(this Component component) - { - return component.gameObject.GetAsyncPointerEnterTrigger(); - } - - /// Get for OnPointerExitAsync. - public static AsyncPointerExitTrigger GetAsyncPointerExitTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnPointerExitAsync. - public static AsyncPointerExitTrigger GetAsyncPointerExitTrigger(this Component component) - { - return component.gameObject.GetAsyncPointerExitTrigger(); - } - - /// Get for OnPointerUpAsync. - public static AsyncPointerUpTrigger GetAsyncPointerUpTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnPointerUpAsync. - public static AsyncPointerUpTrigger GetAsyncPointerUpTrigger(this Component component) - { - return component.gameObject.GetAsyncPointerUpTrigger(); - } - - /// Get for OnRectTransformDimensionsChange | OnRectTransformDimensionsChangeAsync | OnRectTransformRemoved | OnRectTransformRemovedAsync. - public static AsyncRectTransformTrigger GetAsyncRectTransformTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnRectTransformDimensionsChange | OnRectTransformDimensionsChangeAsync | OnRectTransformRemoved | OnRectTransformRemovedAsync. - public static AsyncRectTransformTrigger GetAsyncRectTransformTrigger(this Component component) - { - return component.gameObject.GetAsyncRectTransformTrigger(); - } - - /// Get for OnScrollAsync. - public static AsyncScrollTrigger GetAsyncScrollTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnScrollAsync. - public static AsyncScrollTrigger GetAsyncScrollTrigger(this Component component) - { - return component.gameObject.GetAsyncScrollTrigger(); - } - - /// Get for OnSelectAsync. - public static AsyncSelectTrigger GetAsyncSelectTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnSelectAsync. - public static AsyncSelectTrigger GetAsyncSelectTrigger(this Component component) - { - return component.gameObject.GetAsyncSelectTrigger(); - } - - /// Get for StartAsync. - public static AsyncStartTrigger GetAsyncStartTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for StartAsync. - public static AsyncStartTrigger GetAsyncStartTrigger(this Component component) - { - return component.gameObject.GetAsyncStartTrigger(); - } - - /// Get for OnSubmitAsync. - public static AsyncSubmitTrigger GetAsyncSubmitTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnSubmitAsync. - public static AsyncSubmitTrigger GetAsyncSubmitTrigger(this Component component) - { - return component.gameObject.GetAsyncSubmitTrigger(); - } - - /// Get for OnBeforeTransformParentChangedAsync | OnTransformParentChangedAsync | OnTransformChildrenChangedAsync. - public static AsyncTransformChangedTrigger GetAsyncTransformChangedTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnBeforeTransformParentChangedAsync | OnTransformParentChangedAsync | OnTransformChildrenChangedAsync. - public static AsyncTransformChangedTrigger GetAsyncTransformChangedTrigger(this Component component) - { - return component.gameObject.GetAsyncTransformChangedTrigger(); - } - - /// Get for OnTriggerEnter2DAsync | OnTriggerExit2DAsync | OnTriggerStay2DAsync. - public static AsyncTrigger2DTrigger GetAsyncTrigger2DTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnTriggerEnter2DAsync | OnTriggerExit2DAsync | OnTriggerStay2DAsync. - public static AsyncTrigger2DTrigger GetAsyncTrigger2DTrigger(this Component component) - { - return component.gameObject.GetAsyncTrigger2DTrigger(); - } - - /// Get for OnTriggerEnterAsync | OnTriggerExitAsync | OnTriggerStayAsync. - public static AsyncTriggerTrigger GetAsyncTriggerTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnTriggerEnterAsync | OnTriggerExitAsync | OnTriggerStayAsync. - public static AsyncTriggerTrigger GetAsyncTriggerTrigger(this Component component) - { - return component.gameObject.GetAsyncTriggerTrigger(); - } - - /// Get for OnUpdateSelectedAsync. - public static AsyncUpdateSelectedTrigger GetAsyncUpdateSelectedTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnUpdateSelectedAsync. - public static AsyncUpdateSelectedTrigger GetAsyncUpdateSelectedTrigger(this Component component) - { - return component.gameObject.GetAsyncUpdateSelectedTrigger(); - } - - /// Get for UpdateAsync. - public static AsyncUpdateTrigger GetAsyncUpdateTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for UpdateAsync. - public static AsyncUpdateTrigger GetAsyncUpdateTrigger(this Component component) - { - return component.gameObject.GetAsyncUpdateTrigger(); - } - - /// Get for OnBecameInvisibleAsync | OnBecameVisibleAsync. - public static AsyncVisibleTrigger GetAsyncVisibleTrigger(this GameObject gameObject) - { - return GetOrAddComponent(gameObject); - } - - /// Get for OnBecameInvisibleAsync | OnBecameVisibleAsync. - public static AsyncVisibleTrigger GetAsyncVisibleTrigger(this Component component) - { - return component.gameObject.GetAsyncVisibleTrigger(); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerExtensions.cs.meta deleted file mode 100644 index 348783d..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 59b61dbea1562a84fb7a38ae0a0a0f88 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerTrigger.cs deleted file mode 100644 index 22f3c94..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerTrigger.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncTriggerTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onTriggerEnter; - AsyncTriggerPromiseDictionary onTriggerEnters; - AsyncTriggerPromise onTriggerExit; - AsyncTriggerPromiseDictionary onTriggerExits; - AsyncTriggerPromise onTriggerStay; - AsyncTriggerPromiseDictionary onTriggerStays; - - - protected override IEnumerable GetPromises() - { - return Concat(onTriggerEnter, onTriggerEnters, onTriggerExit, onTriggerExits, onTriggerStay, onTriggerStays); - } - - - void OnTriggerEnter(Collider other) - { - TrySetResult(onTriggerEnter, onTriggerEnters, other); - } - - - public UniTask OnTriggerEnterAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onTriggerEnter, ref onTriggerEnters, cancellationToken); - } - - - void OnTriggerExit(Collider other) - { - TrySetResult(onTriggerExit, onTriggerExits, other); - } - - - public UniTask OnTriggerExitAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onTriggerExit, ref onTriggerExits, cancellationToken); - } - - - void OnTriggerStay(Collider other) - { - TrySetResult(onTriggerStay, onTriggerStays, other); - } - - - public UniTask OnTriggerStayAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onTriggerStay, ref onTriggerStays, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerTrigger.cs.meta deleted file mode 100644 index b9f7efb..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncTriggerTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 46bbbbaa910762c4786906e10b6b7b8e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateSelectedTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateSelectedTrigger.cs deleted file mode 100644 index 5f7536e..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateSelectedTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncUpdateSelectedTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onUpdateSelected; - AsyncTriggerPromiseDictionary onUpdateSelecteds; - - - protected override IEnumerable GetPromises() - { - return Concat(onUpdateSelected, onUpdateSelecteds); - } - - - void OnUpdateSelected(BaseEventData eventData) - { - TrySetResult(onUpdateSelected, onUpdateSelecteds, eventData); - } - - - public UniTask OnUpdateSelectedAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onUpdateSelected, ref onUpdateSelecteds, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateSelectedTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateSelectedTrigger.cs.meta deleted file mode 100644 index 395b43c..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateSelectedTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ba5b0a4234e164e41b85f10b709d72e9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateTrigger.cs deleted file mode 100644 index 258eec9..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateTrigger.cs +++ /dev/null @@ -1,41 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncUpdateTrigger : AsyncTriggerBase - { - AsyncTriggerPromise update; - AsyncTriggerPromiseDictionary updates; - - - protected override IEnumerable GetPromises() - { - return Concat(update, updates); - } - - - void Update() - { - TrySetResult(update, updates, AsyncUnit.Default); - } - - - public UniTask UpdateAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref update, ref updates, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateTrigger.cs.meta deleted file mode 100644 index d2277f7..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncUpdateTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c6053bbe25af0d6439712f7c5fc4afc7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncVisibleTrigger.cs b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncVisibleTrigger.cs deleted file mode 100644 index df9596e..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncVisibleTrigger.cs +++ /dev/null @@ -1,55 +0,0 @@ - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Threading; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UniRx.Async.Triggers -{ - [DisallowMultipleComponent] - public class AsyncVisibleTrigger : AsyncTriggerBase - { - AsyncTriggerPromise onBecameInvisible; - AsyncTriggerPromiseDictionary onBecameInvisibles; - AsyncTriggerPromise onBecameVisible; - AsyncTriggerPromiseDictionary onBecameVisibles; - - - protected override IEnumerable GetPromises() - { - return Concat(onBecameInvisible, onBecameInvisibles, onBecameVisible, onBecameVisibles); - } - - - void OnBecameInvisible() - { - TrySetResult(onBecameInvisible, onBecameInvisibles, AsyncUnit.Default); - } - - - public UniTask OnBecameInvisibleAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onBecameInvisible, ref onBecameInvisibles, cancellationToken); - } - - - void OnBecameVisible() - { - TrySetResult(onBecameVisible, onBecameVisibles, AsyncUnit.Default); - } - - - public UniTask OnBecameVisibleAsync(CancellationToken cancellationToken = default(CancellationToken)) - { - return GetOrAddPromise(ref onBecameVisible, ref onBecameVisibles, cancellationToken); - } - - - } -} - -#endif - diff --git a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncVisibleTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncVisibleTrigger.cs.meta deleted file mode 100644 index 24b33ec..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/Triggers/AsyncVisibleTrigger.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 57ebfef2a87c49c46ad6454db136f3ef -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniRx.Async.asmdef b/Assets/Plugins/UniRx/Scripts/Async/UniRx.Async.asmdef deleted file mode 100644 index bb982ba..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniRx.Async.asmdef +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "UniRx.Async", - "references": [], - "optionalUnityReferences": [], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": false -} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Bridge.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Bridge.cs deleted file mode 100644 index 814bd02..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Bridge.cs +++ /dev/null @@ -1,20 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections; - -namespace UniRx.Async -{ - // UnityEngine Bridges. - - public partial struct UniTask - { - public static IEnumerator ToCoroutine(Func taskFactory) - { - return taskFactory().ToCoroutine(); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Bridge.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Bridge.cs.meta deleted file mode 100644 index 6f8da80..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Bridge.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: bd6beac8e0ebd264e9ba246c39429c72 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Delay.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Delay.cs deleted file mode 100644 index d828358..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Delay.cs +++ /dev/null @@ -1,246 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Runtime.CompilerServices; -using System.Threading; -using UniRx.Async.Internal; -using UnityEngine; - -namespace UniRx.Async -{ - public partial struct UniTask - { - public static YieldAwaitable Yield(PlayerLoopTiming timing = PlayerLoopTiming.Update) - { - // optimized for single continuation - return new YieldAwaitable(timing); - } - - public static UniTask Yield(PlayerLoopTiming timing, CancellationToken cancellationToken) - { - return new UniTask(new YieldPromise(timing, cancellationToken)); - } - - public static UniTask DelayFrame(int delayFrameCount, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken)) - { - if (delayFrameCount < 0) - { - throw new ArgumentOutOfRangeException("Delay does not allow minus delayFrameCount. delayFrameCount:" + delayFrameCount); - } - - var source = new DelayFramePromise(delayFrameCount, delayTiming, cancellationToken); - return source.Task; - } - - public static UniTask Delay(int millisecondsDelay, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken)) - { - var delayTimeSpan = TimeSpan.FromMilliseconds(millisecondsDelay); - if (delayTimeSpan < TimeSpan.Zero) - { - throw new ArgumentOutOfRangeException("Delay does not allow minus delayFrameCount. delayTimeSpan:" + delayTimeSpan); - } - - return (ignoreTimeScale) - ? new DelayIgnoreTimeScalePromise(delayTimeSpan, delayTiming, cancellationToken).Task - : new DelayPromise(delayTimeSpan, delayTiming, cancellationToken).Task; - } - - public static UniTask Delay(TimeSpan delayTimeSpan, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken)) - { - if (delayTimeSpan < TimeSpan.Zero) - { - throw new ArgumentOutOfRangeException("Delay does not allow minus delayFrameCount. delayTimeSpan:" + delayTimeSpan); - } - - return (ignoreTimeScale) - ? new DelayIgnoreTimeScalePromise(delayTimeSpan, delayTiming, cancellationToken).Task - : new DelayPromise(delayTimeSpan, delayTiming, cancellationToken).Task; - } - - class YieldPromise : PlayerLoopReusablePromiseBase - { - public YieldPromise(PlayerLoopTiming timing, CancellationToken cancellationToken) - : base(timing, cancellationToken, 2) - { - } - - protected override void OnRunningStart() - { - } - - public override bool MoveNext() - { - Complete(); - if (cancellationToken.IsCancellationRequested) - { - TrySetCanceled(); - } - else - { - TrySetResult(); - } - - return false; - } - } - - class DelayFramePromise : PlayerLoopReusablePromiseBase - { - readonly int delayFrameCount; - int currentFrameCount; - - public DelayFramePromise(int delayFrameCount, PlayerLoopTiming timing, CancellationToken cancellationToken) - : base(timing, cancellationToken, 2) - { - this.delayFrameCount = delayFrameCount; - this.currentFrameCount = 0; - } - - protected override void OnRunningStart() - { - currentFrameCount = 0; - } - - public override bool MoveNext() - { - if (cancellationToken.IsCancellationRequested) - { - Complete(); - TrySetCanceled(); - return false; - } - - if (currentFrameCount == delayFrameCount) - { - Complete(); - TrySetResult(currentFrameCount); - return false; - } - - currentFrameCount++; - return true; - } - } - - class DelayPromise : PlayerLoopReusablePromiseBase - { - readonly float delayFrameTimeSpan; - float elapsed; - - public DelayPromise(TimeSpan delayFrameTimeSpan, PlayerLoopTiming timing, CancellationToken cancellationToken) - : base(timing, cancellationToken, 2) - { - this.delayFrameTimeSpan = (float)delayFrameTimeSpan.TotalSeconds; - } - - protected override void OnRunningStart() - { - this.elapsed = 0.0f; - } - - public override bool MoveNext() - { - if (cancellationToken.IsCancellationRequested) - { - Complete(); - TrySetCanceled(); - return false; - } - - elapsed += Time.deltaTime; - if (elapsed >= delayFrameTimeSpan) - { - Complete(); - TrySetResult(); - return false; - } - - return true; - } - } - - class DelayIgnoreTimeScalePromise : PlayerLoopReusablePromiseBase - { - readonly float delayFrameTimeSpan; - float elapsed; - - public DelayIgnoreTimeScalePromise(TimeSpan delayFrameTimeSpan, PlayerLoopTiming timing, CancellationToken cancellationToken) - : base(timing, cancellationToken, 2) - { - this.delayFrameTimeSpan = (float)delayFrameTimeSpan.TotalSeconds; - } - - protected override void OnRunningStart() - { - this.elapsed = 0.0f; - } - - public override bool MoveNext() - { - if (cancellationToken.IsCancellationRequested) - { - Complete(); - TrySetCanceled(); - return false; - } - - elapsed += Time.unscaledDeltaTime; - - if (elapsed >= delayFrameTimeSpan) - { - Complete(); - TrySetResult(); - return false; - } - - return true; - } - } - } - - public struct YieldAwaitable - { - readonly PlayerLoopTiming timing; - - public YieldAwaitable(PlayerLoopTiming timing) - { - this.timing = timing; - } - - public Awaiter GetAwaiter() - { - return new Awaiter(timing); - } - - public UniTask ToUniTask() - { - return UniTask.Yield(timing, CancellationToken.None); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - readonly PlayerLoopTiming timing; - - public Awaiter(PlayerLoopTiming timing) - { - this.timing = timing; - } - - public bool IsCompleted => false; - - public void GetResult() { } - - public void OnCompleted(Action continuation) - { - PlayerLoopHelper.AddContinuation(timing, continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - PlayerLoopHelper.AddContinuation(timing, continuation); - } - } - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Delay.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Delay.cs.meta deleted file mode 100644 index 08ce579..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Delay.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ecff7972251de0848b2c0fa89bbd3489 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Factory.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Factory.cs deleted file mode 100644 index 0150450..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Factory.cs +++ /dev/null @@ -1,121 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Threading; - -namespace UniRx.Async -{ - public partial struct UniTask - { - static readonly UniTask CanceledUniTask = new Func(() => - { - var promise = new UniTaskCompletionSource(); - promise.TrySetCanceled(); - promise.MarkHandled(); - return new UniTask(promise); - })(); - - public static UniTask CompletedTask - { - get - { - return new UniTask(); - } - } - - public static UniTask FromException(Exception ex) - { - var promise = new UniTaskCompletionSource(); - promise.TrySetException(ex); - promise.MarkHandled(); - return new UniTask(promise); - } - - public static UniTask FromException(Exception ex) - { - var promise = new UniTaskCompletionSource(); - promise.TrySetException(ex); - promise.MarkHandled(); - return new UniTask(promise); - } - - public static UniTask FromResult(T value) - { - return new UniTask(value); - } - - public static UniTask FromCanceled() - { - return CanceledUniTask; - } - - public static UniTask FromCanceled() - { - return CanceledUniTaskCache.Task; - } - - public static UniTask FromCanceled(CancellationToken token) - { - var promise = new UniTaskCompletionSource(); - promise.TrySetException(new OperationCanceledException(token)); - promise.MarkHandled(); - return new UniTask(promise); - } - - public static UniTask FromCanceled(CancellationToken token) - { - var promise = new UniTaskCompletionSource(); - promise.TrySetException(new OperationCanceledException(token)); - promise.MarkHandled(); - return new UniTask(promise); - } - - /// shorthand of new UniTask[T](Func[UniTask[T]] factory) - public static UniTask Lazy(Func> factory) - { - return new UniTask(factory); - } - - /// - /// helper of create add UniTaskVoid to delegate. - /// For example: FooEvent += () => UniTask.Void(async () => { /* */ }) - /// - public static void Void(Func asyncAction) - { - asyncAction().Forget(); - } - - /// - /// helper of create add UniTaskVoid to delegate. - /// For example: FooEvent += (sender, e) => UniTask.Void(async arg => { /* */ }, (sender, e)) - /// - public static void Void(Func asyncAction, T state) - { - asyncAction(state).Forget(); - } - - static class CanceledUniTaskCache - { - public static readonly UniTask Task; - - static CanceledUniTaskCache() - { - var promise = new UniTaskCompletionSource(); - promise.TrySetCanceled(); - promise.MarkHandled(); - Task = new UniTask(promise); - } - } - } - - internal static class CompletedTasks - { - public static readonly UniTask True = UniTask.FromResult(true); - public static readonly UniTask False = UniTask.FromResult(false); - public static readonly UniTask Zero = UniTask.FromResult(0); - public static readonly UniTask MinusOne = UniTask.FromResult(-1); - public static readonly UniTask One = UniTask.FromResult(1); - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Factory.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Factory.cs.meta deleted file mode 100644 index 31bc0c9..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Factory.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4e12b66d6b9bd7845b04a594cbe386b4 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Run.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Run.cs deleted file mode 100644 index 508be8d..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Run.cs +++ /dev/null @@ -1,58 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; - -namespace UniRx.Async -{ - public partial struct UniTask - { - /// Run action on the threadPool and return to main thread if configureAwait = true. - public static async UniTask Run(Action action, bool configureAwait = true) - { - await UniTask.SwitchToThreadPool(); - action(); - if (configureAwait) - { - await UniTask.Yield(); - } - } - - /// Run action on the threadPool and return to main thread if configureAwait = true. - public static async UniTask Run(Action action, object state, bool configureAwait = true) - { - await UniTask.SwitchToThreadPool(); - action(state); - if (configureAwait) - { - await UniTask.Yield(); - } - } - - /// Run action on the threadPool and return to main thread if configureAwait = true. - public static async UniTask Run(Func func, bool configureAwait = true) - { - await UniTask.SwitchToThreadPool(); - var result = func(); - if (configureAwait) - { - await UniTask.Yield(); - } - return result; - } - - /// Run action on the threadPool and return to main thread if configureAwait = true. - public static async UniTask Run(Func func, object state, bool configureAwait = true) - { - await UniTask.SwitchToThreadPool(); - var result = func(state); - if (configureAwait) - { - await UniTask.Yield(); - } - return result; - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Run.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Run.cs.meta deleted file mode 100644 index 9a780ae..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Run.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8473162fc285a5f44bcca90f7da073e7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Threading.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Threading.cs deleted file mode 100644 index 8087e2d..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Threading.cs +++ /dev/null @@ -1,184 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Runtime.CompilerServices; -using System.Threading; -using System.Threading.Tasks; -using UniRx.Async.Internal; - -namespace UniRx.Async -{ - public partial struct UniTask - { -#if !UniRxLibrary - - /// - /// If running on mainthread, do nothing. Otherwise, same as UniTask.Yield(PlayerLoopTiming.Update). - /// - public static SwitchToMainThreadAwaitable SwitchToMainThread() - { - return new SwitchToMainThreadAwaitable(); - } - -#endif - - public static SwitchToThreadPoolAwaitable SwitchToThreadPool() - { - return new SwitchToThreadPoolAwaitable(); - } - - public static SwitchToTaskPoolAwaitable SwitchToTaskPool() - { - return new SwitchToTaskPoolAwaitable(); - } - - public static SwitchToSynchronizationContextAwaitable SwitchToSynchronizationContext(SynchronizationContext syncContext) - { - Error.ThrowArgumentNullException(syncContext, nameof(syncContext)); - return new SwitchToSynchronizationContextAwaitable(syncContext); - } - } - -#if !UniRxLibrary - - public struct SwitchToMainThreadAwaitable - { - public Awaiter GetAwaiter() => new Awaiter(); - - public struct Awaiter : ICriticalNotifyCompletion - { - public bool IsCompleted - { - get - { - var currentThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId; - if (PlayerLoopHelper.MainThreadId == currentThreadId) - { - return true; // run immediate. - } - else - { - return false; // register continuation. - } - } - } - - public void GetResult() { } - - public void OnCompleted(Action continuation) - { - PlayerLoopHelper.AddContinuation(PlayerLoopTiming.Update, continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - PlayerLoopHelper.AddContinuation(PlayerLoopTiming.Update, continuation); - } - } - } - -#endif - - public struct SwitchToThreadPoolAwaitable - { - public Awaiter GetAwaiter() => new Awaiter(); - - public struct Awaiter : ICriticalNotifyCompletion - { - static readonly WaitCallback switchToCallback = Callback; - - public bool IsCompleted => false; - public void GetResult() { } - - public void OnCompleted(Action continuation) - { - ThreadPool.UnsafeQueueUserWorkItem(switchToCallback, continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - ThreadPool.UnsafeQueueUserWorkItem(switchToCallback, continuation); - } - - static void Callback(object state) - { - var continuation = (Action)state; - continuation(); - } - } - } - - public struct SwitchToTaskPoolAwaitable - { - public Awaiter GetAwaiter() => new Awaiter(); - - public struct Awaiter : ICriticalNotifyCompletion - { - static readonly Action switchToCallback = Callback; - - public bool IsCompleted => false; - public void GetResult() { } - - public void OnCompleted(Action continuation) - { - Task.Factory.StartNew(switchToCallback, continuation, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); - } - - public void UnsafeOnCompleted(Action continuation) - { - Task.Factory.StartNew(switchToCallback, continuation, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); - } - - static void Callback(object state) - { - var continuation = (Action)state; - continuation(); - } - } - } - - public struct SwitchToSynchronizationContextAwaitable - { - readonly SynchronizationContext synchronizationContext; - - public SwitchToSynchronizationContextAwaitable(SynchronizationContext synchronizationContext) - { - this.synchronizationContext = synchronizationContext; - } - - public Awaiter GetAwaiter() => new Awaiter(synchronizationContext); - - public struct Awaiter : ICriticalNotifyCompletion - { - static readonly SendOrPostCallback switchToCallback = Callback; - readonly SynchronizationContext synchronizationContext; - - public Awaiter(SynchronizationContext synchronizationContext) - { - this.synchronizationContext = synchronizationContext; - } - - public bool IsCompleted => false; - public void GetResult() { } - - public void OnCompleted(Action continuation) - { - synchronizationContext.Post(switchToCallback, continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - synchronizationContext.Post(switchToCallback, continuation); - } - - static void Callback(object state) - { - var continuation = (Action)state; - continuation(); - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Threading.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTask.Threading.cs.meta deleted file mode 100644 index fa512b8..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.Threading.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4132ea600454134439fa2c7eb931b5e6 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WaitUntil.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WaitUntil.cs deleted file mode 100644 index 7326201..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WaitUntil.cs +++ /dev/null @@ -1,235 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections.Generic; -using System.Threading; -using UniRx.Async.Internal; - -namespace UniRx.Async -{ - public partial struct UniTask - { - public static UniTask WaitUntil(Func predicate, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken)) - { - var promise = new WaitUntilPromise(predicate, timing, cancellationToken); - return promise.Task; - } - - public static UniTask WaitWhile(Func predicate, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken)) - { - var promise = new WaitWhilePromise(predicate, timing, cancellationToken); - return promise.Task; - } - - public static UniTask WaitUntilValueChanged(T target, Func monitorFunction, PlayerLoopTiming monitorTiming = PlayerLoopTiming.Update, IEqualityComparer equalityComparer = null, CancellationToken cancellationToken = default(CancellationToken)) - where T : class - { - var unityObject = target as UnityEngine.Object; - var isUnityObject = !object.ReferenceEquals(target, null); // don't use (unityObject == null) - - return (isUnityObject) - ? new WaitUntilValueChangedUnityObjectPromise(target, monitorFunction, equalityComparer, monitorTiming, cancellationToken).Task - : new WaitUntilValueChangedStandardObjectPromise(target, monitorFunction, equalityComparer, monitorTiming, cancellationToken).Task; - } - - class WaitUntilPromise : PlayerLoopReusablePromiseBase - { - readonly Func predicate; - - public WaitUntilPromise(Func predicate, PlayerLoopTiming timing, CancellationToken cancellationToken) - : base(timing, cancellationToken, 1) - { - this.predicate = predicate; - } - - protected override void OnRunningStart() - { - } - - public override bool MoveNext() - { - if (cancellationToken.IsCancellationRequested) - { - Complete(); - TrySetCanceled(); - return false; - } - - bool result = default(bool); - try - { - result = predicate(); - } - catch (Exception ex) - { - Complete(); - TrySetException(ex); - return false; - } - - if (result) - { - Complete(); - TrySetResult(); - return false; - } - - return true; - } - } - - class WaitWhilePromise : PlayerLoopReusablePromiseBase - { - readonly Func predicate; - - public WaitWhilePromise(Func predicate, PlayerLoopTiming timing, CancellationToken cancellationToken) - : base(timing, cancellationToken, 1) - { - this.predicate = predicate; - } - - protected override void OnRunningStart() - { - } - - public override bool MoveNext() - { - if (cancellationToken.IsCancellationRequested) - { - Complete(); - TrySetCanceled(); - return false; - } - - bool result = default(bool); - try - { - result = predicate(); - } - catch (Exception ex) - { - Complete(); - TrySetException(ex); - return false; - } - - if (!result) - { - Complete(); - TrySetResult(); - return false; - } - - return true; - } - } - - // where T : UnityEngine.Object, can not add constraint - class WaitUntilValueChangedUnityObjectPromise : PlayerLoopReusablePromiseBase - { - readonly T target; - readonly Func monitorFunction; - readonly IEqualityComparer equalityComparer; - U currentValue; - - public WaitUntilValueChangedUnityObjectPromise(T target, Func monitorFunction, IEqualityComparer equalityComparer, PlayerLoopTiming timing, CancellationToken cancellationToken) - : base(timing, cancellationToken, 1) - { - this.target = target; - this.monitorFunction = monitorFunction; - this.equalityComparer = equalityComparer ?? UnityEqualityComparer.GetDefault(); - this.currentValue = monitorFunction(target); - } - - protected override void OnRunningStart() - { - } - - public override bool MoveNext() - { - if (cancellationToken.IsCancellationRequested || target == null) // destroyed = cancel. - { - Complete(); - TrySetCanceled(); - return false; - } - - U nextValue = default(U); - try - { - nextValue = monitorFunction(target); - if (equalityComparer.Equals(currentValue, nextValue)) - { - return true; - } - } - catch (Exception ex) - { - Complete(); - TrySetException(ex); - return false; - } - - Complete(); - currentValue = nextValue; - TrySetResult(nextValue); - return false; - } - } - - class WaitUntilValueChangedStandardObjectPromise : PlayerLoopReusablePromiseBase - where T : class - { - readonly WeakReference target; - readonly Func monitorFunction; - readonly IEqualityComparer equalityComparer; - U currentValue; - - public WaitUntilValueChangedStandardObjectPromise(T target, Func monitorFunction, IEqualityComparer equalityComparer, PlayerLoopTiming timing, CancellationToken cancellationToken) - : base(timing, cancellationToken, 1) - { - this.target = new WeakReference(target, false); // wrap in WeakReference. - this.monitorFunction = monitorFunction; - this.equalityComparer = equalityComparer ?? UnityEqualityComparer.GetDefault(); - this.currentValue = monitorFunction(target); - } - - protected override void OnRunningStart() - { - } - - public override bool MoveNext() - { - if (cancellationToken.IsCancellationRequested || !target.TryGetTarget(out var t)) - { - Complete(); - TrySetCanceled(); - return false; - } - - U nextValue = default(U); - try - { - nextValue = monitorFunction(t); - if (equalityComparer.Equals(currentValue, nextValue)) - { - return true; - } - } - catch (Exception ex) - { - Complete(); - TrySetException(ex); - return false; - } - - Complete(); - currentValue = nextValue; - TrySetResult(nextValue); - return false; - } - } - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WaitUntil.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WaitUntil.cs.meta deleted file mode 100644 index 6e64dc7..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WaitUntil.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 87c9c533491903a4288536b5ac173db8 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.Generated.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.Generated.cs deleted file mode 100644 index bda09db..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.Generated.cs +++ /dev/null @@ -1,1863 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.ExceptionServices; -using System.Threading; - -namespace UniRx.Async -{ - public partial struct UniTask - { - public static async UniTask<(T1 result1, T2 result2)> WhenAll(UniTask task1, UniTask task2) - { - return await new WhenAllPromise(task1, task2); - } - - public static async UniTask<(T1 result1, T2 result2, T3 result3)> WhenAll(UniTask task1, UniTask task2, UniTask task3) - { - return await new WhenAllPromise(task1, task2, task3); - } - - public static async UniTask<(T1 result1, T2 result2, T3 result3, T4 result4)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4) - { - return await new WhenAllPromise(task1, task2, task3, task4); - } - - public static async UniTask<(T1 result1, T2 result2, T3 result3, T4 result4, T5 result5)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5) - { - return await new WhenAllPromise(task1, task2, task3, task4, task5); - } - - public static async UniTask<(T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6) - { - return await new WhenAllPromise(task1, task2, task3, task4, task5, task6); - } - - public static async UniTask<(T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7) - { - return await new WhenAllPromise(task1, task2, task3, task4, task5, task6, task7); - } - - class WhenAllPromise - { - const int MaxCount = 2; - - T1 result1; - T2 result2; - ExceptionDispatchInfo exception; - int completeCount; - Action whenComplete; - - public WhenAllPromise(UniTask task1, UniTask task2) - { - this.completeCount = 0; - this.whenComplete = null; - this.result1 = default(T1); - this.result2 = default(T2); - this.exception = null; - - RunTask1(task1); - RunTask2(task2); - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - void RunTask1(UniTask task) - { - if (task.IsCompleted) - { - try - { - result1 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask1Async(task).Forget(); - } - } - - async UniTaskVoid RunTask1Async(UniTask task) - { - try - { - result1 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask2(UniTask task) - { - if (task.IsCompleted) - { - try - { - result2 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask2Async(task).Forget(); - } - } - - async UniTaskVoid RunTask2Async(UniTask task) - { - try - { - result2 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAllPromise parent; - - public Awaiter(WhenAllPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.exception != null || parent.completeCount == MaxCount; - } - } - - public (T1, T2) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - return (parent.result1, parent.result2); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - class WhenAllPromise - { - const int MaxCount = 3; - - T1 result1; - T2 result2; - T3 result3; - ExceptionDispatchInfo exception; - int completeCount; - Action whenComplete; - - public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3) - { - this.completeCount = 0; - this.whenComplete = null; - this.result1 = default(T1); - this.result2 = default(T2); - this.result3 = default(T3); - this.exception = null; - - RunTask1(task1); - RunTask2(task2); - RunTask3(task3); - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - void RunTask1(UniTask task) - { - if (task.IsCompleted) - { - try - { - result1 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask1Async(task).Forget(); - } - } - - async UniTaskVoid RunTask1Async(UniTask task) - { - try - { - result1 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask2(UniTask task) - { - if (task.IsCompleted) - { - try - { - result2 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask2Async(task).Forget(); - } - } - - async UniTaskVoid RunTask2Async(UniTask task) - { - try - { - result2 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask3(UniTask task) - { - if (task.IsCompleted) - { - try - { - result3 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask3Async(task).Forget(); - } - } - - async UniTaskVoid RunTask3Async(UniTask task) - { - try - { - result3 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAllPromise parent; - - public Awaiter(WhenAllPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.exception != null || parent.completeCount == MaxCount; - } - } - - public (T1, T2, T3) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - return (parent.result1, parent.result2, parent.result3); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - class WhenAllPromise - { - const int MaxCount = 4; - - T1 result1; - T2 result2; - T3 result3; - T4 result4; - ExceptionDispatchInfo exception; - int completeCount; - Action whenComplete; - - public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4) - { - this.completeCount = 0; - this.whenComplete = null; - this.result1 = default(T1); - this.result2 = default(T2); - this.result3 = default(T3); - this.result4 = default(T4); - this.exception = null; - - RunTask1(task1); - RunTask2(task2); - RunTask3(task3); - RunTask4(task4); - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - void RunTask1(UniTask task) - { - if (task.IsCompleted) - { - try - { - result1 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask1Async(task).Forget(); - } - } - - async UniTaskVoid RunTask1Async(UniTask task) - { - try - { - result1 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask2(UniTask task) - { - if (task.IsCompleted) - { - try - { - result2 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask2Async(task).Forget(); - } - } - - async UniTaskVoid RunTask2Async(UniTask task) - { - try - { - result2 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask3(UniTask task) - { - if (task.IsCompleted) - { - try - { - result3 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask3Async(task).Forget(); - } - } - - async UniTaskVoid RunTask3Async(UniTask task) - { - try - { - result3 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask4(UniTask task) - { - if (task.IsCompleted) - { - try - { - result4 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask4Async(task).Forget(); - } - } - - async UniTaskVoid RunTask4Async(UniTask task) - { - try - { - result4 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAllPromise parent; - - public Awaiter(WhenAllPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.exception != null || parent.completeCount == MaxCount; - } - } - - public (T1, T2, T3, T4) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - return (parent.result1, parent.result2, parent.result3, parent.result4); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - class WhenAllPromise - { - const int MaxCount = 5; - - T1 result1; - T2 result2; - T3 result3; - T4 result4; - T5 result5; - ExceptionDispatchInfo exception; - int completeCount; - Action whenComplete; - - public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5) - { - this.completeCount = 0; - this.whenComplete = null; - this.result1 = default(T1); - this.result2 = default(T2); - this.result3 = default(T3); - this.result4 = default(T4); - this.result5 = default(T5); - this.exception = null; - - RunTask1(task1); - RunTask2(task2); - RunTask3(task3); - RunTask4(task4); - RunTask5(task5); - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - void RunTask1(UniTask task) - { - if (task.IsCompleted) - { - try - { - result1 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask1Async(task).Forget(); - } - } - - async UniTaskVoid RunTask1Async(UniTask task) - { - try - { - result1 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask2(UniTask task) - { - if (task.IsCompleted) - { - try - { - result2 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask2Async(task).Forget(); - } - } - - async UniTaskVoid RunTask2Async(UniTask task) - { - try - { - result2 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask3(UniTask task) - { - if (task.IsCompleted) - { - try - { - result3 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask3Async(task).Forget(); - } - } - - async UniTaskVoid RunTask3Async(UniTask task) - { - try - { - result3 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask4(UniTask task) - { - if (task.IsCompleted) - { - try - { - result4 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask4Async(task).Forget(); - } - } - - async UniTaskVoid RunTask4Async(UniTask task) - { - try - { - result4 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask5(UniTask task) - { - if (task.IsCompleted) - { - try - { - result5 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask5Async(task).Forget(); - } - } - - async UniTaskVoid RunTask5Async(UniTask task) - { - try - { - result5 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAllPromise parent; - - public Awaiter(WhenAllPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.exception != null || parent.completeCount == MaxCount; - } - } - - public (T1, T2, T3, T4, T5) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - return (parent.result1, parent.result2, parent.result3, parent.result4, parent.result5); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - class WhenAllPromise - { - const int MaxCount = 6; - - T1 result1; - T2 result2; - T3 result3; - T4 result4; - T5 result5; - T6 result6; - ExceptionDispatchInfo exception; - int completeCount; - Action whenComplete; - - public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6) - { - this.completeCount = 0; - this.whenComplete = null; - this.result1 = default(T1); - this.result2 = default(T2); - this.result3 = default(T3); - this.result4 = default(T4); - this.result5 = default(T5); - this.result6 = default(T6); - this.exception = null; - - RunTask1(task1); - RunTask2(task2); - RunTask3(task3); - RunTask4(task4); - RunTask5(task5); - RunTask6(task6); - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - void RunTask1(UniTask task) - { - if (task.IsCompleted) - { - try - { - result1 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask1Async(task).Forget(); - } - } - - async UniTaskVoid RunTask1Async(UniTask task) - { - try - { - result1 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask2(UniTask task) - { - if (task.IsCompleted) - { - try - { - result2 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask2Async(task).Forget(); - } - } - - async UniTaskVoid RunTask2Async(UniTask task) - { - try - { - result2 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask3(UniTask task) - { - if (task.IsCompleted) - { - try - { - result3 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask3Async(task).Forget(); - } - } - - async UniTaskVoid RunTask3Async(UniTask task) - { - try - { - result3 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask4(UniTask task) - { - if (task.IsCompleted) - { - try - { - result4 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask4Async(task).Forget(); - } - } - - async UniTaskVoid RunTask4Async(UniTask task) - { - try - { - result4 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask5(UniTask task) - { - if (task.IsCompleted) - { - try - { - result5 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask5Async(task).Forget(); - } - } - - async UniTaskVoid RunTask5Async(UniTask task) - { - try - { - result5 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask6(UniTask task) - { - if (task.IsCompleted) - { - try - { - result6 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask6Async(task).Forget(); - } - } - - async UniTaskVoid RunTask6Async(UniTask task) - { - try - { - result6 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAllPromise parent; - - public Awaiter(WhenAllPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.exception != null || parent.completeCount == MaxCount; - } - } - - public (T1, T2, T3, T4, T5, T6) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - return (parent.result1, parent.result2, parent.result3, parent.result4, parent.result5, parent.result6); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - class WhenAllPromise - { - const int MaxCount = 7; - - T1 result1; - T2 result2; - T3 result3; - T4 result4; - T5 result5; - T6 result6; - T7 result7; - ExceptionDispatchInfo exception; - int completeCount; - Action whenComplete; - - public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7) - { - this.completeCount = 0; - this.whenComplete = null; - this.result1 = default(T1); - this.result2 = default(T2); - this.result3 = default(T3); - this.result4 = default(T4); - this.result5 = default(T5); - this.result6 = default(T6); - this.result7 = default(T7); - this.exception = null; - - RunTask1(task1); - RunTask2(task2); - RunTask3(task3); - RunTask4(task4); - RunTask5(task5); - RunTask6(task6); - RunTask7(task7); - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - void RunTask1(UniTask task) - { - if (task.IsCompleted) - { - try - { - result1 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask1Async(task).Forget(); - } - } - - async UniTaskVoid RunTask1Async(UniTask task) - { - try - { - result1 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask2(UniTask task) - { - if (task.IsCompleted) - { - try - { - result2 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask2Async(task).Forget(); - } - } - - async UniTaskVoid RunTask2Async(UniTask task) - { - try - { - result2 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask3(UniTask task) - { - if (task.IsCompleted) - { - try - { - result3 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask3Async(task).Forget(); - } - } - - async UniTaskVoid RunTask3Async(UniTask task) - { - try - { - result3 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask4(UniTask task) - { - if (task.IsCompleted) - { - try - { - result4 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask4Async(task).Forget(); - } - } - - async UniTaskVoid RunTask4Async(UniTask task) - { - try - { - result4 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask5(UniTask task) - { - if (task.IsCompleted) - { - try - { - result5 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask5Async(task).Forget(); - } - } - - async UniTaskVoid RunTask5Async(UniTask task) - { - try - { - result5 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask6(UniTask task) - { - if (task.IsCompleted) - { - try - { - result6 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask6Async(task).Forget(); - } - } - - async UniTaskVoid RunTask6Async(UniTask task) - { - try - { - result6 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - void RunTask7(UniTask task) - { - if (task.IsCompleted) - { - try - { - result7 = task.Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - else - { - RunTask7Async(task).Forget(); - } - } - - async UniTaskVoid RunTask7Async(UniTask task) - { - try - { - result7 = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == MaxCount) - { - TryCallContinuation(); - } - } - - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAllPromise parent; - - public Awaiter(WhenAllPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.exception != null || parent.completeCount == MaxCount; - } - } - - public (T1, T2, T3, T4, T5, T6, T7) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - return (parent.result1, parent.result2, parent.result3, parent.result4, parent.result5, parent.result6, parent.result7); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.Generated.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.Generated.cs.meta deleted file mode 100644 index 40ed46c..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.Generated.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5110117231c8a6d4095fd0cbd3f4c142 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.cs deleted file mode 100644 index 715e55b..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.cs +++ /dev/null @@ -1,298 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Runtime.ExceptionServices; -using System.Threading; -using UniRx.Async.Internal; - -namespace UniRx.Async -{ - public partial struct UniTask - { - // UniTask - - public static async UniTask WhenAll(params UniTask[] tasks) - { - return await new WhenAllPromise(tasks, tasks.Length); - } - - public static async UniTask WhenAll(IEnumerable> tasks) - { - WhenAllPromise promise; - using (var span = ArrayPoolUtil.Materialize(tasks)) - { - promise = new WhenAllPromise(span.Array, span.Length); - } - - return await promise; - } - - public static async UniTask WhenAll(params UniTask[] tasks) - { - await new WhenAllPromise(tasks, tasks.Length); - } - - public static async UniTask WhenAll(IEnumerable tasks) - { - WhenAllPromise promise; - using (var span = ArrayPoolUtil.Materialize(tasks)) - { - promise = new WhenAllPromise(span.Array, span.Length); - } - - await promise; - } - - class WhenAllPromise - { - readonly T[] result; - int completeCount; - Action whenComplete; - ExceptionDispatchInfo exception; - - public WhenAllPromise(UniTask[] tasks, int tasksLength) - { - this.completeCount = 0; - this.whenComplete = null; - this.exception = null; - this.result = new T[tasksLength]; - - for (int i = 0; i < tasksLength; i++) - { - if (tasks[i].IsCompleted) - { - T value = default(T); - try - { - value = tasks[i].Result; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - continue; - } - - result[i] = value; - var count = Interlocked.Increment(ref completeCount); - if (count == result.Length) - { - TryCallContinuation(); - } - } - else - { - RunTask(tasks[i], i).Forget(); - } - } - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - async UniTaskVoid RunTask(UniTask task, int index) - { - T value = default(T); - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - result[index] = value; - var count = Interlocked.Increment(ref completeCount); - if (count == result.Length) - { - TryCallContinuation(); - } - } - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAllPromise parent; - - public Awaiter(WhenAllPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.exception != null || parent.result.Length == parent.completeCount; - } - } - - public T[] GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - return parent.result; - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - class WhenAllPromise - { - int completeCount; - int resultLength; - Action whenComplete; - ExceptionDispatchInfo exception; - - public WhenAllPromise(UniTask[] tasks, int tasksLength) - { - this.completeCount = 0; - this.whenComplete = null; - this.exception = null; - this.resultLength = tasksLength; - - for (int i = 0; i < tasksLength; i++) - { - if (tasks[i].IsCompleted) - { - try - { - tasks[i].GetResult(); - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - continue; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == resultLength) - { - TryCallContinuation(); - } - } - else - { - RunTask(tasks[i], i).Forget(); - } - } - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - async UniTaskVoid RunTask(UniTask task, int index) - { - try - { - await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == resultLength) - { - TryCallContinuation(); - } - } - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAllPromise parent; - - public Awaiter(WhenAllPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.exception != null || parent.resultLength == parent.completeCount; - } - } - - public void GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.cs.meta deleted file mode 100644 index 0366aa8..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAll.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 355997a305ba64248822eec34998a1a0 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.Generated.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.Generated.cs deleted file mode 100644 index ebc0fe2..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.Generated.cs +++ /dev/null @@ -1,1527 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.ExceptionServices; -using System.Threading; - -namespace UniRx.Async -{ - public partial struct UniTask - { - public static async UniTask<(int winArgumentIndex, (bool hasResult, T0 result0), (bool hasResult, T1 result1))> WhenAny(UniTask task0, UniTask task1) - { - return await new WhenAnyPromise(task0, task1); - } - - public static async UniTask<(int winArgumentIndex, (bool hasResult, T0 result0), (bool hasResult, T1 result1), (bool hasResult, T2 result2))> WhenAny(UniTask task0, UniTask task1, UniTask task2) - { - return await new WhenAnyPromise(task0, task1, task2); - } - - public static async UniTask<(int winArgumentIndex, (bool hasResult, T0 result0), (bool hasResult, T1 result1), (bool hasResult, T2 result2), (bool hasResult, T3 result3))> WhenAny(UniTask task0, UniTask task1, UniTask task2, UniTask task3) - { - return await new WhenAnyPromise(task0, task1, task2, task3); - } - - public static async UniTask<(int winArgumentIndex, (bool hasResult, T0 result0), (bool hasResult, T1 result1), (bool hasResult, T2 result2), (bool hasResult, T3 result3), (bool hasResult, T4 result4))> WhenAny(UniTask task0, UniTask task1, UniTask task2, UniTask task3, UniTask task4) - { - return await new WhenAnyPromise(task0, task1, task2, task3, task4); - } - - public static async UniTask<(int winArgumentIndex, (bool hasResult, T0 result0), (bool hasResult, T1 result1), (bool hasResult, T2 result2), (bool hasResult, T3 result3), (bool hasResult, T4 result4), (bool hasResult, T5 result5))> WhenAny(UniTask task0, UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5) - { - return await new WhenAnyPromise(task0, task1, task2, task3, task4, task5); - } - - public static async UniTask<(int winArgumentIndex, (bool hasResult, T0 result0), (bool hasResult, T1 result1), (bool hasResult, T2 result2), (bool hasResult, T3 result3), (bool hasResult, T4 result4), (bool hasResult, T5 result5), (bool hasResult, T6 result6))> WhenAny(UniTask task0, UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6) - { - return await new WhenAnyPromise(task0, task1, task2, task3, task4, task5, task6); - } - - public static async UniTask<(int winArgumentIndex, (bool hasResult, T0 result0), (bool hasResult, T1 result1), (bool hasResult, T2 result2), (bool hasResult, T3 result3), (bool hasResult, T4 result4), (bool hasResult, T5 result5), (bool hasResult, T6 result6), (bool hasResult, T7 result7))> WhenAny(UniTask task0, UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7) - { - return await new WhenAnyPromise(task0, task1, task2, task3, task4, task5, task6, task7); - } - - class WhenAnyPromise - { - T0 result0; - T1 result1; - ExceptionDispatchInfo exception; - Action whenComplete; - int completeCount; - int winArgumentIndex; - - bool IsCompleted => exception != null || Volatile.Read(ref winArgumentIndex) != -1; - - public WhenAnyPromise(UniTask task0, UniTask task1) - { - this.whenComplete = null; - this.exception = null; - this.completeCount = 0; - this.winArgumentIndex = -1; - this.result0 = default(T0); - this.result1 = default(T1); - - RunTask0(task0).Forget(); - RunTask1(task1).Forget(); - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - async UniTaskVoid RunTask0(UniTask task) - { - T0 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result0 = value; - Volatile.Write(ref winArgumentIndex, 0); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask1(UniTask task) - { - T1 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result1 = value; - Volatile.Write(ref winArgumentIndex, 1); - TryCallContinuation(); - } - } - - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAnyPromise parent; - - public Awaiter(WhenAnyPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.IsCompleted; - } - } - - public (int, (bool, T0), (bool, T1)) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - var i = parent.winArgumentIndex; - return (i, (i == 0, parent.result0), (i == 1, parent.result1)); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - class WhenAnyPromise - { - T0 result0; - T1 result1; - T2 result2; - ExceptionDispatchInfo exception; - Action whenComplete; - int completeCount; - int winArgumentIndex; - - bool IsCompleted => exception != null || Volatile.Read(ref winArgumentIndex) != -1; - - public WhenAnyPromise(UniTask task0, UniTask task1, UniTask task2) - { - this.whenComplete = null; - this.exception = null; - this.completeCount = 0; - this.winArgumentIndex = -1; - this.result0 = default(T0); - this.result1 = default(T1); - this.result2 = default(T2); - - RunTask0(task0).Forget(); - RunTask1(task1).Forget(); - RunTask2(task2).Forget(); - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - async UniTaskVoid RunTask0(UniTask task) - { - T0 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result0 = value; - Volatile.Write(ref winArgumentIndex, 0); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask1(UniTask task) - { - T1 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result1 = value; - Volatile.Write(ref winArgumentIndex, 1); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask2(UniTask task) - { - T2 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result2 = value; - Volatile.Write(ref winArgumentIndex, 2); - TryCallContinuation(); - } - } - - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAnyPromise parent; - - public Awaiter(WhenAnyPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.IsCompleted; - } - } - - public (int, (bool, T0), (bool, T1), (bool, T2)) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - var i = parent.winArgumentIndex; - return (i, (i == 0, parent.result0), (i == 1, parent.result1), (i == 2, parent.result2)); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - class WhenAnyPromise - { - T0 result0; - T1 result1; - T2 result2; - T3 result3; - ExceptionDispatchInfo exception; - Action whenComplete; - int completeCount; - int winArgumentIndex; - - bool IsCompleted => exception != null || Volatile.Read(ref winArgumentIndex) != -1; - - public WhenAnyPromise(UniTask task0, UniTask task1, UniTask task2, UniTask task3) - { - this.whenComplete = null; - this.exception = null; - this.completeCount = 0; - this.winArgumentIndex = -1; - this.result0 = default(T0); - this.result1 = default(T1); - this.result2 = default(T2); - this.result3 = default(T3); - - RunTask0(task0).Forget(); - RunTask1(task1).Forget(); - RunTask2(task2).Forget(); - RunTask3(task3).Forget(); - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - async UniTaskVoid RunTask0(UniTask task) - { - T0 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result0 = value; - Volatile.Write(ref winArgumentIndex, 0); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask1(UniTask task) - { - T1 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result1 = value; - Volatile.Write(ref winArgumentIndex, 1); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask2(UniTask task) - { - T2 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result2 = value; - Volatile.Write(ref winArgumentIndex, 2); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask3(UniTask task) - { - T3 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result3 = value; - Volatile.Write(ref winArgumentIndex, 3); - TryCallContinuation(); - } - } - - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAnyPromise parent; - - public Awaiter(WhenAnyPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.IsCompleted; - } - } - - public (int, (bool, T0), (bool, T1), (bool, T2), (bool, T3)) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - var i = parent.winArgumentIndex; - return (i, (i == 0, parent.result0), (i == 1, parent.result1), (i == 2, parent.result2), (i == 3, parent.result3)); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - class WhenAnyPromise - { - T0 result0; - T1 result1; - T2 result2; - T3 result3; - T4 result4; - ExceptionDispatchInfo exception; - Action whenComplete; - int completeCount; - int winArgumentIndex; - - bool IsCompleted => exception != null || Volatile.Read(ref winArgumentIndex) != -1; - - public WhenAnyPromise(UniTask task0, UniTask task1, UniTask task2, UniTask task3, UniTask task4) - { - this.whenComplete = null; - this.exception = null; - this.completeCount = 0; - this.winArgumentIndex = -1; - this.result0 = default(T0); - this.result1 = default(T1); - this.result2 = default(T2); - this.result3 = default(T3); - this.result4 = default(T4); - - RunTask0(task0).Forget(); - RunTask1(task1).Forget(); - RunTask2(task2).Forget(); - RunTask3(task3).Forget(); - RunTask4(task4).Forget(); - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - async UniTaskVoid RunTask0(UniTask task) - { - T0 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result0 = value; - Volatile.Write(ref winArgumentIndex, 0); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask1(UniTask task) - { - T1 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result1 = value; - Volatile.Write(ref winArgumentIndex, 1); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask2(UniTask task) - { - T2 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result2 = value; - Volatile.Write(ref winArgumentIndex, 2); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask3(UniTask task) - { - T3 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result3 = value; - Volatile.Write(ref winArgumentIndex, 3); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask4(UniTask task) - { - T4 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result4 = value; - Volatile.Write(ref winArgumentIndex, 4); - TryCallContinuation(); - } - } - - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAnyPromise parent; - - public Awaiter(WhenAnyPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.IsCompleted; - } - } - - public (int, (bool, T0), (bool, T1), (bool, T2), (bool, T3), (bool, T4)) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - var i = parent.winArgumentIndex; - return (i, (i == 0, parent.result0), (i == 1, parent.result1), (i == 2, parent.result2), (i == 3, parent.result3), (i == 4, parent.result4)); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - class WhenAnyPromise - { - T0 result0; - T1 result1; - T2 result2; - T3 result3; - T4 result4; - T5 result5; - ExceptionDispatchInfo exception; - Action whenComplete; - int completeCount; - int winArgumentIndex; - - bool IsCompleted => exception != null || Volatile.Read(ref winArgumentIndex) != -1; - - public WhenAnyPromise(UniTask task0, UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5) - { - this.whenComplete = null; - this.exception = null; - this.completeCount = 0; - this.winArgumentIndex = -1; - this.result0 = default(T0); - this.result1 = default(T1); - this.result2 = default(T2); - this.result3 = default(T3); - this.result4 = default(T4); - this.result5 = default(T5); - - RunTask0(task0).Forget(); - RunTask1(task1).Forget(); - RunTask2(task2).Forget(); - RunTask3(task3).Forget(); - RunTask4(task4).Forget(); - RunTask5(task5).Forget(); - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - async UniTaskVoid RunTask0(UniTask task) - { - T0 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result0 = value; - Volatile.Write(ref winArgumentIndex, 0); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask1(UniTask task) - { - T1 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result1 = value; - Volatile.Write(ref winArgumentIndex, 1); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask2(UniTask task) - { - T2 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result2 = value; - Volatile.Write(ref winArgumentIndex, 2); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask3(UniTask task) - { - T3 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result3 = value; - Volatile.Write(ref winArgumentIndex, 3); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask4(UniTask task) - { - T4 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result4 = value; - Volatile.Write(ref winArgumentIndex, 4); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask5(UniTask task) - { - T5 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result5 = value; - Volatile.Write(ref winArgumentIndex, 5); - TryCallContinuation(); - } - } - - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAnyPromise parent; - - public Awaiter(WhenAnyPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.IsCompleted; - } - } - - public (int, (bool, T0), (bool, T1), (bool, T2), (bool, T3), (bool, T4), (bool, T5)) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - var i = parent.winArgumentIndex; - return (i, (i == 0, parent.result0), (i == 1, parent.result1), (i == 2, parent.result2), (i == 3, parent.result3), (i == 4, parent.result4), (i == 5, parent.result5)); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - class WhenAnyPromise - { - T0 result0; - T1 result1; - T2 result2; - T3 result3; - T4 result4; - T5 result5; - T6 result6; - ExceptionDispatchInfo exception; - Action whenComplete; - int completeCount; - int winArgumentIndex; - - bool IsCompleted => exception != null || Volatile.Read(ref winArgumentIndex) != -1; - - public WhenAnyPromise(UniTask task0, UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6) - { - this.whenComplete = null; - this.exception = null; - this.completeCount = 0; - this.winArgumentIndex = -1; - this.result0 = default(T0); - this.result1 = default(T1); - this.result2 = default(T2); - this.result3 = default(T3); - this.result4 = default(T4); - this.result5 = default(T5); - this.result6 = default(T6); - - RunTask0(task0).Forget(); - RunTask1(task1).Forget(); - RunTask2(task2).Forget(); - RunTask3(task3).Forget(); - RunTask4(task4).Forget(); - RunTask5(task5).Forget(); - RunTask6(task6).Forget(); - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - async UniTaskVoid RunTask0(UniTask task) - { - T0 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result0 = value; - Volatile.Write(ref winArgumentIndex, 0); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask1(UniTask task) - { - T1 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result1 = value; - Volatile.Write(ref winArgumentIndex, 1); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask2(UniTask task) - { - T2 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result2 = value; - Volatile.Write(ref winArgumentIndex, 2); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask3(UniTask task) - { - T3 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result3 = value; - Volatile.Write(ref winArgumentIndex, 3); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask4(UniTask task) - { - T4 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result4 = value; - Volatile.Write(ref winArgumentIndex, 4); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask5(UniTask task) - { - T5 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result5 = value; - Volatile.Write(ref winArgumentIndex, 5); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask6(UniTask task) - { - T6 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result6 = value; - Volatile.Write(ref winArgumentIndex, 6); - TryCallContinuation(); - } - } - - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAnyPromise parent; - - public Awaiter(WhenAnyPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.IsCompleted; - } - } - - public (int, (bool, T0), (bool, T1), (bool, T2), (bool, T3), (bool, T4), (bool, T5), (bool, T6)) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - var i = parent.winArgumentIndex; - return (i, (i == 0, parent.result0), (i == 1, parent.result1), (i == 2, parent.result2), (i == 3, parent.result3), (i == 4, parent.result4), (i == 5, parent.result5), (i == 6, parent.result6)); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - class WhenAnyPromise - { - T0 result0; - T1 result1; - T2 result2; - T3 result3; - T4 result4; - T5 result5; - T6 result6; - T7 result7; - ExceptionDispatchInfo exception; - Action whenComplete; - int completeCount; - int winArgumentIndex; - - bool IsCompleted => exception != null || Volatile.Read(ref winArgumentIndex) != -1; - - public WhenAnyPromise(UniTask task0, UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7) - { - this.whenComplete = null; - this.exception = null; - this.completeCount = 0; - this.winArgumentIndex = -1; - this.result0 = default(T0); - this.result1 = default(T1); - this.result2 = default(T2); - this.result3 = default(T3); - this.result4 = default(T4); - this.result5 = default(T5); - this.result6 = default(T6); - this.result7 = default(T7); - - RunTask0(task0).Forget(); - RunTask1(task1).Forget(); - RunTask2(task2).Forget(); - RunTask3(task3).Forget(); - RunTask4(task4).Forget(); - RunTask5(task5).Forget(); - RunTask6(task6).Forget(); - RunTask7(task7).Forget(); - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - async UniTaskVoid RunTask0(UniTask task) - { - T0 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result0 = value; - Volatile.Write(ref winArgumentIndex, 0); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask1(UniTask task) - { - T1 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result1 = value; - Volatile.Write(ref winArgumentIndex, 1); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask2(UniTask task) - { - T2 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result2 = value; - Volatile.Write(ref winArgumentIndex, 2); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask3(UniTask task) - { - T3 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result3 = value; - Volatile.Write(ref winArgumentIndex, 3); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask4(UniTask task) - { - T4 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result4 = value; - Volatile.Write(ref winArgumentIndex, 4); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask5(UniTask task) - { - T5 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result5 = value; - Volatile.Write(ref winArgumentIndex, 5); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask6(UniTask task) - { - T6 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result6 = value; - Volatile.Write(ref winArgumentIndex, 6); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask7(UniTask task) - { - T7 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result7 = value; - Volatile.Write(ref winArgumentIndex, 7); - TryCallContinuation(); - } - } - - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAnyPromise parent; - - public Awaiter(WhenAnyPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.IsCompleted; - } - } - - public (int, (bool, T0), (bool, T1), (bool, T2), (bool, T3), (bool, T4), (bool, T5), (bool, T6), (bool, T7)) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - var i = parent.winArgumentIndex; - return (i, (i == 0, parent.result0), (i == 1, parent.result1), (i == 2, parent.result2), (i == 3, parent.result3), (i == 4, parent.result4), (i == 5, parent.result5), (i == 6, parent.result6), (i == 7, parent.result7)); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.Generated.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.Generated.cs.meta deleted file mode 100644 index 49a2c3f..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.Generated.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 13d604ac281570c4eac9962429f19ca9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.cs deleted file mode 100644 index 2c5049b..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.cs +++ /dev/null @@ -1,374 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.ExceptionServices; -using System.Threading; - -namespace UniRx.Async -{ - public partial struct UniTask - { - // UniTask - - public static async UniTask<(bool hasResultLeft, T0 result)> WhenAny(UniTask task0, UniTask task1) - { - return await new UnitWhenAnyPromise(task0, task1); - } - - public static async UniTask<(int winArgumentIndex, T result)> WhenAny(params UniTask[] tasks) - { - return await new WhenAnyPromise(tasks); - } - - /// Return value is winArgumentIndex - public static async UniTask WhenAny(params UniTask[] tasks) - { - return await new WhenAnyPromise(tasks); - } - - class UnitWhenAnyPromise - { - T0 result0; - ExceptionDispatchInfo exception; - Action whenComplete; - int completeCount; - int winArgumentIndex; - - bool IsCompleted => exception != null || Volatile.Read(ref winArgumentIndex) != -1; - - public UnitWhenAnyPromise(UniTask task0, UniTask task1) - { - this.whenComplete = null; - this.exception = null; - this.completeCount = 0; - this.winArgumentIndex = -1; - this.result0 = default(T0); - - RunTask0(task0).Forget(); - RunTask1(task1).Forget(); - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - async UniTaskVoid RunTask0(UniTask task) - { - T0 value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result0 = value; - Volatile.Write(ref winArgumentIndex, 0); - TryCallContinuation(); - } - } - - async UniTaskVoid RunTask1(UniTask task) - { - try - { - await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - Volatile.Write(ref winArgumentIndex, 1); - TryCallContinuation(); - } - } - - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - UnitWhenAnyPromise parent; - - public Awaiter(UnitWhenAnyPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.IsCompleted; - } - } - - public (bool, T0) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - return (parent.winArgumentIndex == 0, parent.result0); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - - class WhenAnyPromise - { - T result; - int completeCount; - int winArgumentIndex; - Action whenComplete; - ExceptionDispatchInfo exception; - - public bool IsComplete => exception != null || Volatile.Read(ref winArgumentIndex) != -1; - - public WhenAnyPromise(UniTask[] tasks) - { - this.completeCount = 0; - this.winArgumentIndex = -1; - this.whenComplete = null; - this.exception = null; - this.result = default(T); - - for (int i = 0; i < tasks.Length; i++) - { - RunTask(tasks[i], i).Forget(); - } - } - - async UniTaskVoid RunTask(UniTask task, int index) - { - T value; - try - { - value = await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - result = value; - Volatile.Write(ref winArgumentIndex, index); - TryCallContinuation(); - } - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAnyPromise parent; - - public Awaiter(WhenAnyPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.IsComplete; - } - } - - public (int, T) GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - return (parent.winArgumentIndex, parent.result); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - - class WhenAnyPromise - { - int completeCount; - int winArgumentIndex; - Action whenComplete; - ExceptionDispatchInfo exception; - - public bool IsComplete => exception != null || Volatile.Read(ref winArgumentIndex) != -1; - - public WhenAnyPromise(UniTask[] tasks) - { - this.completeCount = 0; - this.winArgumentIndex = -1; - this.whenComplete = null; - this.exception = null; - - for (int i = 0; i < tasks.Length; i++) - { - RunTask(tasks[i], i).Forget(); - } - } - - async UniTaskVoid RunTask(UniTask task, int index) - { - try - { - await task; - } - catch (Exception ex) - { - exception = ExceptionDispatchInfo.Capture(ex); - TryCallContinuation(); - return; - } - - var count = Interlocked.Increment(ref completeCount); - if (count == 1) - { - Volatile.Write(ref winArgumentIndex, index); - TryCallContinuation(); - } - } - - void TryCallContinuation() - { - var action = Interlocked.Exchange(ref whenComplete, null); - if (action != null) - { - action.Invoke(); - } - } - - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - WhenAnyPromise parent; - - public Awaiter(WhenAnyPromise parent) - { - this.parent = parent; - } - - public bool IsCompleted - { - get - { - return parent.IsComplete; - } - } - - public int GetResult() - { - if (parent.exception != null) - { - parent.exception.Throw(); - } - - return parent.winArgumentIndex; - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - parent.whenComplete = continuation; - if (IsCompleted) - { - var action = Interlocked.Exchange(ref parent.whenComplete, null); - if (action != null) - { - action(); - } - } - } - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.cs.meta deleted file mode 100644 index c10f762..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.WhenAny.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c32578978c37eaf41bdd90e1b034637d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTask.cs deleted file mode 100644 index 25c533d..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.cs +++ /dev/null @@ -1,479 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Runtime.CompilerServices; -using UniRx.Async.CompilerServices; -using UniRx.Async.Internal; - -namespace UniRx.Async -{ - /// - /// Lightweight unity specified task-like object. - /// - [AsyncMethodBuilder(typeof(AsyncUniTaskMethodBuilder))] - public partial struct UniTask : IEquatable - { - static readonly UniTask DefaultAsyncUnitTask = new UniTask(AsyncUnit.Default); - - readonly IAwaiter awaiter; - - [DebuggerHidden] - public UniTask(IAwaiter awaiter) - { - this.awaiter = awaiter; - } - - [DebuggerHidden] - public UniTask(Func factory) - { - this.awaiter = new LazyPromise(factory); - } - - [DebuggerHidden] - public AwaiterStatus Status - { - get - { - return awaiter == null ? AwaiterStatus.Succeeded : awaiter.Status; - } - } - - [DebuggerHidden] - public bool IsCompleted - { - get - { - return awaiter == null ? true : awaiter.IsCompleted; - } - } - - [DebuggerHidden] - public void GetResult() - { - if (awaiter != null) - { - awaiter.GetResult(); - } - } - - [DebuggerHidden] - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - /// - /// returns (bool IsCanceled) instead of throws OperationCanceledException. - /// - public UniTask SuppressCancellationThrow() - { - var status = Status; - if (status == AwaiterStatus.Succeeded) return CompletedTasks.False; - if (status == AwaiterStatus.Canceled) return CompletedTasks.True; - return new UniTask(new IsCanceledAwaiter(awaiter)); - } - - public bool Equals(UniTask other) - { - if (this.awaiter == null && other.awaiter == null) - { - return true; - } - else if (this.awaiter != null && other.awaiter != null) - { - return this.awaiter == other.awaiter; - } - else - { - return false; - } - } - - public override int GetHashCode() - { - if (this.awaiter == null) - { - return 0; - } - else - { - return this.awaiter.GetHashCode(); - } - } - - public override string ToString() - { - return (this.awaiter == null) ? "()" - : (this.awaiter.Status == AwaiterStatus.Succeeded) ? "()" - : "(" + this.awaiter.Status + ")"; - } - - public static implicit operator UniTask(UniTask task) - { - if (task.awaiter != null) - { - if (task.awaiter.IsCompleted) - { - return DefaultAsyncUnitTask; - } - else - { - // UniTask -> UniTask is free but UniTask -> UniTask requires wrapping cost. - return new UniTask(new AsyncUnitAwaiter(task.awaiter)); - } - } - else - { - return DefaultAsyncUnitTask; - } - } - - class AsyncUnitAwaiter : IAwaiter - { - readonly IAwaiter awaiter; - - public AsyncUnitAwaiter(IAwaiter awaiter) - { - this.awaiter = awaiter; - } - - public bool IsCompleted => awaiter.IsCompleted; - - public AwaiterStatus Status => awaiter.Status; - - public AsyncUnit GetResult() - { - awaiter.GetResult(); - return AsyncUnit.Default; - } - - public void OnCompleted(Action continuation) - { - awaiter.OnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - awaiter.UnsafeOnCompleted(continuation); - } - - void IAwaiter.GetResult() - { - awaiter.GetResult(); - } - } - - class IsCanceledAwaiter : IAwaiter - { - readonly IAwaiter awaiter; - - public IsCanceledAwaiter(IAwaiter awaiter) - { - this.awaiter = awaiter; - } - - public bool IsCompleted => awaiter.IsCompleted; - - public AwaiterStatus Status => awaiter.Status; - - public bool GetResult() - { - if (awaiter.Status == AwaiterStatus.Canceled) - { - return true; - } - awaiter.GetResult(); - return false; - } - - public void OnCompleted(Action continuation) - { - awaiter.OnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - awaiter.UnsafeOnCompleted(continuation); - } - - void IAwaiter.GetResult() - { - awaiter.GetResult(); - } - } - - public struct Awaiter : IAwaiter - { - readonly UniTask task; - - [DebuggerHidden] - public Awaiter(UniTask task) - { - this.task = task; - } - - [DebuggerHidden] - public bool IsCompleted => task.IsCompleted; - - [DebuggerHidden] - public AwaiterStatus Status => task.Status; - - [DebuggerHidden] - public void GetResult() => task.GetResult(); - - [DebuggerHidden] - public void OnCompleted(Action continuation) - { - if (task.awaiter != null) - { - task.awaiter.OnCompleted(continuation); - } - else - { - continuation(); - } - } - - [DebuggerHidden] - public void UnsafeOnCompleted(Action continuation) - { - if (task.awaiter != null) - { - task.awaiter.UnsafeOnCompleted(continuation); - } - else - { - continuation(); - } - } - } - } - - /// - /// Lightweight unity specified task-like object. - /// - [AsyncMethodBuilder(typeof(AsyncUniTaskMethodBuilder<>))] - public struct UniTask : IEquatable> - { - readonly T result; - readonly IAwaiter awaiter; - - [DebuggerHidden] - public UniTask(T result) - { - this.result = result; - this.awaiter = null; - } - - [DebuggerHidden] - public UniTask(IAwaiter awaiter) - { - this.result = default(T); - this.awaiter = awaiter; - } - - [DebuggerHidden] - public UniTask(Func> factory) - { - this.result = default(T); - this.awaiter = new LazyPromise(factory); - } - - [DebuggerHidden] - public AwaiterStatus Status - { - get - { - return awaiter == null ? AwaiterStatus.Succeeded : awaiter.Status; - } - } - - [DebuggerHidden] - public bool IsCompleted - { - get - { - return awaiter == null ? true : awaiter.IsCompleted; - } - } - - [DebuggerHidden] - public T Result - { - get - { - if (awaiter == null) - { - return result; - } - else - { - return awaiter.GetResult(); - } - } - } - - [DebuggerHidden] - public Awaiter GetAwaiter() - { - return new Awaiter(this); - } - - /// - /// returns (bool IsCanceled, T Result) instead of throws OperationCanceledException. - /// - public UniTask<(bool IsCanceled, T Result)> SuppressCancellationThrow() - { - var status = Status; - if (status == AwaiterStatus.Succeeded) - { - return new UniTask<(bool, T)>((false, Result)); - } - else if (status == AwaiterStatus.Canceled) - { - return new UniTask<(bool, T)>((true, default(T))); - } - return new UniTask<(bool, T)>(new IsCanceledAwaiter(awaiter)); - } - - public bool Equals(UniTask other) - { - if (this.awaiter == null && other.awaiter == null) - { - return EqualityComparer.Default.Equals(this.result, other.result); - } - else if (this.awaiter != null && other.awaiter != null) - { - return this.awaiter == other.awaiter; - } - else - { - return false; - } - } - - public override int GetHashCode() - { - if (this.awaiter == null) - { - if (result == null) return 0; - return result.GetHashCode(); - } - else - { - return this.awaiter.GetHashCode(); - } - } - - public override string ToString() - { - return (this.awaiter == null) ? result.ToString() - : (this.awaiter.Status == AwaiterStatus.Succeeded) ? this.awaiter.GetResult().ToString() - : "(" + this.awaiter.Status + ")"; - } - - public static implicit operator UniTask(UniTask task) - { - if (task.awaiter != null) - { - return new UniTask(task.awaiter); - } - else - { - return new UniTask(); - } - } - - class IsCanceledAwaiter : IAwaiter<(bool, T)> - { - readonly IAwaiter awaiter; - - public IsCanceledAwaiter(IAwaiter awaiter) - { - this.awaiter = awaiter; - } - - public bool IsCompleted => awaiter.IsCompleted; - - public AwaiterStatus Status => awaiter.Status; - - public (bool, T) GetResult() - { - if (awaiter.Status == AwaiterStatus.Canceled) - { - return (true, default(T)); - } - return (false, awaiter.GetResult()); - } - - public void OnCompleted(Action continuation) - { - awaiter.OnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - awaiter.UnsafeOnCompleted(continuation); - } - - void IAwaiter.GetResult() - { - awaiter.GetResult(); - } - } - - public struct Awaiter : IAwaiter - { - readonly UniTask task; - - [DebuggerHidden] - public Awaiter(UniTask task) - { - this.task = task; - } - - [DebuggerHidden] - public bool IsCompleted => task.IsCompleted; - - [DebuggerHidden] - public AwaiterStatus Status => task.Status; - - [DebuggerHidden] - void IAwaiter.GetResult() => GetResult(); - - [DebuggerHidden] - public T GetResult() => task.Result; - - [DebuggerHidden] - public void OnCompleted(Action continuation) - { - if (task.awaiter != null) - { - task.awaiter.OnCompleted(continuation); - } - else - { - continuation(); - } - } - - [DebuggerHidden] - public void UnsafeOnCompleted(Action continuation) - { - if (task.awaiter != null) - { - task.awaiter.UnsafeOnCompleted(continuation); - } - else - { - continuation(); - } - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTask.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTask.cs.meta deleted file mode 100644 index 04eb6b6..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTask.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8947adf23181ff04db73829df217ca94 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskCompletionSource.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTaskCompletionSource.cs deleted file mode 100644 index c9a148d..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskCompletionSource.cs +++ /dev/null @@ -1,413 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Runtime.CompilerServices; -using System.Runtime.ExceptionServices; -using System.Threading; -using UniRx.Async.Internal; - -namespace UniRx.Async -{ - internal class ExceptionHolder - { - ExceptionDispatchInfo exception; - bool calledGet = false; - - public ExceptionHolder(ExceptionDispatchInfo exception) - { - this.exception = exception; - } - - public ExceptionDispatchInfo GetException() - { - if (!calledGet) - { - calledGet = true; - GC.SuppressFinalize(this); - } - return exception; - } - - ~ExceptionHolder() - { - UniTaskScheduler.PublishUnobservedTaskException(exception.SourceException); - } - } - - public interface IResolvePromise - { - bool TrySetResult(); - } - - public interface IResolvePromise - { - bool TrySetResult(T value); - } - - public interface IRejectPromise - { - bool TrySetException(Exception exception); - } - - public interface ICancelPromise - { - bool TrySetCanceled(); - } - - public interface IPromise : IResolvePromise, IRejectPromise, ICancelPromise - { - } - - public interface IPromise : IResolvePromise, IRejectPromise, ICancelPromise - { - } - - public class UniTaskCompletionSource : IAwaiter, IPromise - { - // State(= AwaiterStatus) - const int Pending = 0; - const int Succeeded = 1; - const int Faulted = 2; - const int Canceled = 3; - - int state = 0; - bool handled = false; - ExceptionHolder exception; - object continuation; // action or list - - AwaiterStatus IAwaiter.Status => (AwaiterStatus)state; - - bool IAwaiter.IsCompleted => state != Pending; - - public UniTask Task => new UniTask(this); - - public UniTaskCompletionSource() - { - TaskTracker.TrackActiveTask(this, 2); - } - - [Conditional("UNITY_EDITOR")] - internal void MarkHandled() - { - if (!handled) - { - handled = true; - TaskTracker.RemoveTracking(this); - } - } - - void IAwaiter.GetResult() - { - MarkHandled(); - - if (state == Succeeded) - { - return; - } - else if (state == Faulted) - { - exception.GetException().Throw(); - } - else if (state == Canceled) - { - if (exception != null) - { - exception.GetException().Throw(); // guranteed operation canceled exception. - } - - throw new OperationCanceledException(); - } - else // Pending - { - throw new NotSupportedException("UniTask does not allow call GetResult directly when task not completed. Please use 'await'."); - } - } - - void ICriticalNotifyCompletion.UnsafeOnCompleted(Action action) - { - if (Interlocked.CompareExchange(ref continuation, (object)action, null) == null) - { - if (state != Pending) - { - TryInvokeContinuation(); - } - } - else - { - var c = continuation; - if (c is Action) - { - var list = new List(); - list.Add((Action)c); - list.Add(action); - if (Interlocked.CompareExchange(ref continuation, list, c) == c) - { - goto TRYINVOKE; - } - } - - var l = (List)continuation; - lock (l) - { - l.Add(action); - } - - TRYINVOKE: - if (state != Pending) - { - TryInvokeContinuation(); - } - } - } - - void TryInvokeContinuation() - { - var c = Interlocked.Exchange(ref continuation, null); - if (c != null) - { - if (c is Action) - { - ((Action)c).Invoke(); - } - else - { - var l = (List)c; - var cnt = l.Count; - for (int i = 0; i < cnt; i++) - { - l[i].Invoke(); - } - } - } - } - - public bool TrySetResult() - { - if (Interlocked.CompareExchange(ref state, Succeeded, Pending) == Pending) - { - TryInvokeContinuation(); - return true; - } - return false; - } - - public bool TrySetException(Exception exception) - { - if (Interlocked.CompareExchange(ref state, Faulted, Pending) == Pending) - { - this.exception = new ExceptionHolder(ExceptionDispatchInfo.Capture(exception)); - TryInvokeContinuation(); - return true; - } - return false; - } - - public bool TrySetCanceled() - { - if (Interlocked.CompareExchange(ref state, Canceled, Pending) == Pending) - { - TryInvokeContinuation(); - return true; - } - return false; - } - - public bool TrySetCanceled(OperationCanceledException exception) - { - if (Interlocked.CompareExchange(ref state, Canceled, Pending) == Pending) - { - this.exception = new ExceptionHolder(ExceptionDispatchInfo.Capture(exception)); - TryInvokeContinuation(); - return true; - } - return false; - } - - void INotifyCompletion.OnCompleted(Action continuation) - { - ((ICriticalNotifyCompletion)this).UnsafeOnCompleted(continuation); - } - } - - public class UniTaskCompletionSource : IAwaiter, IPromise - { - // State(= AwaiterStatus) - const int Pending = 0; - const int Succeeded = 1; - const int Faulted = 2; - const int Canceled = 3; - - int state = 0; - T value; - bool handled = false; - ExceptionHolder exception; - object continuation; // action or list - - bool IAwaiter.IsCompleted => state != Pending; - - public UniTask Task => new UniTask(this); - public UniTask UnitTask => new UniTask(this); - - AwaiterStatus IAwaiter.Status => (AwaiterStatus)state; - - public UniTaskCompletionSource() - { - TaskTracker.TrackActiveTask(this, 2); - } - - [Conditional("UNITY_EDITOR")] - internal void MarkHandled() - { - if (!handled) - { - handled = true; - TaskTracker.RemoveTracking(this); - } - } - - T IAwaiter.GetResult() - { - MarkHandled(); - - if (state == Succeeded) - { - return value; - } - else if (state == Faulted) - { - exception.GetException().Throw(); - } - else if (state == Canceled) - { - if (exception != null) - { - exception.GetException().Throw(); // guranteed operation canceled exception. - } - - throw new OperationCanceledException(); - } - else // Pending - { - throw new NotSupportedException("UniTask does not allow call GetResult directly when task not completed. Please use 'await'."); - } - - return default(T); - } - - void ICriticalNotifyCompletion.UnsafeOnCompleted(Action action) - { - if (Interlocked.CompareExchange(ref continuation, (object)action, null) == null) - { - if (state != Pending) - { - TryInvokeContinuation(); - } - } - else - { - var c = continuation; - if (c is Action) - { - var list = new List(); - list.Add((Action)c); - list.Add(action); - if (Interlocked.CompareExchange(ref continuation, list, c) == c) - { - goto TRYINVOKE; - } - } - - var l = (List)continuation; - lock (l) - { - l.Add(action); - } - - TRYINVOKE: - if (state != Pending) - { - TryInvokeContinuation(); - } - } - } - - void TryInvokeContinuation() - { - var c = Interlocked.Exchange(ref continuation, null); - if (c != null) - { - if (c is Action) - { - ((Action)c).Invoke(); - } - else - { - var l = (List)c; - var cnt = l.Count; - for (int i = 0; i < cnt; i++) - { - l[i].Invoke(); - } - } - } - } - - public bool TrySetResult(T value) - { - if (Interlocked.CompareExchange(ref state, Succeeded, Pending) == Pending) - { - this.value = value; - TryInvokeContinuation(); - return true; - } - return false; - } - - public bool TrySetException(Exception exception) - { - if (Interlocked.CompareExchange(ref state, Faulted, Pending) == Pending) - { - this.exception = new ExceptionHolder(ExceptionDispatchInfo.Capture(exception)); - TryInvokeContinuation(); - return true; - } - return false; - } - - public bool TrySetCanceled() - { - if (Interlocked.CompareExchange(ref state, Canceled, Pending) == Pending) - { - TryInvokeContinuation(); - return true; - } - return false; - } - - public bool TrySetCanceled(OperationCanceledException exception) - { - if (Interlocked.CompareExchange(ref state, Canceled, Pending) == Pending) - { - this.exception = new ExceptionHolder(ExceptionDispatchInfo.Capture(exception)); - TryInvokeContinuation(); - return true; - } - return false; - } - - void IAwaiter.GetResult() - { - ((IAwaiter)this).GetResult(); - } - - void INotifyCompletion.OnCompleted(Action continuation) - { - ((ICriticalNotifyCompletion)this).UnsafeOnCompleted(continuation); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskCompletionSource.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTaskCompletionSource.cs.meta deleted file mode 100644 index 2ae5ee3..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskCompletionSource.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ed03524d09e7eb24a9fb9137198feb84 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.Shorthand.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.Shorthand.cs deleted file mode 100644 index 235bcac..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.Shorthand.cs +++ /dev/null @@ -1,53 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; - -namespace UniRx.Async -{ - public static partial class UniTaskExtensions - { - // shorthand of WhenAll - - public static UniTask.Awaiter GetAwaiter(this IEnumerable tasks) - { - return UniTask.WhenAll(tasks).GetAwaiter(); - } - - public static UniTask.Awaiter GetAwaiter(this IEnumerable> tasks) - { - return UniTask.WhenAll(tasks).GetAwaiter(); - } - - public static UniTask<(T1 result1, T2 result2)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2) tasks) - { - return UniTask.WhenAll(tasks.task1, tasks.task2).GetAwaiter(); - } - - public static UniTask<(T1 result1, T2 result2, T3 result3)> WhenAll(this (UniTask task1, UniTask task2, UniTask task3) tasks) - { - return UniTask.WhenAll(tasks.task1, tasks.task2, tasks.task3); - } - - public static UniTask<(T1 result1, T2 result2, T3 result3, T4 result4)> WhenAll(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4) tasks) - { - return UniTask.WhenAll(tasks.task1, tasks.task2, tasks.task3, tasks.task4); - } - - public static UniTask<(T1 result1, T2 result2, T3 result3, T4 result4, T5 result5)> WhenAll(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5) tasks) - { - return UniTask.WhenAll(tasks.task1, tasks.task2, tasks.task3, tasks.task4, tasks.task5); - } - - public static UniTask<(T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6)> WhenAll(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6) tasks) - { - return UniTask.WhenAll(tasks.task1, tasks.task2, tasks.task3, tasks.task4, tasks.task5, tasks.task6); - } - - public static UniTask<(T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7)> WhenAll(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7) tasks) - { - return UniTask.WhenAll(tasks.task1, tasks.task2, tasks.task3, tasks.task4, tasks.task5, tasks.task6, tasks.task7); - } - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.Shorthand.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.Shorthand.cs.meta deleted file mode 100644 index e2dcc14..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.Shorthand.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4b4ff020f73dc6d4b8ebd4760d61fb43 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.cs deleted file mode 100644 index 0367d29..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.cs +++ /dev/null @@ -1,506 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections; -using System.Runtime.ExceptionServices; -using System.Threading; -using System.Threading.Tasks; -using UniRx.Async.Internal; - -namespace UniRx.Async -{ - public static partial class UniTaskExtensions - { - /// - /// Convert UniTask -> UniTask[AsyncUnit]. - /// - public static UniTask AsAsyncUnitUniTask(this UniTask task) - { - // use implicit conversion - return task; - } - - /// - /// Convert Task[T] -> UniTask[T]. - /// - public static UniTask AsUniTask(this Task task, bool useCurrentSynchronizationContext = true) - { - var promise = new UniTaskCompletionSource(); - - task.ContinueWith((x, state) => - { - var p = (UniTaskCompletionSource)state; - - switch (x.Status) - { - case TaskStatus.Canceled: - p.TrySetCanceled(); - break; - case TaskStatus.Faulted: - p.TrySetException(x.Exception); - break; - case TaskStatus.RanToCompletion: - p.TrySetResult(x.Result); - break; - default: - throw new NotSupportedException(); - } - }, promise, useCurrentSynchronizationContext ? TaskScheduler.FromCurrentSynchronizationContext() : TaskScheduler.Current); - - return new UniTask(promise); - } - - /// - /// Convert Task -> UniTask. - /// - public static UniTask AsUniTask(this Task task, bool useCurrentSynchronizationContext = true) - { - var promise = new UniTaskCompletionSource(); - - task.ContinueWith((x, state) => - { - var p = (UniTaskCompletionSource)state; - - switch (x.Status) - { - case TaskStatus.Canceled: - p.TrySetCanceled(); - break; - case TaskStatus.Faulted: - p.TrySetException(x.Exception); - break; - case TaskStatus.RanToCompletion: - p.TrySetResult(default(AsyncUnit)); - break; - default: - throw new NotSupportedException(); - } - }, promise, useCurrentSynchronizationContext ? TaskScheduler.FromCurrentSynchronizationContext() : TaskScheduler.Current); - - return new UniTask(promise); - } - - public static IEnumerator ToCoroutine(this UniTask task, Action resultHandler = null, Action exceptionHandler = null) - { - return new ToCoroutineEnumerator(task, resultHandler, exceptionHandler); - } - - public static IEnumerator ToCoroutine(this UniTask task, Action exceptionHandler = null) - { - return new ToCoroutineEnumerator(task, exceptionHandler); - } - -#if !UniRxLibrary - - public static UniTask Timeout(this UniTask task, TimeSpan timeout, bool ignoreTimeScale = true, PlayerLoopTiming timeoutCheckTiming = PlayerLoopTiming.Update, CancellationTokenSource taskCancellationTokenSource = null) - { - return Timeout(task.AsAsyncUnitUniTask(), timeout, ignoreTimeScale, timeoutCheckTiming, taskCancellationTokenSource); - } - - public static async UniTask Timeout(this UniTask task, TimeSpan timeout, bool ignoreTimeScale = true, PlayerLoopTiming timeoutCheckTiming = PlayerLoopTiming.Update, CancellationTokenSource taskCancellationTokenSource = null) - { - // left, right both suppress operation canceled exception. - - var delayCancellationTokenSource = new CancellationTokenSource(); - var timeoutTask = (UniTask)UniTask.Delay(timeout, ignoreTimeScale, timeoutCheckTiming).SuppressCancellationThrow(); - - var (hasValue, value) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask); - - if (!hasValue) - { - if (taskCancellationTokenSource != null) - { - taskCancellationTokenSource.Cancel(); - taskCancellationTokenSource.Dispose(); - } - - throw new TimeoutException("Exceed Timeout:" + timeout); - } - else - { - delayCancellationTokenSource.Cancel(); - delayCancellationTokenSource.Dispose(); - } - - if (value.IsCanceled) - { - Error.ThrowOperationCanceledException(); - } - - return value.Result; - } - - /// - /// Timeout with suppress OperationCanceledException. Returns (bool, IsCacneled). - /// - public static async UniTask TimeoutWithoutException(this UniTask task, TimeSpan timeout, bool ignoreTimeScale = true, PlayerLoopTiming timeoutCheckTiming = PlayerLoopTiming.Update, CancellationTokenSource taskCancellationTokenSource = null) - { - var v = await TimeoutWithoutException(task.AsAsyncUnitUniTask(), timeout, ignoreTimeScale, timeoutCheckTiming, taskCancellationTokenSource); - return v.IsTimeout; - } - - - /// - /// Timeout with suppress OperationCanceledException. Returns (bool IsTimeout, T Result). - /// - public static async UniTask<(bool IsTimeout, T Result)> TimeoutWithoutException(this UniTask task, TimeSpan timeout, bool ignoreTimeScale = true, PlayerLoopTiming timeoutCheckTiming = PlayerLoopTiming.Update, CancellationTokenSource taskCancellationTokenSource = null) - { - // left, right both suppress operation canceled exception. - - var delayCancellationTokenSource = new CancellationTokenSource(); - var timeoutTask = (UniTask)UniTask.Delay(timeout, ignoreTimeScale, timeoutCheckTiming).SuppressCancellationThrow(); - - var (hasValue, value) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask); - - if (!hasValue) - { - if (taskCancellationTokenSource != null) - { - taskCancellationTokenSource.Cancel(); - taskCancellationTokenSource.Dispose(); - } - - return (true, default(T)); - } - else - { - delayCancellationTokenSource.Cancel(); - delayCancellationTokenSource.Dispose(); - } - - if (value.IsCanceled) - { - Error.ThrowOperationCanceledException(); - } - - return (false, value.Result); - } - -#endif - - public static void Forget(this UniTask task) - { - ForgetCore(task).Forget(); - } - - public static void Forget(this UniTask task, Action exceptionHandler, bool handleExceptionOnMainThread = true) - { - if (exceptionHandler == null) - { - ForgetCore(task).Forget(); - } - else - { - ForgetCoreWithCatch(task, exceptionHandler, handleExceptionOnMainThread).Forget(); - } - } - - // UniTask to UniTaskVoid - static async UniTaskVoid ForgetCore(UniTask task) - { - await task; - } - - static async UniTaskVoid ForgetCoreWithCatch(UniTask task, Action exceptionHandler, bool handleExceptionOnMainThread) - { - try - { - await task; - } - catch (Exception ex) - { - try - { -#if !UniRxLibrary - if (handleExceptionOnMainThread) - { - await UniTask.SwitchToMainThread(); - } -#endif - exceptionHandler(ex); - } - catch (Exception ex2) - { - UniTaskScheduler.PublishUnobservedTaskException(ex2); - } - } - } - - public static void Forget(this UniTask task) - { - ForgetCore(task).Forget(); - } - - public static void Forget(this UniTask task, Action exceptionHandler, bool handleExceptionOnMainThread = true) - { - if (exceptionHandler == null) - { - ForgetCore(task).Forget(); - } - else - { - ForgetCoreWithCatch(task, exceptionHandler, handleExceptionOnMainThread).Forget(); - } - } - - // UniTask to UniTaskVoid - static async UniTaskVoid ForgetCore(UniTask task) - { - await task; - } - - static async UniTaskVoid ForgetCoreWithCatch(UniTask task, Action exceptionHandler, bool handleExceptionOnMainThread) - { - try - { - await task; - } - catch (Exception ex) - { - try - { -#if !UniRxLibrary - if (handleExceptionOnMainThread) - { - await UniTask.SwitchToMainThread(); - } -#endif - exceptionHandler(ex); - } - catch (Exception ex2) - { - UniTaskScheduler.PublishUnobservedTaskException(ex2); - } - } - } - - public static async UniTask ContinueWith(this UniTask task, Action continuationFunction) - { - continuationFunction(await task); - } - - public static async UniTask ContinueWith(this UniTask task, Func continuationFunction) - { - await continuationFunction(await task); - } - - public static async UniTask ContinueWith(this UniTask task, Func continuationFunction) - { - return continuationFunction(await task); - } - - public static async UniTask ContinueWith(this UniTask task, Func> continuationFunction) - { - return await continuationFunction(await task); - } - - public static async UniTask ContinueWith(this UniTask task, Action continuationFunction) - { - await task; - continuationFunction(); - } - - public static async UniTask ContinueWith(this UniTask task, Func continuationFunction) - { - await task; - await continuationFunction(); - } - - public static async UniTask ContinueWith(this UniTask task, Func continuationFunction) - { - await task; - return continuationFunction(); - } - - public static async UniTask ContinueWith(this UniTask task, Func> continuationFunction) - { - await task; - return await continuationFunction(); - } - -#if !UniRxLibrary - - public static async UniTask ConfigureAwait(this Task task, PlayerLoopTiming timing) - { - await task.ConfigureAwait(false); - await UniTask.Yield(timing); - } - - public static async UniTask ConfigureAwait(this Task task, PlayerLoopTiming timing) - { - var v = await task.ConfigureAwait(false); - await UniTask.Yield(timing); - return v; - } - - public static async UniTask ConfigureAwait(this UniTask task, PlayerLoopTiming timing) - { - await task; - await UniTask.Yield(timing); - } - - public static async UniTask ConfigureAwait(this UniTask task, PlayerLoopTiming timing) - { - var v = await task; - await UniTask.Yield(timing); - return v; - } - -#endif - - public static async UniTask Unwrap(this UniTask> task) - { - return await await task; - } - - public static async UniTask Unwrap(this UniTask task) - { - await await task; - } - - class ToCoroutineEnumerator : IEnumerator - { - bool completed; - UniTask task; - Action exceptionHandler = null; - bool isStarted = false; - ExceptionDispatchInfo exception; - - public ToCoroutineEnumerator(UniTask task, Action exceptionHandler) - { - completed = false; - this.exceptionHandler = exceptionHandler; - this.task = task; - } - - async UniTaskVoid RunTask(UniTask task) - { - try - { - await task; - } - catch (Exception ex) - { - if (exceptionHandler != null) - { - exceptionHandler(ex); - } - else - { - this.exception = ExceptionDispatchInfo.Capture(ex); - } - } - finally - { - completed = true; - } - } - - public object Current => null; - - public bool MoveNext() - { - if (!isStarted) - { - isStarted = true; - RunTask(task).Forget(); - } - - if (exception != null) - { - // throw exception on iterator (main)thread. - // unfortunately unity test-runner can not handle throw exception on hand-write IEnumerator.MoveNext. -#if !UniRxLibrary - UnityEngine.Debug.LogException(exception.SourceException); -#else - exception.Throw(); -#endif - } - - return !completed; - } - - public void Reset() - { - } - } - - class ToCoroutineEnumerator : IEnumerator - { - bool completed; - Action resultHandler = null; - Action exceptionHandler = null; - bool isStarted = false; - UniTask task; - object current = null; - ExceptionDispatchInfo exception; - - public ToCoroutineEnumerator(UniTask task, Action resultHandler, Action exceptionHandler) - { - completed = false; - this.task = task; - this.resultHandler = resultHandler; - this.exceptionHandler = exceptionHandler; - } - - async UniTaskVoid RunTask(UniTask task) - { - try - { - var value = await task; - current = value; - if (resultHandler != null) - { - resultHandler(value); - } - } - catch (Exception ex) - { - if (exceptionHandler != null) - { - exceptionHandler(ex); - } - else - { - this.exception = ExceptionDispatchInfo.Capture(ex); - } - } - finally - { - completed = true; - } - } - - public object Current => current; - - public bool MoveNext() - { - if (isStarted) - { - isStarted = true; - RunTask(task).Forget(); - } - - if (exception != null) - { - // throw exception on iterator (main)thread. - // unfortunately unity test-runner can not handle throw exception on hand-write IEnumerator.MoveNext. -#if !UniRxLibrary - UnityEngine.Debug.LogException(exception.SourceException); -#else - exception.Throw(); -#endif - } - - return !completed; - } - - public void Reset() - { - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.cs.meta deleted file mode 100644 index 0d22946..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 05460c617dae1e440861a7438535389f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskScheduler.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTaskScheduler.cs deleted file mode 100644 index 9331e24..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskScheduler.cs +++ /dev/null @@ -1,106 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Threading; - -namespace UniRx.Async -{ - // UniTask has no scheduler like TaskScheduler. - // Only handle unobserved exception. - - public static class UniTaskScheduler - { - public static event Action UnobservedTaskException; - - /// - /// Propagate OperationCanceledException to UnobservedTaskException when true. Default is false. - /// - public static bool PropagateOperationCanceledException = false; - -#if !UniRxLibrary - - /// - /// Write log type when catch unobserved exception and not registered UnobservedTaskException. Default is Warning. - /// - public static UnityEngine.LogType UnobservedExceptionWriteLogType = UnityEngine.LogType.Warning; - -#endif - - /// - /// Dispatch exception event to Unity MainThread. - /// - public static bool DispatchUnityMainThread = true; - - // cache delegate. - static readonly SendOrPostCallback handleExceptionInvoke = InvokeUnobservedTaskException; - - internal static void PublishUnobservedTaskException(Exception ex) - { - if (ex != null) - { - if (!PropagateOperationCanceledException && ex is OperationCanceledException) - { - return; - } - - if (UnobservedTaskException != null) - { -#if !UniRxLibrary - if (Thread.CurrentThread.ManagedThreadId == PlayerLoopHelper.MainThreadId) - { - // allows inlining call. - UnobservedTaskException.Invoke(ex); - } - else - { - // Post to MainThread. - PlayerLoopHelper.UnitySynchronizationContext.Post(handleExceptionInvoke, ex); - } -#else - UnobservedTaskException.Invoke(ex); -#endif - } - else - { -#if !UniRxLibrary - string msg = null; - if (UnobservedExceptionWriteLogType != UnityEngine.LogType.Exception) - { - msg = "UnobservedTaskException:" + ex.ToString(); - } - switch (UnobservedExceptionWriteLogType) - { - case UnityEngine.LogType.Error: - UnityEngine.Debug.LogError(msg); - break; - case UnityEngine.LogType.Assert: - UnityEngine.Debug.LogAssertion(msg); - break; - case UnityEngine.LogType.Warning: - UnityEngine.Debug.LogWarning(msg); - break; - case UnityEngine.LogType.Log: - UnityEngine.Debug.Log(msg); - break; - case UnityEngine.LogType.Exception: - UnityEngine.Debug.LogException(ex); - break; - default: - break; - } -#else - Console.WriteLine("UnobservedTaskException:" + ex.ToString()); -#endif - } - } - } - - static void InvokeUnobservedTaskException(object state) - { - UnobservedTaskException((Exception)state); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskScheduler.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTaskScheduler.cs.meta deleted file mode 100644 index 5e29191..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskScheduler.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d6cad69921702d5488d96b5ef30df1b0 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskVoid.cs b/Assets/Plugins/UniRx/Scripts/Async/UniTaskVoid.cs deleted file mode 100644 index f74de6c..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskVoid.cs +++ /dev/null @@ -1,52 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 - -using System; -using System.Diagnostics; -using System.Runtime.CompilerServices; -using UniRx.Async.CompilerServices; - -namespace UniRx.Async -{ - [AsyncMethodBuilder(typeof(AsyncUniTaskVoidMethodBuilder))] - public struct UniTaskVoid - { - public void Forget() - { - } - - [DebuggerHidden] - public Awaiter GetAwaiter() - { - return new Awaiter(); - } - - public struct Awaiter : ICriticalNotifyCompletion - { - [DebuggerHidden] - public bool IsCompleted => true; - - [DebuggerHidden] - public void GetResult() - { -#if !UniRxLibrary - UnityEngine.Debug.LogWarning("UniTaskVoid can't await, always fire-and-forget. use Forget instead of await."); -#else - Console.WriteLine("UniTask can't await, always fire-and-forget. use Forget instead of await."); -#endif - } - - [DebuggerHidden] - public void OnCompleted(Action continuation) - { - } - - [DebuggerHidden] - public void UnsafeOnCompleted(Action continuation) - { - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniTaskVoid.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UniTaskVoid.cs.meta deleted file mode 100644 index 01f7156..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UniTaskVoid.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e9f28cd922179634d863011548f89ae7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.Jobs.cs b/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.Jobs.cs deleted file mode 100644 index 01185e3..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.Jobs.cs +++ /dev/null @@ -1,140 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) && ENABLE_MANAGED_JOBS -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Threading; -using UniRx.Async.Internal; -using Unity.Jobs; - -namespace UniRx.Async -{ - public static partial class UnityAsyncExtensions - { - public static IAwaiter GetAwaiter(this JobHandle jobHandle) - { - var awaiter = new JobHandleAwaiter(jobHandle, CancellationToken.None); - if (!awaiter.IsCompleted) - { - PlayerLoopHelper.AddAction(PlayerLoopTiming.EarlyUpdate, awaiter); - PlayerLoopHelper.AddAction(PlayerLoopTiming.PreUpdate, awaiter); - PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, awaiter); - PlayerLoopHelper.AddAction(PlayerLoopTiming.PreLateUpdate, awaiter); - PlayerLoopHelper.AddAction(PlayerLoopTiming.PostLateUpdate, awaiter); - } - return awaiter; - } - - public static UniTask ToUniTask(this JobHandle jobHandle, CancellationToken cancellation = default(CancellationToken)) - { - var awaiter = new JobHandleAwaiter(jobHandle, cancellation); - if (!awaiter.IsCompleted) - { - PlayerLoopHelper.AddAction(PlayerLoopTiming.EarlyUpdate, awaiter); - PlayerLoopHelper.AddAction(PlayerLoopTiming.PreUpdate, awaiter); - PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, awaiter); - PlayerLoopHelper.AddAction(PlayerLoopTiming.PreLateUpdate, awaiter); - PlayerLoopHelper.AddAction(PlayerLoopTiming.PostLateUpdate, awaiter); - } - return new UniTask(awaiter); - } - - public static UniTask ConfigureAwait(this JobHandle jobHandle, PlayerLoopTiming waitTiming, CancellationToken cancellation = default(CancellationToken)) - { - var awaiter = new JobHandleAwaiter(jobHandle, cancellation); - if (!awaiter.IsCompleted) - { - PlayerLoopHelper.AddAction(waitTiming, awaiter); - } - return new UniTask(awaiter); - } - - class JobHandleAwaiter : IAwaiter, IPlayerLoopItem - { - JobHandle jobHandle; - CancellationToken cancellationToken; - AwaiterStatus status; - Action continuation; - - public JobHandleAwaiter(JobHandle jobHandle, CancellationToken cancellationToken, int skipFrame = 2) - { - this.status = cancellationToken.IsCancellationRequested ? AwaiterStatus.Canceled - : jobHandle.IsCompleted ? AwaiterStatus.Succeeded - : AwaiterStatus.Pending; - - if (this.status.IsCompleted()) return; - - this.jobHandle = jobHandle; - this.cancellationToken = cancellationToken; - this.status = AwaiterStatus.Pending; - this.continuation = null; - - TaskTracker.TrackActiveTask(this, skipFrame); - } - - public bool IsCompleted => status.IsCompleted(); - - public AwaiterStatus Status => status; - - public void GetResult() - { - if (status == AwaiterStatus.Succeeded) - { - return; - } - else if (status == AwaiterStatus.Canceled) - { - Error.ThrowOperationCanceledException(); - } - - Error.ThrowNotYetCompleted(); - } - - public bool MoveNext() - { - if (cancellationToken.IsCancellationRequested) - { - // Call jobHandle.Complete after finished. - PlayerLoopHelper.AddAction(PlayerLoopTiming.EarlyUpdate, new JobHandleAwaiter(jobHandle, CancellationToken.None, 1)); - InvokeContinuation(AwaiterStatus.Canceled); - return false; - } - - if (jobHandle.IsCompleted) - { - jobHandle.Complete(); - InvokeContinuation(AwaiterStatus.Succeeded); - return false; - } - - return true; - } - - void InvokeContinuation(AwaiterStatus status) - { - this.status = status; - var cont = this.continuation; - - // cleanup - TaskTracker.RemoveTracking(this); - this.continuation = null; - this.cancellationToken = CancellationToken.None; - this.jobHandle = default(JobHandle); - - if (cont != null) cont.Invoke(); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - Error.ThrowWhenContinuationIsAlreadyRegistered(this.continuation); - this.continuation = continuation; - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.Jobs.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.Jobs.cs.meta deleted file mode 100644 index c07df0b..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.Jobs.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 30979a768fbd4b94f8694eee8a305c99 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.cs b/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.cs deleted file mode 100644 index 0005ca7..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.cs +++ /dev/null @@ -1,702 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Threading; -using UniRx.Async.Internal; -using UnityEngine; -using UnityEngine.Networking; - -namespace UniRx.Async -{ - public static partial class UnityAsyncExtensions - { - public static AsyncOperationAwaiter GetAwaiter(this AsyncOperation asyncOperation) - { - Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); - return new AsyncOperationAwaiter(asyncOperation); - } - - public static UniTask ToUniTask(this AsyncOperation asyncOperation) - { - Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); - return new UniTask(new AsyncOperationAwaiter(asyncOperation)); - } - - public static UniTask ConfigureAwait(this AsyncOperation asyncOperation, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellation = default(CancellationToken)) - { - Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); - - var awaiter = new AsyncOperationConfiguredAwaiter(asyncOperation, progress, cancellation); - if (!awaiter.IsCompleted) - { - PlayerLoopHelper.AddAction(timing, awaiter); - } - return new UniTask(awaiter); - } - - public static ResourceRequestAwaiter GetAwaiter(this ResourceRequest resourceRequest) - { - Error.ThrowArgumentNullException(resourceRequest, nameof(resourceRequest)); - return new ResourceRequestAwaiter(resourceRequest); - } - - public static UniTask ToUniTask(this ResourceRequest resourceRequest) - { - Error.ThrowArgumentNullException(resourceRequest, nameof(resourceRequest)); - return new UniTask(new ResourceRequestAwaiter(resourceRequest)); - } - - public static UniTask ConfigureAwait(this ResourceRequest resourceRequest, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellation = default(CancellationToken)) - { - Error.ThrowArgumentNullException(resourceRequest, nameof(resourceRequest)); - - var awaiter = new ResourceRequestConfiguredAwaiter(resourceRequest, progress, cancellation); - if (!awaiter.IsCompleted) - { - PlayerLoopHelper.AddAction(timing, awaiter); - } - return new UniTask(awaiter); - } - -#if ENABLE_WWW - -#if UNITY_2018_3_OR_NEWER -#pragma warning disable CS0618 -#endif - - public static IAwaiter GetAwaiter(this WWW www) - { - Error.ThrowArgumentNullException(www, nameof(www)); - - var awaiter = new WWWConfiguredAwaiter(www, null, CancellationToken.None); - if (!awaiter.IsCompleted) - { - PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, awaiter); - } - return awaiter; - } - - public static UniTask ToUniTask(this WWW www) - { - Error.ThrowArgumentNullException(www, nameof(www)); - - var awaiter = new WWWConfiguredAwaiter(www, null, CancellationToken.None); - if (!awaiter.IsCompleted) - { - PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, awaiter); - } - return new UniTask(awaiter); - } - - public static UniTask ConfigureAwait(this WWW www, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellation = default(CancellationToken)) - { - Error.ThrowArgumentNullException(www, nameof(www)); - - var awaiter = new WWWConfiguredAwaiter(www, progress, cancellation); - if (!awaiter.IsCompleted) - { - PlayerLoopHelper.AddAction(timing, awaiter); - } - return new UniTask(awaiter); - } - -#if UNITY_2018_3_OR_NEWER -#pragma warning restore CS0618 -#endif - -#endif - -#if ENABLE_UNITYWEBREQUEST - - public static UnityWebRequestAsyncOperationAwaiter GetAwaiter(this UnityWebRequestAsyncOperation asyncOperation) - { - Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); - return new UnityWebRequestAsyncOperationAwaiter(asyncOperation); - } - - public static UniTask ToUniTask(this UnityWebRequestAsyncOperation asyncOperation) - { - Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); - return new UniTask(new UnityWebRequestAsyncOperationAwaiter(asyncOperation)); - } - - public static UniTask ConfigureAwait(this UnityWebRequestAsyncOperation asyncOperation, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellation = default(CancellationToken)) - { - Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); - - var awaiter = new UnityWebRequestAsyncOperationConfiguredAwaiter(asyncOperation, progress, cancellation); - if (!awaiter.IsCompleted) - { - PlayerLoopHelper.AddAction(timing, awaiter); - } - return new UniTask(awaiter); - } - -#endif - - public struct AsyncOperationAwaiter : IAwaiter - { - AsyncOperation asyncOperation; - Action continuationAction; - AwaiterStatus status; - - public AsyncOperationAwaiter(AsyncOperation asyncOperation) - { - this.status = asyncOperation.isDone ? AwaiterStatus.Succeeded : AwaiterStatus.Pending; - this.asyncOperation = (this.status.IsCompleted()) ? null : asyncOperation; - this.continuationAction = null; - } - - public bool IsCompleted => status.IsCompleted(); - public AwaiterStatus Status => status; - - public void GetResult() - { - if (status == AwaiterStatus.Succeeded) return; - - if (status == AwaiterStatus.Pending) - { - // first timing of call - if (asyncOperation.isDone) - { - status = AwaiterStatus.Succeeded; - } - else - { - Error.ThrowNotYetCompleted(); - } - } - - asyncOperation = null; // remove reference. - - if (continuationAction != null) - { - asyncOperation.completed -= continuationAction; - continuationAction = null; - } - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - Error.ThrowWhenContinuationIsAlreadyRegistered(continuationAction); - continuationAction = continuation.AsFuncOfT(); - asyncOperation.completed += continuationAction; - } - } - - class AsyncOperationConfiguredAwaiter : IAwaiter, IPlayerLoopItem - { - AsyncOperation asyncOperation; - IProgress progress; - CancellationToken cancellationToken; - AwaiterStatus status; - Action continuation; - - public AsyncOperationConfiguredAwaiter(AsyncOperation asyncOperation, IProgress progress, CancellationToken cancellationToken) - { - this.status = cancellationToken.IsCancellationRequested ? AwaiterStatus.Canceled - : asyncOperation.isDone ? AwaiterStatus.Succeeded - : AwaiterStatus.Pending; - - if (this.status.IsCompleted()) return; - - this.asyncOperation = asyncOperation; - this.progress = progress; - this.cancellationToken = cancellationToken; - this.continuation = null; - - TaskTracker.TrackActiveTask(this, 2); - } - - public bool IsCompleted => status.IsCompleted(); - public AwaiterStatus Status => status; - - public void GetResult() - { - if (status == AwaiterStatus.Succeeded) - { - return; - } - else if (status == AwaiterStatus.Canceled) - { - Error.ThrowOperationCanceledException(); - } - - Error.ThrowNotYetCompleted(); - } - - public bool MoveNext() - { - if (cancellationToken.IsCancellationRequested) - { - InvokeContinuation(AwaiterStatus.Canceled); - return false; - } - - if (progress != null) - { - progress.Report(asyncOperation.progress); - } - - if (asyncOperation.isDone) - { - InvokeContinuation(AwaiterStatus.Succeeded); - return false; - } - - return true; - } - - void InvokeContinuation(AwaiterStatus status) - { - this.status = status; - var cont = this.continuation; - - // cleanup - TaskTracker.RemoveTracking(this); - this.continuation = null; - this.cancellationToken = CancellationToken.None; - this.progress = null; - this.asyncOperation = null; - - if (cont != null) cont.Invoke(); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - Error.ThrowWhenContinuationIsAlreadyRegistered(this.continuation); - this.continuation = continuation; - } - } - - public struct ResourceRequestAwaiter : IAwaiter - { - ResourceRequest asyncOperation; - Action continuationAction; - AwaiterStatus status; - UnityEngine.Object result; - - public ResourceRequestAwaiter(ResourceRequest asyncOperation) - { - this.status = asyncOperation.isDone ? AwaiterStatus.Succeeded : AwaiterStatus.Pending; - this.asyncOperation = (this.status.IsCompleted()) ? null : asyncOperation; - this.result = (this.status.IsCompletedSuccessfully()) ? asyncOperation.asset : null; - this.continuationAction = null; - } - - public bool IsCompleted => status.IsCompleted(); - public AwaiterStatus Status => status; - - public UnityEngine.Object GetResult() - { - if (status == AwaiterStatus.Succeeded) return this.result; - - if (status == AwaiterStatus.Pending) - { - // first timing of call - if (asyncOperation.isDone) - { - status = AwaiterStatus.Succeeded; - } - else - { - Error.ThrowNotYetCompleted(); - } - } - - this.result = asyncOperation.asset; - asyncOperation = null; // remove reference. - - if (continuationAction != null) - { - asyncOperation.completed -= continuationAction; - continuationAction = null; - } - - return this.result; - } - - void IAwaiter.GetResult() => GetResult(); - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - Error.ThrowWhenContinuationIsAlreadyRegistered(continuationAction); - continuationAction = continuation.AsFuncOfT(); - asyncOperation.completed += continuationAction; - } - } - - class ResourceRequestConfiguredAwaiter : IAwaiter, IPlayerLoopItem - { - ResourceRequest asyncOperation; - IProgress progress; - CancellationToken cancellationToken; - AwaiterStatus status; - Action continuation; - UnityEngine.Object result; - - public ResourceRequestConfiguredAwaiter(ResourceRequest asyncOperation, IProgress progress, CancellationToken cancellationToken) - { - this.status = cancellationToken.IsCancellationRequested ? AwaiterStatus.Canceled - : asyncOperation.isDone ? AwaiterStatus.Succeeded - : AwaiterStatus.Pending; - - if (this.status.IsCompletedSuccessfully()) this.result = asyncOperation.asset; - if (this.status.IsCompleted()) return; - - this.asyncOperation = asyncOperation; - this.progress = progress; - this.cancellationToken = cancellationToken; - this.continuation = null; - this.result = null; - - TaskTracker.TrackActiveTask(this, 2); - } - - public bool IsCompleted => status.IsCompleted(); - public AwaiterStatus Status => status; - void IAwaiter.GetResult() => GetResult(); - - public UnityEngine.Object GetResult() - { - if (status == AwaiterStatus.Succeeded) return this.result; - - if (status == AwaiterStatus.Canceled) - { - Error.ThrowOperationCanceledException(); - } - - return Error.ThrowNotYetCompleted(); - } - - public bool MoveNext() - { - if (cancellationToken.IsCancellationRequested) - { - InvokeContinuation(AwaiterStatus.Canceled); - return false; - } - - if (progress != null) - { - progress.Report(asyncOperation.progress); - } - - if (asyncOperation.isDone) - { - this.result = asyncOperation.asset; - InvokeContinuation(AwaiterStatus.Succeeded); - return false; - } - - return true; - } - - void InvokeContinuation(AwaiterStatus status) - { - this.status = status; - var cont = this.continuation; - - // cleanup - TaskTracker.RemoveTracking(this); - this.continuation = null; - this.cancellationToken = CancellationToken.None; - this.progress = null; - this.asyncOperation = null; - - if (cont != null) cont.Invoke(); - } - - public void OnCompleted(Action continuation) - { - Error.ThrowWhenContinuationIsAlreadyRegistered(this.continuation); - this.continuation = continuation; - } - - public void UnsafeOnCompleted(Action continuation) - { - Error.ThrowWhenContinuationIsAlreadyRegistered(this.continuation); - this.continuation = continuation; - } - } - -#if ENABLE_WWW - -#if UNITY_2018_3_OR_NEWER -#pragma warning disable CS0618 -#endif - - class WWWConfiguredAwaiter : IAwaiter, IPlayerLoopItem - { - WWW asyncOperation; - IProgress progress; - CancellationToken cancellationToken; - AwaiterStatus status; - Action continuation; - - public WWWConfiguredAwaiter(WWW asyncOperation, IProgress progress, CancellationToken cancellationToken) - { - this.status = cancellationToken.IsCancellationRequested ? AwaiterStatus.Canceled - : asyncOperation.isDone ? AwaiterStatus.Succeeded - : AwaiterStatus.Pending; - - if (this.status.IsCompleted()) return; - - this.asyncOperation = asyncOperation; - this.progress = progress; - this.cancellationToken = cancellationToken; - this.continuation = null; - - TaskTracker.TrackActiveTask(this, 2); - } - - public bool IsCompleted => status.IsCompleted(); - public AwaiterStatus Status => status; - - public void GetResult() - { - if (status == AwaiterStatus.Succeeded) - { - return; - } - else if (status == AwaiterStatus.Canceled) - { - Error.ThrowOperationCanceledException(); - } - - Error.ThrowNotYetCompleted(); - } - - public bool MoveNext() - { - if (cancellationToken.IsCancellationRequested) - { - InvokeContinuation(AwaiterStatus.Canceled); - return false; - } - - if (progress != null) - { - progress.Report(asyncOperation.progress); - } - - if (asyncOperation.isDone) - { - InvokeContinuation(AwaiterStatus.Succeeded); - return false; - } - - return true; - } - - void InvokeContinuation(AwaiterStatus status) - { - this.status = status; - var cont = this.continuation; - - // cleanup - TaskTracker.RemoveTracking(this); - this.continuation = null; - this.cancellationToken = CancellationToken.None; - this.progress = null; - this.asyncOperation = null; - - if (cont != null) cont.Invoke(); - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - Error.ThrowWhenContinuationIsAlreadyRegistered(this.continuation); - this.continuation = continuation; - } - } - -#if UNITY_2018_3_OR_NEWER -#pragma warning restore CS0618 -#endif - -#endif - -#if ENABLE_UNITYWEBREQUEST - - public struct UnityWebRequestAsyncOperationAwaiter : IAwaiter - { - UnityWebRequestAsyncOperation asyncOperation; - Action continuationAction; - AwaiterStatus status; - UnityWebRequest result; - - public UnityWebRequestAsyncOperationAwaiter(UnityWebRequestAsyncOperation asyncOperation) - { - this.status = asyncOperation.isDone ? AwaiterStatus.Succeeded : AwaiterStatus.Pending; - this.asyncOperation = (this.status.IsCompleted()) ? null : asyncOperation; - this.result = (this.status.IsCompletedSuccessfully()) ? asyncOperation.webRequest : null; - this.continuationAction = null; - } - - public bool IsCompleted => status.IsCompleted(); - public AwaiterStatus Status => status; - - public UnityWebRequest GetResult() - { - if (status == AwaiterStatus.Succeeded) return this.result; - - if (status == AwaiterStatus.Pending) - { - // first timing of call - if (asyncOperation.isDone) - { - status = AwaiterStatus.Succeeded; - } - else - { - Error.ThrowNotYetCompleted(); - } - } - - this.result = asyncOperation.webRequest; - asyncOperation = null; // remove reference. - - if (continuationAction != null) - { - asyncOperation.completed -= continuationAction; - continuationAction = null; - } - - return this.result; - } - - void IAwaiter.GetResult() => GetResult(); - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action continuation) - { - Error.ThrowWhenContinuationIsAlreadyRegistered(continuationAction); - continuationAction = continuation.AsFuncOfT(); - asyncOperation.completed += continuationAction; - } - } - - class UnityWebRequestAsyncOperationConfiguredAwaiter : IAwaiter, IPlayerLoopItem - { - UnityWebRequestAsyncOperation asyncOperation; - IProgress progress; - CancellationToken cancellationToken; - AwaiterStatus status; - Action continuation; - UnityWebRequest result; - - public UnityWebRequestAsyncOperationConfiguredAwaiter(UnityWebRequestAsyncOperation asyncOperation, IProgress progress, CancellationToken cancellationToken) - { - this.status = cancellationToken.IsCancellationRequested ? AwaiterStatus.Canceled - : asyncOperation.isDone ? AwaiterStatus.Succeeded - : AwaiterStatus.Pending; - - if (this.status.IsCompletedSuccessfully()) this.result = asyncOperation.webRequest; - if (this.status.IsCompleted()) return; - - this.asyncOperation = asyncOperation; - this.progress = progress; - this.cancellationToken = cancellationToken; - this.continuation = null; - this.result = null; - - TaskTracker.TrackActiveTask(this, 2); - } - - public bool IsCompleted => status.IsCompleted(); - public AwaiterStatus Status => status; - void IAwaiter.GetResult() => GetResult(); - - public UnityWebRequest GetResult() - { - if (status == AwaiterStatus.Succeeded) return this.result; - - if (status == AwaiterStatus.Canceled) - { - Error.ThrowOperationCanceledException(); - } - - return Error.ThrowNotYetCompleted(); - } - - public bool MoveNext() - { - if (cancellationToken.IsCancellationRequested) - { - InvokeContinuation(AwaiterStatus.Canceled); - return false; - } - - if (progress != null) - { - progress.Report(asyncOperation.progress); - } - - if (asyncOperation.isDone) - { - this.result = asyncOperation.webRequest; - InvokeContinuation(AwaiterStatus.Succeeded); - return false; - } - - return true; - } - - void InvokeContinuation(AwaiterStatus status) - { - this.status = status; - var cont = this.continuation; - - // cleanup - TaskTracker.RemoveTracking(this); - this.continuation = null; - this.cancellationToken = CancellationToken.None; - this.progress = null; - this.asyncOperation = null; - - if (cont != null) cont.Invoke(); - } - - public void OnCompleted(Action continuation) - { - Error.ThrowWhenContinuationIsAlreadyRegistered(this.continuation); - this.continuation = continuation; - } - - public void UnsafeOnCompleted(Action continuation) - { - Error.ThrowWhenContinuationIsAlreadyRegistered(this.continuation); - this.continuation = continuation; - } - } - -#endif - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.cs.meta deleted file mode 100644 index 6dfab81..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8cc7fd65dd1433e419be4764aeb51391 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.uGUI.cs b/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.uGUI.cs deleted file mode 100644 index b0effcb..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.uGUI.cs +++ /dev/null @@ -1,434 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Runtime.CompilerServices; -using System.Threading; -using UniRx.Async.Internal; -using UnityEngine; -using UnityEngine.Events; -using UnityEngine.UI; -using UniRx.Async.Triggers; - -namespace UniRx.Async -{ - public static partial class UnityAsyncExtensions - { - public static AsyncUnityEventHandler GetAsyncEventHandler(this UnityEvent unityEvent, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(unityEvent, cancellationToken, false); - } - - public static UniTask OnInvokeAsync(this UnityEvent unityEvent, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(unityEvent, cancellationToken, true).OnInvokeAsync(); - } - - public static IAsyncClickEventHandler GetAsyncClickEventHandler(this Button button) - { - return new AsyncUnityEventHandler(button.onClick, button.GetCancellationTokenOnDestroy(), false); - } - - public static IAsyncClickEventHandler GetAsyncClickEventHandler(this Button button, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(button.onClick, cancellationToken, false); - } - - public static UniTask OnClickAsync(this Button button) - { - return new AsyncUnityEventHandler(button.onClick, button.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); - } - - public static UniTask OnClickAsync(this Button button, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(button.onClick, cancellationToken, true).OnInvokeAsync(); - } - - public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Toggle toggle) - { - return new AsyncUnityEventHandler(toggle.onValueChanged, toggle.GetCancellationTokenOnDestroy(), false); - } - - public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Toggle toggle, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(toggle.onValueChanged, cancellationToken, false); - } - - public static UniTask OnValueChangedAsync(this Toggle toggle) - { - return new AsyncUnityEventHandler(toggle.onValueChanged, toggle.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); - } - - public static UniTask OnValueChangedAsync(this Toggle toggle, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(toggle.onValueChanged, cancellationToken, true).OnInvokeAsync(); - } - - public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Scrollbar scrollbar) - { - return new AsyncUnityEventHandler(scrollbar.onValueChanged, scrollbar.GetCancellationTokenOnDestroy(), false); - } - - public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Scrollbar scrollbar, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(scrollbar.onValueChanged, cancellationToken, false); - } - - public static UniTask OnValueChangedAsync(this Scrollbar scrollbar) - { - return new AsyncUnityEventHandler(scrollbar.onValueChanged, scrollbar.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); - } - - public static UniTask OnValueChangedAsync(this Scrollbar scrollbar, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(scrollbar.onValueChanged, cancellationToken, true).OnInvokeAsync(); - } - - public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this ScrollRect scrollRect) - { - return new AsyncUnityEventHandler(scrollRect.onValueChanged, scrollRect.GetCancellationTokenOnDestroy(), false); - } - - public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this ScrollRect scrollRect, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(scrollRect.onValueChanged, cancellationToken, false); - } - - public static UniTask OnValueChangedAsync(this ScrollRect scrollRect) - { - return new AsyncUnityEventHandler(scrollRect.onValueChanged, scrollRect.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); - } - - public static UniTask OnValueChangedAsync(this ScrollRect scrollRect, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(scrollRect.onValueChanged, cancellationToken, true).OnInvokeAsync(); - } - - public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Slider slider) - { - return new AsyncUnityEventHandler(slider.onValueChanged, slider.GetCancellationTokenOnDestroy(), false); - } - - public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Slider slider, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(slider.onValueChanged, cancellationToken, false); - } - - public static UniTask OnValueChangedAsync(this Slider slider) - { - return new AsyncUnityEventHandler(slider.onValueChanged, slider.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); - } - - public static UniTask OnValueChangedAsync(this Slider slider, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(slider.onValueChanged, cancellationToken, true).OnInvokeAsync(); - } - - public static IAsyncEndEditEventHandler GetAsyncEndEditEventHandler(this InputField inputField) - { - return new AsyncUnityEventHandler(inputField.onEndEdit, inputField.GetCancellationTokenOnDestroy(), false); - } - - public static IAsyncEndEditEventHandler GetAsyncEndEditEventHandler(this InputField inputField, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(inputField.onEndEdit, cancellationToken, false); - } - - public static UniTask OnEndEditAsync(this InputField inputField) - { - return new AsyncUnityEventHandler(inputField.onEndEdit, inputField.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); - } - - public static UniTask OnEndEditAsync(this InputField inputField, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(inputField.onEndEdit, cancellationToken, true).OnInvokeAsync(); - } - - public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Dropdown dropdown) - { - return new AsyncUnityEventHandler(dropdown.onValueChanged, dropdown.GetCancellationTokenOnDestroy(), false); - } - - public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Dropdown dropdown, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(dropdown.onValueChanged, cancellationToken, false); - } - - public static UniTask OnValueChanged(this Dropdown dropdown) - { - return new AsyncUnityEventHandler(dropdown.onValueChanged, dropdown.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); - } - - public static UniTask OnValueChanged(this Dropdown dropdown, CancellationToken cancellationToken) - { - return new AsyncUnityEventHandler(dropdown.onValueChanged, cancellationToken, true).OnInvokeAsync(); - } - } - - public interface IAsyncClickEventHandler : IDisposable - { - UniTask OnClickAsync(); - UniTask OnClickAsyncSuppressCancellationThrow(); - } - - public interface IAsyncValueChangedEventHandler : IDisposable - { - UniTask OnValueChangedAsync(); - UniTask<(bool IsCanceled, T Result)> OnValueChangedAsyncSuppressCancellationThrow(); - } - - public interface IAsyncEndEditEventHandler : IDisposable - { - UniTask OnEndEditAsync(); - UniTask<(bool IsCanceled, T Result)> OnEndEditAsyncSuppressCancellationThrow(); - } - - // event handler is reusable when callOnce = false. - public class AsyncUnityEventHandler : IAwaiter, IDisposable, IAsyncClickEventHandler - { - static Action cancellationCallback = CancellationCallback; - - readonly UnityAction action; - readonly UnityEvent unityEvent; - Action continuation; - CancellationTokenRegistration registration; - bool isDisposed; - bool callOnce; - UniTask? suppressCancellationThrowTask; - - public AsyncUnityEventHandler(UnityEvent unityEvent, CancellationToken cancellationToken, bool callOnce) - { - this.callOnce = callOnce; - - if (cancellationToken.IsCancellationRequested) - { - isDisposed = true; - return; - } - - action = Invoke; - unityEvent.AddListener(action); - this.unityEvent = unityEvent; - - if (cancellationToken.CanBeCanceled) - { - registration = cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallback, this); - } - - TaskTracker.TrackActiveTask(this, 3); - } - - public UniTask OnInvokeAsync() - { - // zero allocation wait handler. - return new UniTask(this); - } - - public UniTask OnInvokeAsyncSuppressCancellationThrow() - { - if (suppressCancellationThrowTask == null) - { - suppressCancellationThrowTask = OnInvokeAsync().SuppressCancellationThrow(); - } - return suppressCancellationThrowTask.Value; - } - - void Invoke() - { - var c = continuation; - continuation = null; - if (c != null) - { - c.Invoke(); - } - } - - static void CancellationCallback(object state) - { - var self = (AsyncUnityEventHandler)state; - self.Dispose(); - self.Invoke(); // call continuation if exists yet(GetResult -> throw OperationCanceledException). - } - - public void Dispose() - { - if (!isDisposed) - { - isDisposed = true; - TaskTracker.RemoveTracking(this); - registration.Dispose(); - if (unityEvent != null) - { - unityEvent.RemoveListener(action); - } - } - } - - bool IAwaiter.IsCompleted => isDisposed ? true : false; - AwaiterStatus IAwaiter.Status => isDisposed ? AwaiterStatus.Canceled : AwaiterStatus.Pending; - void IAwaiter.GetResult() - { - if (isDisposed) throw new OperationCanceledException(); - if (callOnce) Dispose(); - } - - void INotifyCompletion.OnCompleted(Action action) - { - ((ICriticalNotifyCompletion)this).UnsafeOnCompleted(action); - } - - void ICriticalNotifyCompletion.UnsafeOnCompleted(Action action) - { - Error.ThrowWhenContinuationIsAlreadyRegistered(this.continuation); - this.continuation = action; - } - - // Interface events. - - UniTask IAsyncClickEventHandler.OnClickAsync() - { - return OnInvokeAsync(); - } - - UniTask IAsyncClickEventHandler.OnClickAsyncSuppressCancellationThrow() - { - return OnInvokeAsyncSuppressCancellationThrow(); - } - } - - // event handler is reusable when callOnce = false. - public class AsyncUnityEventHandler : IAwaiter, IDisposable, IAsyncValueChangedEventHandler, IAsyncEndEditEventHandler - { - static Action cancellationCallback = CancellationCallback; - - readonly UnityAction action; - readonly UnityEvent unityEvent; - Action continuation; - CancellationTokenRegistration registration; - bool isDisposed; - T eventValue; - bool callOnce; - UniTask<(bool, T)>? suppressCancellationThrowTask; - - public AsyncUnityEventHandler(UnityEvent unityEvent, CancellationToken cancellationToken, bool callOnce) - { - this.callOnce = callOnce; - - if (cancellationToken.IsCancellationRequested) - { - isDisposed = true; - return; - } - - action = Invoke; - unityEvent.AddListener(action); - this.unityEvent = unityEvent; - - if (cancellationToken.CanBeCanceled) - { - registration = cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallback, this); - } - - TaskTracker.TrackActiveTask(this, 3); - } - - public UniTask OnInvokeAsync() - { - // zero allocation wait handler. - return new UniTask(this); - } - - public UniTask<(bool IsCanceled, T Result)> OnInvokeAsyncSuppressCancellationThrow() - { - if (suppressCancellationThrowTask == null) - { - suppressCancellationThrowTask = OnInvokeAsync().SuppressCancellationThrow(); - } - return suppressCancellationThrowTask.Value; - } - - void Invoke(T value) - { - this.eventValue = value; - - var c = continuation; - continuation = null; - if (c != null) - { - c.Invoke(); - } - } - - static void CancellationCallback(object state) - { - var self = (AsyncUnityEventHandler)state; - self.Dispose(); - self.Invoke(default(T)); // call continuation if exists yet(GetResult -> throw OperationCanceledException). - } - - public void Dispose() - { - if (!isDisposed) - { - isDisposed = true; - TaskTracker.RemoveTracking(this); - registration.Dispose(); - if (unityEvent != null) - { - unityEvent.RemoveListener(action); - } - } - } - - bool IAwaiter.IsCompleted => isDisposed ? true : false; - AwaiterStatus IAwaiter.Status => isDisposed ? AwaiterStatus.Canceled : AwaiterStatus.Pending; - - T IAwaiter.GetResult() - { - if (isDisposed) throw new OperationCanceledException(); - if (callOnce) Dispose(); - return eventValue; - } - - void IAwaiter.GetResult() - { - if (isDisposed) throw new OperationCanceledException(); - if (callOnce) Dispose(); - } - - void INotifyCompletion.OnCompleted(Action action) - { - ((ICriticalNotifyCompletion)this).UnsafeOnCompleted(action); - } - - void ICriticalNotifyCompletion.UnsafeOnCompleted(Action action) - { - Error.ThrowWhenContinuationIsAlreadyRegistered(this.continuation); - this.continuation = action; - } - - // Interface events. - - UniTask IAsyncValueChangedEventHandler.OnValueChangedAsync() - { - return OnInvokeAsync(); - } - - UniTask<(bool IsCanceled, T Result)> IAsyncValueChangedEventHandler.OnValueChangedAsyncSuppressCancellationThrow() - { - return OnInvokeAsyncSuppressCancellationThrow(); - } - - UniTask IAsyncEndEditEventHandler.OnEndEditAsync() - { - return OnInvokeAsync(); - } - - UniTask<(bool IsCanceled, T Result)> IAsyncEndEditEventHandler.OnEndEditAsyncSuppressCancellationThrow() - { - return OnInvokeAsyncSuppressCancellationThrow(); - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.uGUI.cs.meta b/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.uGUI.cs.meta deleted file mode 100644 index 90c5d51..0000000 --- a/Assets/Plugins/UniRx/Scripts/Async/UnityAsyncExtensions.uGUI.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6804799fba2376d4099561d176101aff -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Asynchronous.meta b/Assets/Plugins/UniRx/Scripts/Asynchronous.meta index 4de28ae..41660a7 100644 --- a/Assets/Plugins/UniRx/Scripts/Asynchronous.meta +++ b/Assets/Plugins/UniRx/Scripts/Asynchronous.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 683bdf552f52d19428a6f664d9f37bd2 +guid: c490b3110ff2a524ea963382652a378f folderAsset: yes +timeCreated: 1455373896 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Asynchronous/WebRequestExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Asynchronous/WebRequestExtensions.cs.meta index 5be850f..58d8718 100644 --- a/Assets/Plugins/UniRx/Scripts/Asynchronous/WebRequestExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Asynchronous/WebRequestExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 457f0007b2c70e34e9929ec8f0e2c4e6 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables.meta b/Assets/Plugins/UniRx/Scripts/Disposables.meta index f0479a7..4070ff2 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 77ca67bba7f57874586fd7e17790b52b +guid: d061218ef48281148bb1a996d971bdbe folderAsset: yes +timeCreated: 1455373896 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/BooleanDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/BooleanDisposable.cs.meta index 4fe8917..77fe320 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/BooleanDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/BooleanDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4ff95c6eb380ca248984d8c27c1244d0 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/CancellationDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/CancellationDisposable.cs.meta index 9a05768..5750e92 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/CancellationDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/CancellationDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 6c675907554bfa24d8bd411f386e410d timeCreated: 1475137543 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/CompositeDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/CompositeDisposable.cs.meta index 33e695a..ca51226 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/CompositeDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/CompositeDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a0f9d923bd5f4cd47b39bdd83125de27 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/DictionaryDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/DictionaryDisposable.cs.meta index 67adf14..2f6e4bc 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/DictionaryDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/DictionaryDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 702939929fc84d544b12076b76aa73b5 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/Disposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/Disposable.cs.meta index 219760e..2549165 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/Disposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/Disposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 958f291bb8f434740a6d2c08ad5182a0 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/DisposableExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/DisposableExtensions.cs.meta index b584f6b..be386f7 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/DisposableExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/DisposableExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9c4757265ae105441bae71007cbd0184 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/ICancelable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/ICancelable.cs.meta index 6af4cb2..c9ddc40 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/ICancelable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/ICancelable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: b5cd5b0b304c78345a49757b1f6f8ba8 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/MultipleAssignmentDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/MultipleAssignmentDisposable.cs.meta index 40947a9..4e71cbf 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/MultipleAssignmentDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/MultipleAssignmentDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: bb959083576ace749afd55c1e54b02d9 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/RefCountDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/RefCountDisposable.cs.meta index 1dd30f6..c388fe2 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/RefCountDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/RefCountDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2fb5a2cdb138579498eb20d8b7818ad8 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/ScheduledDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/ScheduledDisposable.cs.meta index 6e70e61..5b873ad 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/ScheduledDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/ScheduledDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: db98ce742e859bd4e81db434c3ca3663 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/SerialDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/SerialDisposable.cs.meta index e9a07a8..3b6e544 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/SerialDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/SerialDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 06fb064ad9e4d354ab15ff89f6343243 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/SingleAssignmentDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/SingleAssignmentDisposable.cs.meta index 6fddafa..6beb674 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/SingleAssignmentDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/SingleAssignmentDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7ec869f7548c62748ad57a5c86b2f6ba timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Disposables/StableCompositeDisposable.cs.meta b/Assets/Plugins/UniRx/Scripts/Disposables/StableCompositeDisposable.cs.meta index 85c914f..0c29a6b 100644 --- a/Assets/Plugins/UniRx/Scripts/Disposables/StableCompositeDisposable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Disposables/StableCompositeDisposable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3a9cd9fa22bc6a5439484581f5049cf8 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/EventPattern.cs.meta b/Assets/Plugins/UniRx/Scripts/EventPattern.cs.meta index ad6fa9a..01992d1 100644 --- a/Assets/Plugins/UniRx/Scripts/EventPattern.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/EventPattern.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e4b797bfea1999a499309068b7d7a97e timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil.meta index d12b789..c363e39 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 76ea4c3d60485a64ba51ea44ee237ef9 +guid: 7147cf40e45d9b7468957f2d28b1f2f0 folderAsset: yes +timeCreated: 1455373896 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/AscynLock.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/AscynLock.cs.meta index 11fcee4..fe6cc8b 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/AscynLock.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/AscynLock.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 23dbd656cfe9c5e47b02c3c263e476aa timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/CancellableTaskCompletionSource.cs b/Assets/Plugins/UniRx/Scripts/InternalUtil/CancellableTaskCompletionSource.cs new file mode 100644 index 0000000..7e1e686 --- /dev/null +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/CancellableTaskCompletionSource.cs @@ -0,0 +1,23 @@ +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace UniRx.InternalUtil +{ + internal interface ICancellableTaskCompletionSource + { + bool TrySetException(Exception exception); + bool TrySetCanceled(); + } + + internal class CancellableTaskCompletionSource : TaskCompletionSource, ICancellableTaskCompletionSource + { + + } +} + +#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/AsyncUnit.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/CancellableTaskCompletionSource.cs.meta similarity index 83% rename from Assets/Plugins/UniRx/Scripts/Async/AsyncUnit.cs.meta rename to Assets/Plugins/UniRx/Scripts/InternalUtil/CancellableTaskCompletionSource.cs.meta index e0ee132..a856963 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/AsyncUnit.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/CancellableTaskCompletionSource.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4f95ac245430d304bb5128d13b6becc8 +guid: 622c7ba8630c25b4c911cd1612ee0887 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/ExceptionExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/ExceptionExtensions.cs.meta index aa5a411..33c402c 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/ExceptionExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/ExceptionExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 94d5d10805124b34c8b488ebf3f893eb timeCreated: 1509016318 -licenseType: Free +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/ImmutableList.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/ImmutableList.cs.meta index bb4d1e9..0540370 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/ImmutableList.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/ImmutableList.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: dbafd8a41f556ec40b4bbd46fca2e85c timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/ListObserver.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/ListObserver.cs.meta index f73a979..1eeeef0 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/ListObserver.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/ListObserver.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 889dc2f3c5f44d24a98a2c25510b4346 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/MicroCoroutine.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/MicroCoroutine.cs.meta index e1f9e44..938793b 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/MicroCoroutine.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/MicroCoroutine.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 108be6d634275c94a95eeb2a39de0792 timeCreated: 1462599042 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/PriorityQueue.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/PriorityQueue.cs.meta index 142c4fb..fc78ce6 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/PriorityQueue.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/PriorityQueue.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7956b408e24dc5a4884fe4f5a3d7c858 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/PromiseHelper.cs b/Assets/Plugins/UniRx/Scripts/InternalUtil/PromiseHelper.cs new file mode 100644 index 0000000..9662f29 --- /dev/null +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/PromiseHelper.cs @@ -0,0 +1,26 @@ +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace UniRx.InternalUtil +{ + internal static class PromiseHelper + { + internal static void TrySetResultAll(IEnumerable> source, T value) + { + var rentArray = source.ToArray(); // better to use Arraypool. + var array = rentArray; + var len = rentArray.Length; + for (int i = 0; i < len; i++) + { + array[i].TrySetResult(value); + array[i] = null; + } + } + } +} + +#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/Internal/PromiseHelper.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/PromiseHelper.cs.meta similarity index 83% rename from Assets/Plugins/UniRx/Scripts/Async/Internal/PromiseHelper.cs.meta rename to Assets/Plugins/UniRx/Scripts/InternalUtil/PromiseHelper.cs.meta index dfc1c50..6d7ba4f 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Internal/PromiseHelper.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/PromiseHelper.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 173f9b763911bf847b7dfbf31ee87fc4 +guid: daa7aa90cece0fe40920a35e79f526dd MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/ScheduledItem.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/ScheduledItem.cs.meta index 91514e6..a15fa43 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/ScheduledItem.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/ScheduledItem.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 45457ee4a77967347828238b7a52b851 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/InternalUtil/ThreadSafeQueueWorker.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/ThreadSafeQueueWorker.cs.meta index a1b4b1e..f430ea0 100644 --- a/Assets/Plugins/UniRx/Scripts/InternalUtil/ThreadSafeQueueWorker.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/ThreadSafeQueueWorker.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 768cbfcbe2a8e704a8953eea28cd33df timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Async/UnityEqualityComparer.cs b/Assets/Plugins/UniRx/Scripts/InternalUtil/UnityEqualityComparer.cs similarity index 98% rename from Assets/Plugins/UniRx/Scripts/Async/UnityEqualityComparer.cs rename to Assets/Plugins/UniRx/Scripts/InternalUtil/UnityEqualityComparer.cs index d69bf09..98abdf1 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UnityEqualityComparer.cs +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/UnityEqualityComparer.cs @@ -4,17 +4,12 @@ using System; using System.Collections.Generic; -#if !UniRxLibrary using UnityEngine; -#endif - -// share between UniRx and UniRx.Async -namespace UniRx +namespace UniRx.InternalUtil { - public static class UnityEqualityComparer + internal static class UnityEqualityComparer { -#if !UniRxLibrary public static readonly IEqualityComparer Vector2 = new Vector2EqualityComparer(); public static readonly IEqualityComparer Vector3 = new Vector3EqualityComparer(); public static readonly IEqualityComparer Vector4 = new Vector4EqualityComparer(); @@ -32,7 +27,6 @@ public static class UnityEqualityComparer static readonly RuntimeTypeHandle rectType = typeof(Rect).TypeHandle; static readonly RuntimeTypeHandle boundsType = typeof(Bounds).TypeHandle; static readonly RuntimeTypeHandle quaternionType = typeof(Quaternion).TypeHandle; -#endif #if UNITY_2017_2_OR_NEWER @@ -77,7 +71,6 @@ static object GetDefaultHelper(Type type) { var t = type.TypeHandle; -#if !UniRxLibrary if (t.Equals(vector2Type)) return (object)UnityEqualityComparer.Vector2; if (t.Equals(vector3Type)) return (object)UnityEqualityComparer.Vector3; if (t.Equals(vector4Type)) return (object)UnityEqualityComparer.Vector4; @@ -86,7 +79,6 @@ static object GetDefaultHelper(Type type) if (t.Equals(rectType)) return (object)UnityEqualityComparer.Rect; if (t.Equals(boundsType)) return (object)UnityEqualityComparer.Bounds; if (t.Equals(quaternionType)) return (object)UnityEqualityComparer.Quaternion; -#endif #if UNITY_2017_2_OR_NEWER @@ -100,8 +92,6 @@ static object GetDefaultHelper(Type type) return null; } - #if !UniRxLibrary - sealed class Vector2EqualityComparer : IEqualityComparer { public bool Equals(Vector2 self, Vector2 vector) @@ -206,8 +196,6 @@ public int GetHashCode(Color32 obj) } } -#endif - #if UNITY_2017_2_OR_NEWER sealed class Vector2IntEqualityComparer : IEqualityComparer diff --git a/Assets/Plugins/UniRx/Scripts/Async/UnityEqualityComparer.cs.meta b/Assets/Plugins/UniRx/Scripts/InternalUtil/UnityEqualityComparer.cs.meta similarity index 83% rename from Assets/Plugins/UniRx/Scripts/Async/UnityEqualityComparer.cs.meta rename to Assets/Plugins/UniRx/Scripts/InternalUtil/UnityEqualityComparer.cs.meta index 190dfac..3550ec5 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UnityEqualityComparer.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/InternalUtil/UnityEqualityComparer.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5fa41dc096a805641ae7f58112ddb3cf +guid: 626a410137515ac45bb59d1ca91d8f3f MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Plugins/UniRx/Scripts/Notification.cs.meta b/Assets/Plugins/UniRx/Scripts/Notification.cs.meta index 75ed5fa..e4addd2 100644 --- a/Assets/Plugins/UniRx/Scripts/Notification.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Notification.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 169d02559aa6b3e459fbae10f2acecd8 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Notifiers.meta b/Assets/Plugins/UniRx/Scripts/Notifiers.meta index 10b7079..0202f53 100644 --- a/Assets/Plugins/UniRx/Scripts/Notifiers.meta +++ b/Assets/Plugins/UniRx/Scripts/Notifiers.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 2223439371f910b40901d01f22f92481 +guid: 63388f4f94a67e34590e2167d45e4046 folderAsset: yes +timeCreated: 1455373896 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Notifiers/BooleanNotifier.cs.meta b/Assets/Plugins/UniRx/Scripts/Notifiers/BooleanNotifier.cs.meta index b2064e0..ce54772 100644 --- a/Assets/Plugins/UniRx/Scripts/Notifiers/BooleanNotifier.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Notifiers/BooleanNotifier.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 5ee30c0abdddd7241acbe24df0637678 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Notifiers/CountNotifier.cs.meta b/Assets/Plugins/UniRx/Scripts/Notifiers/CountNotifier.cs.meta index 706bb83..6f0d334 100644 --- a/Assets/Plugins/UniRx/Scripts/Notifiers/CountNotifier.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Notifiers/CountNotifier.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 503af1c1dc279164e83011be5110633e timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Notifiers/MessageBroker.cs.meta b/Assets/Plugins/UniRx/Scripts/Notifiers/MessageBroker.cs.meta index a678ef5..9b5001e 100644 --- a/Assets/Plugins/UniRx/Scripts/Notifiers/MessageBroker.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Notifiers/MessageBroker.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9dc5e3c48d083d4418ab67287f050267 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Notifiers/ScheduledNotifier.cs.meta b/Assets/Plugins/UniRx/Scripts/Notifiers/ScheduledNotifier.cs.meta index 00a3217..4fb6aa3 100644 --- a/Assets/Plugins/UniRx/Scripts/Notifiers/ScheduledNotifier.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Notifiers/ScheduledNotifier.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e6f53242e655cbe4e889538216dc9e17 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Aggregate.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Aggregate.cs.meta index a314e4a..cb3a93d 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Aggregate.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Aggregate.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 82339dddb2a9f944785f1555b83d667c timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Awaiter.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Awaiter.cs.meta index 50e9759..b987ebf 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Awaiter.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Awaiter.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: ec3ea3f22d061964c8f06eb9ea78ec42 timeCreated: 1475137543 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Binding.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Binding.cs.meta index b1e96a3..f530f86 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Binding.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Binding.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: bb11a562e64264645b76ad3a8d15d966 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Blocking.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Blocking.cs.meta index 7851640..a6e5153 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Blocking.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Blocking.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4a05ec8aabbdba24388b7b2ae6c4a474 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Concatenate.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Concatenate.cs.meta index bc8b9d2..dc7265e 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Concatenate.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Concatenate.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 18c56bbfaaeedf445874f4246d42b509 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Concurrency.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Concurrency.cs.meta index 06cdb26..3b10a55 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Concurrency.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Concurrency.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a31d38ad13dc4644180647afc28c6045 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Conversions.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Conversions.cs.meta index e3ef7b7..2d19473 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Conversions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Conversions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e32bd7bbf28014b4ab2873cc8de3dea9 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Creation.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Creation.cs.meta index d8ffc64..ce5f14a 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Creation.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Creation.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e63036d2dba75f64382beed512fd086c timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.ErrorHandling.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.ErrorHandling.cs.meta index f78d001..642b290 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.ErrorHandling.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.ErrorHandling.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f40cab35efe24e6448ac8455bc7a4eb9 timeCreated: 1455373902 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Events.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Events.cs.meta index 396fc27..1c9535f 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Events.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Events.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e591aafff0492c94590cf9702f6c408f timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.FromAsync.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.FromAsync.cs.meta index e40ab88..af6816b 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.FromAsync.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.FromAsync.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 601f5bb7bb302a14cb46df717729b8c7 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Joins.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Joins.cs.meta index 561c3c0..ef655ac 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Joins.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Joins.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: dd92425c6c6dec24e9e52677cbc36aa0 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Paging.cs b/Assets/Plugins/UniRx/Scripts/Observable.Paging.cs index 03b5c3d..36f8e16 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Paging.cs +++ b/Assets/Plugins/UniRx/Scripts/Observable.Paging.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; +using UniRx.InternalUtil; using UniRx.Operators; namespace UniRx diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Paging.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Paging.cs.meta index 6017170..cadbdd0 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Paging.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Paging.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f4c9428bf00006d408fcfe4c514ee798 timeCreated: 1455373902 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.Time.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.Time.cs.meta index a0484a3..559bc75 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.Time.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.Time.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7da89fcf95f5c364ca62bbb874005d32 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observable.cs b/Assets/Plugins/UniRx/Scripts/Observable.cs index 3740b03..1f5d10a 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.cs +++ b/Assets/Plugins/UniRx/Scripts/Observable.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Threading; +using UniRx.InternalUtil; using UniRx.Operators; namespace UniRx diff --git a/Assets/Plugins/UniRx/Scripts/Observable.cs.meta b/Assets/Plugins/UniRx/Scripts/Observable.cs.meta index 50ff0a6..1446e1f 100644 --- a/Assets/Plugins/UniRx/Scripts/Observable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a2dd1c80d4559fd4ca9ef62f20d031ab timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Observer.cs.meta b/Assets/Plugins/UniRx/Scripts/Observer.cs.meta index efe223b..b7e528e 100644 --- a/Assets/Plugins/UniRx/Scripts/Observer.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Observer.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 57d25c3f6fa1d334e89c384393252b8a timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators.meta b/Assets/Plugins/UniRx/Scripts/Operators.meta index 1fec0b6..4e9bd91 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: d51c184ac8c7a7a47815d18038fc4600 +guid: b37ab723fc6829344bcb6a5991a4e2a1 folderAsset: yes +timeCreated: 1455373896 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Aggregate.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Aggregate.cs.meta index 1f2cf37..8b0311d 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Aggregate.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Aggregate.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f777fc54ecf275349a3f007e760705b3 timeCreated: 1455373902 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Amb.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Amb.cs.meta index 62e2c86..70893f5 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Amb.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Amb.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: ad1a22922a735ee479baf0e179648532 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/AsObservable.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/AsObservable.cs.meta index 409ea15..3fe746b 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/AsObservable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/AsObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9e4851fd48b2b42469d71b311254877b timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/AsSingleUnitObservable.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/AsSingleUnitObservable.cs.meta index 5d981eb..d08c6ed 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/AsSingleUnitObservable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/AsSingleUnitObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3b5e05dba2d3aca4e9c3a6312bef8690 timeCreated: 1462636004 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/AsUnitObservable.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/AsUnitObservable.cs.meta index 14ea875..bbe2c91 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/AsUnitObservable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/AsUnitObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 236f5f407bf92c949844fcaf450af450 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Buffer.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Buffer.cs.meta index b30149a..e2006a5 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Buffer.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Buffer.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4137aec9640d3ea41a740d677026aa8c timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Cast.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Cast.cs.meta index 87b7a43..d1d27c2 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Cast.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Cast.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e70ae559c9b927742acbff91d50b3b22 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Catch.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Catch.cs.meta index c3259ae..664ef44 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Catch.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Catch.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 404a684db151ca34f8258c6fb373db8d timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/CombineLatest.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/CombineLatest.cs.meta index be62b73..78b2946 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/CombineLatest.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/CombineLatest.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 64910ffa78510ee48b3a395ee5b2cfe1 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Concat.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Concat.cs.meta index ea2836f..3ac2145 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Concat.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Concat.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 740c2691a7e434f439abfdcac75ea809 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ContinueWith.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ContinueWith.cs.meta index 0b7c80f..f691d07 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ContinueWith.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ContinueWith.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: bea59b3eb246d244a99183eeb7f3bad4 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Create.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Create.cs.meta index 1bf20a9..33ab300 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Create.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Create.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: cae9e62bf5eb3dc4e9d93cf6ff606052 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/DefaultIfEmpty.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/DefaultIfEmpty.cs.meta index 736b984..17fe003 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/DefaultIfEmpty.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/DefaultIfEmpty.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 551075cda284fbc489824d153743b1e6 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Defer.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Defer.cs.meta index 681f93e..ee6047f 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Defer.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Defer.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 15ca418b98836d943864b1e8b82f6658 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Delay.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Delay.cs.meta index 1563740..67f9cb4 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Delay.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Delay.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2af9c507ce062994a904e4b5565b49c0 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/DelaySubscription.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/DelaySubscription.cs.meta index 3232eb3..bb9dc06 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/DelaySubscription.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/DelaySubscription.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4f532fc776d5298439cb8f03d52e1211 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Dematerialize.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Dematerialize.cs.meta index 01c30f8..1a0cfc0 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Dematerialize.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Dematerialize.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 80682be7e41afb44581208534f226d38 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Distinct.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Distinct.cs.meta index 6bbb0bd..330e124 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Distinct.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Distinct.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 376a7ed430bff5c4b860af4d23ab6b79 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/DistinctUntilChanged.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/DistinctUntilChanged.cs.meta index f26ca6f..e43b286 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/DistinctUntilChanged.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/DistinctUntilChanged.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a09c4b58f60c22342871c30eaf589f6c timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Do.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Do.cs.meta index e4162a9..3b5f603 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Do.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Do.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8f99ae8870195e34b8618451a95818e0 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Empty.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Empty.cs.meta index 6625cb8..b6a8884 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Empty.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Empty.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9e9a7050a289d3a4aa17cba89e085135 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Finally.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Finally.cs.meta index 772d478..d7ab893 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Finally.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Finally.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9ce919d8f2acf2b47a932e850e399d3a timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/First.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/First.cs.meta index a6c3f8e..c1e9944 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/First.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/First.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8e3093220aeb1d54faa3fca9fe0af6c0 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ForEachAsync.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ForEachAsync.cs.meta index 3ca9296..76086d0 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ForEachAsync.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ForEachAsync.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 5b66ecd2e5290bc4eb8c78a1ccc2d009 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/FromEvent.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/FromEvent.cs.meta index 97fdf21..5284fd9 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/FromEvent.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/FromEvent.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 05fcc5083e94e704ca8f059e4e535ffa timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/GroupBy.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/GroupBy.cs.meta index 1d7b46a..1f2d951 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/GroupBy.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/GroupBy.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7345fc4a6df05ca47ab89ec819bccde6 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/IgnoreElements.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/IgnoreElements.cs.meta index f829b3c..f36f8ce 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/IgnoreElements.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/IgnoreElements.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d6c8ca210619da74b92cbdb3e8c58127 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Last.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Last.cs.meta index 1c33d43..8165fba 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Last.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Last.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 696780c8759162d4b996683ec13d7e0b timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Materialize.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Materialize.cs.meta index aa04020..a949074 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Materialize.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Materialize.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 09d3ba9e6d5fe4643bbf0df943652908 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Merge.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Merge.cs.meta index 50d7fca..936c75d 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Merge.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Merge.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 94158fab525468d4e896a62f633257e6 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Never.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Never.cs.meta index 8e92ea5..50371e6 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Never.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Never.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: b5db8d5c73883214abaf3715002da256 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ObserveOn.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ObserveOn.cs.meta index a4dde12..684cfc2 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ObserveOn.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ObserveOn.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 39df784f492c7404286d05b09a840705 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/OfType.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/OfType.cs.meta index 4cb3e09..3d89902 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/OfType.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/OfType.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 981fd4bf7704404459a0deed254a03e5 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/OperatorObservableBase.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/OperatorObservableBase.cs.meta index 385c56f..25d2cee 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/OperatorObservableBase.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/OperatorObservableBase.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1b94a1a0ae5d509488c6242454216bdb timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/OperatorObserverBase.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/OperatorObserverBase.cs.meta index a58903d..9854d9d 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/OperatorObserverBase.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/OperatorObserverBase.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 258901a4513be8f4a8bfcca91e70bb12 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/PairWise.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/PairWise.cs.meta index 17b6aa0..76d9aa3 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/PairWise.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/PairWise.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f66e4871304e6e74d8548d597457e53c timeCreated: 1455373902 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Range.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Range.cs.meta index f49b0a7..39c12d8 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Range.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Range.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2249fbe589c8d3042ac201c1ab4be76f timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/RefCount.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/RefCount.cs.meta index 66a6675..9343721 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/RefCount.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/RefCount.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 17a77b422aa699d4d8cfbf6de804d238 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Repeat.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Repeat.cs.meta index 6e484c5..345d90a 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Repeat.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Repeat.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 63930706f2ea6e847866fc6d914b0d2e timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/RepeatSafe.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/RepeatSafe.cs.meta index 85c808c..b9b4318 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/RepeatSafe.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/RepeatSafe.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 6458fa5124443dc4bb95ad3d0b743934 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Return.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Return.cs.meta index df54f05..16d6217 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Return.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Return.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 25648117feeec6043bd39468bfab62b7 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Sample.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Sample.cs.meta index dfdce6c..f727436 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Sample.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Sample.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 414e918f6a4dfc549b2a8c916a6325e1 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Scan.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Scan.cs.meta index 87a736e..47c6262 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Scan.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Scan.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 461fecd0ef4d48c4d95aae68c2ca2c1c timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Select.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Select.cs.meta index 9a78495..ccf8119 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Select.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Select.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 997e36ad7b02b804ea1f03d05e60bed5 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/SelectMany.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/SelectMany.cs.meta index 35bc2f6..298569f 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/SelectMany.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/SelectMany.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 6496e8557f6066e4380c32935b6f37c3 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/SelectWhere.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/SelectWhere.cs.meta index e6f2cac..5f8a882 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/SelectWhere.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/SelectWhere.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 6a7561d10967d6b4d9c2a67ffc3b9d85 timeCreated: 1468748731 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Single.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Single.cs.meta index 88c862f..4e94dbd 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Single.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Single.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9a50aee929f403f4ea076fc11f71fc53 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Skip.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Skip.cs.meta index 02833c7..235a4c2 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Skip.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Skip.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1ffcb45c02e14e94bb37c6513b04bb7c timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/SkipUntil.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/SkipUntil.cs.meta index 0e639d2..963abf3 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/SkipUntil.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/SkipUntil.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 52314487e375f3d44a49bc5ceb90adab timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/SkipWhile.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/SkipWhile.cs.meta index 113e94b..eaf6409 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/SkipWhile.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/SkipWhile.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4bc7a1e818d05654694d51e883739cca timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Start.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Start.cs.meta index 9c42432..3efa698 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Start.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Start.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2b99cac67f8c387439619e01a480c465 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/StartWith.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/StartWith.cs.meta index 498a564..c17e3a9 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/StartWith.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/StartWith.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 05df6719453543e458dc3e0d29ac7fa8 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/SubscribeOn.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/SubscribeOn.cs.meta index cf05344..f039a2e 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/SubscribeOn.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/SubscribeOn.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: bff34f363b1797c4396815b5b3a4be1c timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Switch.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Switch.cs.meta index b68dd17..fe3ef6b 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Switch.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Switch.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 5e16cdc638ec3bf41bbd380b75991734 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Synchronize.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Synchronize.cs.meta index c194498..73cd1e5 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Synchronize.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Synchronize.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 31ddcb8477b384b4c9867568f6dc8359 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/SynchronizedObserver.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/SynchronizedObserver.cs.meta index abbaeeb..26e7ec0 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/SynchronizedObserver.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/SynchronizedObserver.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4fd465af6ee05a64f9115b45b58360b7 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Take.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Take.cs.meta index bc171a0..a887e33 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Take.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Take.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 5275fc8bb6611984781d8ccd56b9b572 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/TakeLast.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/TakeLast.cs.meta index 25a0927..50d31bb 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/TakeLast.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/TakeLast.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8ea2ac59577a3214f9fb66ccc62f2ffd timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/TakeUntil.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/TakeUntil.cs.meta index e81affb..eb6f28f 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/TakeUntil.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/TakeUntil.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 163e3eab299b735418c94e634fecd811 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/TakeWhile.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/TakeWhile.cs.meta index beb13c9..51f7197 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/TakeWhile.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/TakeWhile.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d6f2da76023d9734ebb4ed1883fda2bc timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Throttle.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Throttle.cs.meta index 9e6e728..379ddf3 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Throttle.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Throttle.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: dc296a61927394b4b908b385087f23d0 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ThrottleFirst.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ThrottleFirst.cs.meta index 0fe0524..ba66ab0 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ThrottleFirst.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ThrottleFirst.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 32b6a6efbab897b41a055d830a4d9755 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Throw.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Throw.cs.meta index 5a6be2e..6c275d5 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Throw.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Throw.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1e5623719e9b1f1418aa67a63abed4cc timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/TimeInterval.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/TimeInterval.cs.meta index ab4108c..035d753 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/TimeInterval.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/TimeInterval.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 065e40ebd4bd4a848b58a7a90dac881d timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Timeout.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Timeout.cs.meta index c3c77d5..4ec24d2 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Timeout.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Timeout.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a22cd4a86f62fc64384dddb043530703 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Timer.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Timer.cs.meta index 7f55fe4..f9ebcc0 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Timer.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Timer.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 6be220be1da39e14ea87b366c149953e timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Timestamp.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Timestamp.cs.meta index 1313978..dac70a0 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Timestamp.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Timestamp.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d9ec806fec477b243a812e7f609a4453 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ToArray.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ToArray.cs.meta index f2da5ba..0c1405d 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ToArray.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ToArray.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 38d1f7c869353b542af469b0e3fae89a timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ToList.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ToList.cs.meta index 586772b..8290365 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ToList.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ToList.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: cee1b9300a644c9458346c1f80f64197 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ToObservable.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ToObservable.cs.meta index 7714ed0..78a4d0c 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ToObservable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ToObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7cd3ae084c8ca754f9aceca2e18c3af9 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Wait.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Wait.cs.meta index 5291736..e3979a3 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Wait.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Wait.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: ea55c5647aa075b4f894dd37abf5e469 timeCreated: 1455373902 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/WhenAll.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/WhenAll.cs.meta index 4d47c87..f5e559a 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/WhenAll.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/WhenAll.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 0af8ada83db8f8a408ee6e9aa994fbbd timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Where.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Where.cs.meta index b440e73..9e53076 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Where.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Where.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a035699dbe9572548afa47c460bad078 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/WhereSelect.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/WhereSelect.cs.meta index 55d0c46..328b2b9 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/WhereSelect.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/WhereSelect.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f7453a184d42aa34c854977496f381b9 timeCreated: 1468743755 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/WithLatestFrom.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/WithLatestFrom.cs.meta index f94c77c..be6f9f6 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/WithLatestFrom.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/WithLatestFrom.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: eb0bc7125d343ed45bb7e36ff1a53362 timeCreated: 1455373902 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/Zip.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/Zip.cs.meta index f394fdf..b5c1220 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/Zip.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/Zip.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4e92e25f9bb221d478d4af5bcd8b8a2c timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Operators/ZipLatest.cs.meta b/Assets/Plugins/UniRx/Scripts/Operators/ZipLatest.cs.meta index 725334d..e050ab9 100644 --- a/Assets/Plugins/UniRx/Scripts/Operators/ZipLatest.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Operators/ZipLatest.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f84ea50040d682c43811d1d98ae7fec8 timeCreated: 1455373908 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Pair.cs.meta b/Assets/Plugins/UniRx/Scripts/Pair.cs.meta index 16e1017..d7c24ce 100644 --- a/Assets/Plugins/UniRx/Scripts/Pair.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Pair.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7947c520dfd9de94bb381e45dc105752 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Schedulers.meta b/Assets/Plugins/UniRx/Scripts/Schedulers.meta index 984bc16..01beb91 100644 --- a/Assets/Plugins/UniRx/Scripts/Schedulers.meta +++ b/Assets/Plugins/UniRx/Scripts/Schedulers.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: db7122db40f3d67459767aec6aaf271c +guid: ca4cbb2e99a69854d93ad929ef72117b folderAsset: yes +timeCreated: 1455373896 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Schedulers/CurrentThreadScheduler.cs.meta b/Assets/Plugins/UniRx/Scripts/Schedulers/CurrentThreadScheduler.cs.meta index b8bc6a0..e131095 100644 --- a/Assets/Plugins/UniRx/Scripts/Schedulers/CurrentThreadScheduler.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Schedulers/CurrentThreadScheduler.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1d547b5ee71b7284db1fecfcdfa59fac timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Schedulers/IScheduler.cs.meta b/Assets/Plugins/UniRx/Scripts/Schedulers/IScheduler.cs.meta index 5551cf8..ae2adfc 100644 --- a/Assets/Plugins/UniRx/Scripts/Schedulers/IScheduler.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Schedulers/IScheduler.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7409b202c20d3894b9677c8f2a27f3aa timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Schedulers/ImmediateScheduler.cs.meta b/Assets/Plugins/UniRx/Scripts/Schedulers/ImmediateScheduler.cs.meta index 8cad6fe..d2ef97f 100644 --- a/Assets/Plugins/UniRx/Scripts/Schedulers/ImmediateScheduler.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Schedulers/ImmediateScheduler.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 87be5fca34f9b44428b7fb1ce9147860 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Schedulers/Scheduler.cs.meta b/Assets/Plugins/UniRx/Scripts/Schedulers/Scheduler.cs.meta index 0fabcf2..1d2d162 100644 --- a/Assets/Plugins/UniRx/Scripts/Schedulers/Scheduler.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Schedulers/Scheduler.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: bfeb53a7ea29f714798ba6bb3bd70ba4 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Schedulers/ThreadPoolScheduler.cs.meta b/Assets/Plugins/UniRx/Scripts/Schedulers/ThreadPoolScheduler.cs.meta index f748fd1..41a33c3 100644 --- a/Assets/Plugins/UniRx/Scripts/Schedulers/ThreadPoolScheduler.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Schedulers/ThreadPoolScheduler.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f8189a60f4619be489df10eca6a78fbb timeCreated: 1455373902 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Subjects.meta b/Assets/Plugins/UniRx/Scripts/Subjects.meta index 8aa7801..fca8e76 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: a498f16648e620f4099a0add31f6af8d +guid: 660d85cac8b3db241b8e6e333d493d38 folderAsset: yes +timeCreated: 1455373896 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Subjects/AsyncSubject.cs.meta b/Assets/Plugins/UniRx/Scripts/Subjects/AsyncSubject.cs.meta index b994cf8..77e6ed2 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects/AsyncSubject.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects/AsyncSubject.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 137cd44250b484d4ba2390d510f8423f timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Subjects/BehaviorSubject.cs.meta b/Assets/Plugins/UniRx/Scripts/Subjects/BehaviorSubject.cs.meta index b679d0d..40ab73f 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects/BehaviorSubject.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects/BehaviorSubject.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2fa461d2fc0c4ec4999e0b9aff16dd47 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Subjects/ConnectableObservable.cs.meta b/Assets/Plugins/UniRx/Scripts/Subjects/ConnectableObservable.cs.meta index d407f17..c6a0404 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects/ConnectableObservable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects/ConnectableObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8de419b467eded246bc4fc5e70859f73 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Subjects/ISubject.cs.meta b/Assets/Plugins/UniRx/Scripts/Subjects/ISubject.cs.meta index e0c92e5..bad4695 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects/ISubject.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects/ISubject.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e9dbcd28e4f3965408744e0ee03b7bc8 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Subjects/ReplaySubject.cs.meta b/Assets/Plugins/UniRx/Scripts/Subjects/ReplaySubject.cs.meta index 5275283..057102a 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects/ReplaySubject.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects/ReplaySubject.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d9b0c2f29645e1f468259893bf9afb68 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Subjects/Subject.cs.meta b/Assets/Plugins/UniRx/Scripts/Subjects/Subject.cs.meta index 4769776..cb6358f 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects/Subject.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects/Subject.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d5fdc90caca9cbe4b9cd9c3fae81e7f6 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Subjects/SubjectExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Subjects/SubjectExtensions.cs.meta index 9377a3d..ec21501 100644 --- a/Assets/Plugins/UniRx/Scripts/Subjects/SubjectExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Subjects/SubjectExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 359bf19588606a14fb0edc6efa97deaf timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/System.meta b/Assets/Plugins/UniRx/Scripts/System.meta index 9ee2ad7..2a9a64f 100644 --- a/Assets/Plugins/UniRx/Scripts/System.meta +++ b/Assets/Plugins/UniRx/Scripts/System.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: a9082dba9e572004eacba691cbc4568a +guid: e38b8fd0fa968d0438280dbb22012b81 folderAsset: yes +timeCreated: 1455373896 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/System/IObservable.cs.meta b/Assets/Plugins/UniRx/Scripts/System/IObservable.cs.meta index 162258a..f543801 100644 --- a/Assets/Plugins/UniRx/Scripts/System/IObservable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/System/IObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9703f7aad3c6b334badd37c1b41d0d8f timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/System/IObserver.cs.meta b/Assets/Plugins/UniRx/Scripts/System/IObserver.cs.meta index 11e3ec2..82af2d2 100644 --- a/Assets/Plugins/UniRx/Scripts/System/IObserver.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/System/IObserver.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1fc7a9cec9d3b644da7dbcf18ea16270 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/System/IOptimizedObservable.cs.meta b/Assets/Plugins/UniRx/Scripts/System/IOptimizedObservable.cs.meta index 0bb6cbf..c3dfcfd 100644 --- a/Assets/Plugins/UniRx/Scripts/System/IOptimizedObservable.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/System/IOptimizedObservable.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 5a2d3a7c73260e14a875d62586ae28f9 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/System/IProgress.cs.meta b/Assets/Plugins/UniRx/Scripts/System/IProgress.cs.meta index 8432314..7f86694 100644 --- a/Assets/Plugins/UniRx/Scripts/System/IProgress.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/System/IProgress.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a38a024b6babf8d48b7e32f2f8fb8686 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/System/Tuple.cs.meta b/Assets/Plugins/UniRx/Scripts/System/Tuple.cs.meta index 376a26d..3ecf72a 100644 --- a/Assets/Plugins/UniRx/Scripts/System/Tuple.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/System/Tuple.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: be811500a5640704b92de622c9202d48 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/System/Unit.cs.meta b/Assets/Plugins/UniRx/Scripts/System/Unit.cs.meta index 1c9fe58..5eda932 100644 --- a/Assets/Plugins/UniRx/Scripts/System/Unit.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/System/Unit.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 14f6907c0ae17e64c8fc34f08c3038a4 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Tasks.meta b/Assets/Plugins/UniRx/Scripts/Tasks.meta index 2ad881d..67db7d4 100644 --- a/Assets/Plugins/UniRx/Scripts/Tasks.meta +++ b/Assets/Plugins/UniRx/Scripts/Tasks.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 5e4e30d9ac0617842a01698194f50290 +guid: f4389552ae1b4f54fb6d931c0a6efd08 folderAsset: yes +timeCreated: 1475139656 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/Tasks/TaskObservableExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Tasks/TaskObservableExtensions.cs.meta index 8156ead..406e68c 100644 --- a/Assets/Plugins/UniRx/Scripts/Tasks/TaskObservableExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Tasks/TaskObservableExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d4f80d45cec56574e990cc840d1ac16b timeCreated: 1475139656 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Tasks/UniTaskObservableExtensions.cs b/Assets/Plugins/UniRx/Scripts/Tasks/UniTaskObservableExtensions.cs deleted file mode 100644 index d937dc9..0000000 --- a/Assets/Plugins/UniRx/Scripts/Tasks/UniTaskObservableExtensions.cs +++ /dev/null @@ -1,246 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Threading; -using UniRx.Async; - -namespace UniRx -{ - public static class UniTaskObservableExtensions - { - public static UniTask ToUniTask(this IObservable source, CancellationToken cancellationToken = default(CancellationToken), bool useFirstValue = false) - { - var promise = new UniTaskCompletionSource(); - var disposable = new SingleAssignmentDisposable(); - - var observer = useFirstValue - ? (IObserver)new FirstValueToUniTaskObserver(promise, disposable, cancellationToken) - : (IObserver)new ToUniTaskObserver(promise, disposable, cancellationToken); - - try - { - disposable.Disposable = source.Subscribe(observer); - } - catch (Exception ex) - { - promise.TrySetException(ex); - } - - return promise.Task; - } - - public static IObservable ToObservable(this UniTask task) - { - if (task.IsCompleted) - { - try - { - return Observable.Return(task.GetAwaiter().GetResult()); - } - catch (Exception ex) - { - return Observable.Throw(ex); - } - } - - var subject = new AsyncSubject(); - Fire(subject, task).Forget(); - return subject; - } - - public static IObservable ToObservable(this UniTask task) - { - if (task.IsCompleted) - { - try - { - return Observable.ReturnUnit(); - } - catch (Exception ex) - { - return Observable.Throw(ex); - } - } - - var subject = new AsyncSubject(); - Fire(subject, task).Forget(); - return subject; - } - - static async UniTaskVoid Fire(AsyncSubject subject, UniTask task) - { - try - { - var value = await task; - subject.OnNext(value); - subject.OnCompleted(); - } - catch (Exception ex) - { - subject.OnError(ex); - } - } - - static async UniTaskVoid Fire(AsyncSubject subject, UniTask task) - { - try - { - await task; - subject.OnNext(Unit.Default); - subject.OnCompleted(); - } - catch (Exception ex) - { - subject.OnError(ex); - } - } - - class ToUniTaskObserver : IObserver - { - static readonly Action callback = OnCanceled; - - readonly UniTaskCompletionSource promise; - readonly SingleAssignmentDisposable disposable; - readonly CancellationToken cancellationToken; - readonly CancellationTokenRegistration registration; - - bool hasValue; - T latestValue; - - public ToUniTaskObserver(UniTaskCompletionSource promise, SingleAssignmentDisposable disposable, CancellationToken cancellationToken) - { - this.promise = promise; - this.disposable = disposable; - this.cancellationToken = cancellationToken; - - if (this.cancellationToken.CanBeCanceled) - { - this.registration = this.cancellationToken.RegisterWithoutCaptureExecutionContext(callback, this); - } - } - - static void OnCanceled(object state) - { - var self = (ToUniTaskObserver)state; - self.disposable.Dispose(); - self.promise.TrySetCanceled(); - } - - public void OnNext(T value) - { - hasValue = true; - latestValue = value; - } - - public void OnError(Exception error) - { - try - { - promise.TrySetException(error); - } - finally - { - registration.Dispose(); - disposable.Dispose(); - } - } - - public void OnCompleted() - { - try - { - if (hasValue) - { - promise.TrySetResult(latestValue); - } - else - { - promise.TrySetException(new InvalidOperationException("Sequence has no elements")); - } - } - finally - { - registration.Dispose(); - disposable.Dispose(); - } - } - } - - class FirstValueToUniTaskObserver : IObserver - { - static readonly Action callback = OnCanceled; - - readonly UniTaskCompletionSource promise; - readonly SingleAssignmentDisposable disposable; - readonly CancellationToken cancellationToken; - readonly CancellationTokenRegistration registration; - - bool hasValue; - - public FirstValueToUniTaskObserver(UniTaskCompletionSource promise, SingleAssignmentDisposable disposable, CancellationToken cancellationToken) - { - this.promise = promise; - this.disposable = disposable; - this.cancellationToken = cancellationToken; - - if (this.cancellationToken.CanBeCanceled) - { - this.registration = this.cancellationToken.RegisterWithoutCaptureExecutionContext(callback, this); - } - } - - static void OnCanceled(object state) - { - var self = (FirstValueToUniTaskObserver)state; - self.disposable.Dispose(); - self.promise.TrySetCanceled(); - } - - public void OnNext(T value) - { - hasValue = true; - try - { - promise.TrySetResult(value); - } - finally - { - registration.Dispose(); - disposable.Dispose(); - } - } - - public void OnError(Exception error) - { - try - { - promise.TrySetException(error); - } - finally - { - registration.Dispose(); - disposable.Dispose(); - } - } - - public void OnCompleted() - { - try - { - if (!hasValue) - { - promise.TrySetException(new InvalidOperationException("Sequence has no elements")); - } - } - finally - { - registration.Dispose(); - disposable.Dispose(); - } - } - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Tasks/UniTaskObservableExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/Tasks/UniTaskObservableExtensions.cs.meta deleted file mode 100644 index 0bb1eba..0000000 --- a/Assets/Plugins/UniRx/Scripts/Tasks/UniTaskObservableExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c1ca394e8fa201840afc3d7af2917014 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/TimeInterval.cs.meta b/Assets/Plugins/UniRx/Scripts/TimeInterval.cs.meta index e7329f1..259eba8 100644 --- a/Assets/Plugins/UniRx/Scripts/TimeInterval.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/TimeInterval.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: dd48622e783cadc47af9a6b456ac8438 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/Timestamped.cs.meta b/Assets/Plugins/UniRx/Scripts/Timestamped.cs.meta index 6eb3903..1319fe8 100644 --- a/Assets/Plugins/UniRx/Scripts/Timestamped.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/Timestamped.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: c1d908b82d0e2b4489d3351a484e5eae timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UniRx.asmdef b/Assets/Plugins/UniRx/Scripts/UniRx.asmdef index 91fdcd9..2339898 100644 --- a/Assets/Plugins/UniRx/Scripts/UniRx.asmdef +++ b/Assets/Plugins/UniRx/Scripts/UniRx.asmdef @@ -1,10 +1,12 @@ { "name": "UniRx", - "references": [ - "UniRx.Async" - ], - "optionalUnityReferences": [], + "references": [], "includePlatforms": [], "excludePlatforms": [], - "allowUnsafeCode": false + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [] } \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge.meta index f32a923..e0e2d7b 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 33caec847c56d5b47ae6ba89d27a18a4 +guid: c6fa31db6d33195438d3a9c49effc512 folderAsset: yes +timeCreated: 1455373896 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AsyncOperationExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AsyncOperationExtensions.cs.meta index d261ab7..1e33df4 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AsyncOperationExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/AsyncOperationExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 245d77a29b1ece34e96bfc80f8c825d8 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CancellationToken.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CancellationToken.cs.meta index ebefcbc..b376a5a 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CancellationToken.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CancellationToken.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e02a1bf45f8861048a6014cf7eab1825 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CoroutineAsyncBridge.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CoroutineAsyncBridge.cs.meta index 2efbac5..0c245dd 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CoroutineAsyncBridge.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/CoroutineAsyncBridge.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 93ca3de3810199947871ab4a77014fa3 timeCreated: 1475193276 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics.meta index cf18141..852204b 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: a2e9fc22f60bc9d49bd3e964610fa541 +guid: 125ca82be137b8544a2b65f7150ee2d4 folderAsset: yes +timeCreated: 1455373896 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntry.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntry.cs.meta index 7669e9f..6fb7092 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntry.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntry.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 53917e87e91c0e4449402e5d85a04765 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntryExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntryExtensions.cs.meta index f4303f0..f71269d 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntryExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/LogEntryExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8706ef5a13e53ec46b4848a7eec5e826 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/Logger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/Logger.cs.meta index 348f963..e8e4fd7 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/Logger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/Logger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f0ecf366503cb0644bdd90934d24da62 timeCreated: 1455373902 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableDebugExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableDebugExtensions.cs.meta index 9968a5d..4d5f179 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableDebugExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableDebugExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: b43f948e095c3e749a0506709be90d68 timeCreated: 1468662620 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableLogger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableLogger.cs.meta index 84b786e..a2e274e 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableLogger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/ObservableLogger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 063f79dc45f902c459f0955d27b445d7 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/UnityDebugSink.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/UnityDebugSink.cs.meta index b1db84b..c3c63fa 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/UnityDebugSink.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Diagnostics/UnityDebugSink.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 882166c30c3bff841b1e12d62c392e02 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/FrameInterval.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/FrameInterval.cs.meta index 128c3a6..25c6007 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/FrameInterval.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/FrameInterval.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 266d1e44d71e7774c9abc5b23773e3f1 timeCreated: 1467771656 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectableReactiveProperty.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectableReactiveProperty.cs index fdc163f..ac54988 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectableReactiveProperty.cs +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectableReactiveProperty.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using UniRx.InternalUtil; using UnityEngine; namespace UniRx diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectableReactiveProperty.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectableReactiveProperty.cs.meta index 968f323..e6aee10 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectableReactiveProperty.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectableReactiveProperty.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 13c690f353ea23141aca4090d28aaa9c timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectorDisplayDrawer.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectorDisplayDrawer.cs.meta index 1388fb4..9ac054c 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectorDisplayDrawer.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectorDisplayDrawer.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 6180f9fd2198dee44ae7f4a617529ffa timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LifetimeDisposableExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LifetimeDisposableExtensions.cs.meta index a774199..1491bd1 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LifetimeDisposableExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/LifetimeDisposableExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a7474e4acdc541340a1f566b2df46355 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs.meta index 9db2ce3..0825892 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: c3cd207057515c4438a31a6a7b548fe7 timeCreated: 1465903910 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadScheduler.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadScheduler.cs.meta index 64bd220..639fdcf 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadScheduler.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadScheduler.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f141c5dc72b97084a85631367a946ee8 timeCreated: 1455373902 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Observable.Unity.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Observable.Unity.cs.meta index e78c0a2..a5cabe6 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Observable.Unity.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Observable.Unity.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: c6ef0a186b9ceaf41af7f2a9f4006216 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableWWW.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableWWW.cs.meta index cf317e4..a9707e9 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableWWW.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObservableWWW.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: ba71e5544e233dd4b83d4c5a6c696d05 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObserveExtensions.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObserveExtensions.cs index 6bc9d09..a272623 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObserveExtensions.cs +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObserveExtensions.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Threading; +using UniRx.InternalUtil; using UniRx.Triggers; #if !UniRxLibrary diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObserveExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObserveExtensions.cs.meta index 84e9e6c..069346d 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObserveExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ObserveExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8741793924a6c2f4ea22ba27031d531f timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators.meta index 38f26d7..d7a89eb 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 55fb4e5dac4d23c4d824ea04d8722fdb +guid: 4d126dc4a05228e418759d57f7661329 folderAsset: yes +timeCreated: 1455373896 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/BatchFrame.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/BatchFrame.cs.meta index 803040e..6b63eb6 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/BatchFrame.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/BatchFrame.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 74a2b6b8c63d1144f914c7f0d6719a36 timeCreated: 1467771656 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrame.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrame.cs.meta index bff7e5e..ea6fa66 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrame.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrame.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 868f75a703f1a944a801ab9c9b4512aa timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrameSubscription.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrameSubscription.cs.meta index 8755182..ea8341b 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrameSubscription.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/DelayFrameSubscription.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: ecfef95eedf36c2448944fb8932f682c timeCreated: 1455373902 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameInterval.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameInterval.cs.meta index 8604067..19755f9 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameInterval.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameInterval.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a731a1a74be20a04a9d7dedc5ceefab2 timeCreated: 1467771656 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameTimeInterval.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameTimeInterval.cs.meta index 28adfca..931fb59 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameTimeInterval.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FrameTimeInterval.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a55cce9ef638364409d1227a25a32421 timeCreated: 1467771656 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FromCoroutine.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FromCoroutine.cs.meta index 62a69e9..e9dc996 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FromCoroutine.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/FromCoroutine.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e83ddad992535fb4f8a68a1e7ef8be60 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/RepeatUntil.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/RepeatUntil.cs.meta index e2c843c..7f3078e 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/RepeatUntil.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/RepeatUntil.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 93507e8a72a71094f870c8dbe1e5bed8 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SampleFrame.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SampleFrame.cs.meta index e755f50..e59f954 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SampleFrame.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SampleFrame.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e04c7fc1929a3db458bf7ae31bcd9e55 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SubscribeOnMainThread.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SubscribeOnMainThread.cs.meta index bb5461a..573172c 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SubscribeOnMainThread.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/SubscribeOnMainThread.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: da3fd97518766ab43827991b7b5d4270 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFirstFrame.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFirstFrame.cs.meta index e8b8b53..0d6b558 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFirstFrame.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFirstFrame.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3ec92e777b0b4d949967b0663ce8bee8 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFrame.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFrame.cs.meta index 9addfec..380407b 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFrame.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/ThrottleFrame.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2c4ef0bfcfe787543999c7a6cda03c07 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/TimeoutFrame.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/TimeoutFrame.cs.meta index a969e19..108cb9c 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/TimeoutFrame.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Operators/TimeoutFrame.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: c27be0a585d78a944bccd31b86ee6722 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCollection.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCollection.cs.meta index 76579b7..a909b36 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCollection.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCollection.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2e22185fb1dbcef42bc613efd4769011 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs index 25c619d..18471bf 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs @@ -1,21 +1,17 @@ using System; using System.Collections.Generic; using System.Threading; + #if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -using UniRx.Async; -using UniRx.Async.Internal; +using System.Threading.Tasks; +using UniRx.InternalUtil; #endif - namespace UniRx { public interface IReactiveCommand : IObservable { IReadOnlyReactiveProperty CanExecute { get; } bool Execute(T parameter); - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - UniTask WaitUntilExecuteAsync(CancellationToken cancellationToken); -#endif } public interface IAsyncReactiveCommand @@ -23,10 +19,6 @@ public interface IAsyncReactiveCommand IReadOnlyReactiveProperty CanExecute { get; } IDisposable Execute(T parameter); IDisposable Subscribe(Func> asyncAction); - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - UniTask WaitUntilExecuteAsync(CancellationToken cancellationToken); -#endif } /// @@ -104,15 +96,6 @@ public bool Execute(T parameter) if (canExecute.Value) { trigger.OnNext(parameter); - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - commonPromise?.InvokeContinuation(ref parameter); - if (removablePromises != null) - { - PromiseHelper.TrySetResultAll(removablePromises.Values, parameter); - } -#endif - return true; } else @@ -145,65 +128,7 @@ public void Dispose() trigger.OnCompleted(); trigger.Dispose(); canExecuteSubscription.Dispose(); - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - commonPromise?.SetCanceled(); - commonPromise = null; - if (removablePromises != null) - { - foreach (var item in removablePromises) - { - item.Value.SetCanceled(); - } - removablePromises = null; - } -#endif } - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - - static readonly Action Callback = CancelCallback; - ReactivePropertyReusablePromise commonPromise; - Dictionary> removablePromises; - - public UniTask WaitUntilExecuteAsync(CancellationToken cancellationToken) - { - if (IsDisposed) throw new ObjectDisposedException("ReadOnlyReactiveProperty"); - - if (!cancellationToken.CanBeCanceled) - { - if (commonPromise != null) return commonPromise.Task; - commonPromise = new ReactivePropertyReusablePromise(CancellationToken.None); - return commonPromise.Task; - } - - if (removablePromises == null) - { - removablePromises = new Dictionary>(CancellationTokenEqualityComparer.Default); - } - - if (removablePromises.TryGetValue(cancellationToken, out var newPromise)) - { - return newPromise.Task; - } - - newPromise = new ReactivePropertyReusablePromise(cancellationToken); - removablePromises.Add(cancellationToken, newPromise); - cancellationToken.RegisterWithoutCaptureExecutionContext(Callback, Tuple.Create(this, newPromise)); - - return newPromise.Task; - } - - static void CancelCallback(object state) - { - var tuple = (Tuple, ReactivePropertyReusablePromise>)state; - if (tuple.Item1.IsDisposed) return; - - tuple.Item2.SetCanceled(); - tuple.Item1.removablePromises.Remove(tuple.Item2.RegisteredCancelationToken); - } - -#endif } /// @@ -279,7 +204,7 @@ public AsyncReactiveCommand() public AsyncReactiveCommand(IObservable canExecuteSource) { this.canExecuteSource = new ReactiveProperty(true); - this.canExecute = canExecute.CombineLatest(canExecuteSource, (x, y) => x && y).ToReactiveProperty(); + this.canExecute = this.canExecuteSource.CombineLatest(canExecuteSource, (x, y) => x && y).ToReactiveProperty(); } /// @@ -303,14 +228,6 @@ public IDisposable Execute(T parameter) { try { -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - commonPromise?.InvokeContinuation(ref parameter); - if (removablePromises != null) - { - PromiseHelper.TrySetResultAll(removablePromises.Values, parameter); - } -#endif - var asyncState = a[0].Invoke(parameter) ?? Observable.ReturnUnit(); return asyncState.Finally(() => canExecuteSource.Value = true).Subscribe(); } @@ -325,14 +242,6 @@ public IDisposable Execute(T parameter) var xs = new IObservable[a.Length]; try { -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - commonPromise?.InvokeContinuation(ref parameter); - if (removablePromises != null) - { - PromiseHelper.TrySetResultAll(removablePromises.Values, parameter); - } -#endif - for (int i = 0; i < a.Length; i++) { xs[i] = a[i].Invoke(parameter) ?? Observable.ReturnUnit(); @@ -373,66 +282,7 @@ public void Dispose() IsDisposed = true; asyncActions = UniRx.InternalUtil.ImmutableList>>.Empty; - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - commonPromise?.SetCanceled(); - commonPromise = null; - if (removablePromises != null) - { - foreach (var item in removablePromises) - { - item.Value.SetCanceled(); - } - removablePromises = null; - } -#endif - } - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - - static readonly Action Callback = CancelCallback; - ReactivePropertyReusablePromise commonPromise; - Dictionary> removablePromises; - - public UniTask WaitUntilExecuteAsync(CancellationToken cancellationToken) - { - if (IsDisposed) throw new ObjectDisposedException("ReadOnlyReactiveProperty"); - - if (!cancellationToken.CanBeCanceled) - { - if (commonPromise != null) return commonPromise.Task; - commonPromise = new ReactivePropertyReusablePromise(CancellationToken.None); - return commonPromise.Task; - } - - if (removablePromises == null) - { - removablePromises = new Dictionary>(CancellationTokenEqualityComparer.Default); - } - - if (removablePromises.TryGetValue(cancellationToken, out var newPromise)) - { - return newPromise.Task; - } - - newPromise = new ReactivePropertyReusablePromise(cancellationToken); - removablePromises.Add(cancellationToken, newPromise); - cancellationToken.RegisterWithoutCaptureExecutionContext(Callback, Tuple.Create(this, newPromise)); - - return newPromise.Task; - } - - static void CancelCallback(object state) - { - var tuple = (Tuple, ReactivePropertyReusablePromise>)state; - if (tuple.Item1.IsDisposed) return; - - tuple.Item2.SetCanceled(); - tuple.Item1.removablePromises.Remove(tuple.Item2.RegisteredCancelationToken); } - -#endif - class Subscription : IDisposable { readonly AsyncReactiveCommand parent; @@ -474,7 +324,32 @@ public static ReactiveCommand ToReactiveCommand(this IObservable can #if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - public static UniTask.Awaiter GetAwaiter(this IReactiveCommand command) + static readonly Action Callback = CancelCallback; + + static void CancelCallback(object state) + { + var tuple = (Tuple)state; + tuple.Item2.Dispose(); + tuple.Item1.TrySetCanceled(); + } + + public static Task WaitUntilExecuteAsync(this IReactiveCommand source, CancellationToken cancellationToken = default(CancellationToken)) + { + var tcs = new CancellableTaskCompletionSource(); + + var disposable = new SingleAssignmentDisposable(); + disposable.Disposable = source.Subscribe(x => + { + disposable.Dispose(); // finish subscription. + tcs.TrySetResult(x); + }, ex => tcs.TrySetException(ex), () => tcs.TrySetCanceled()); + + cancellationToken.Register(Callback, Tuple.Create(tcs, disposable.Disposable), false); + + return tcs.Task; + } + + public static System.Runtime.CompilerServices.TaskAwaiter GetAwaiter(this IReactiveCommand command) { return command.WaitUntilExecuteAsync(CancellationToken.None).GetAwaiter(); } @@ -535,13 +410,33 @@ public static AsyncReactiveCommand ToAsyncReactiveCommand(this IReactivePr #if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - public static UniTask.Awaiter GetAwaiter(this IAsyncReactiveCommand command) + static readonly Action Callback = CancelCallback; + + static void CancelCallback(object state) + { + var tuple = (Tuple)state; + tuple.Item2.Dispose(); + tuple.Item1.TrySetCanceled(); + } + + public static Task WaitUntilExecuteAsync(this IAsyncReactiveCommand source, CancellationToken cancellationToken = default(CancellationToken)) + { + var tcs = new CancellableTaskCompletionSource(); + + var subscription = source.Subscribe(x => { tcs.TrySetResult(x); return Observable.ReturnUnit(); }); + cancellationToken.Register(Callback, Tuple.Create(tcs, subscription), false); + + return tcs.Task; + } + + public static System.Runtime.CompilerServices.TaskAwaiter GetAwaiter(this IAsyncReactiveCommand command) { return command.WaitUntilExecuteAsync(CancellationToken.None).GetAwaiter(); } #endif + #if !UniRxLibrary // for uGUI(from 4.6) diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs.meta index 10b2694..b9a3d29 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveCommand.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 939b249fde5252f45a4404e7648931ed timeCreated: 1462927720 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveDictionary.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveDictionary.cs.meta index 011f925..4fdc326 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveDictionary.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveDictionary.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 12cd1079b0fe33f429f9f174c1f849af timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs index 3f0b482..d67a81e 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs @@ -5,12 +5,12 @@ using System; using System.Collections.Generic; using System.Threading; +using UniRx.InternalUtil; #if !UniRxLibrary using UnityEngine; #endif #if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) -using UniRx.Async; -using UniRx.Async.Internal; +using System.Threading.Tasks; #endif namespace UniRx @@ -19,10 +19,6 @@ public interface IReadOnlyReactiveProperty : IObservable { T Value { get; } bool HasValue { get; } - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - UniTask WaitUntilValueChangedAsync(CancellationToken cancellationToken); -#endif } public interface IReactiveProperty : IReadOnlyReactiveProperty @@ -156,14 +152,6 @@ void RaiseOnNext(ref T value) node.OnNext(value); node = node.Next; } - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - commonPromise?.InvokeContinuation(ref value); - if (removablePromises != null) - { - PromiseHelper.TrySetResultAll(removablePromises.Values, value); - } -#endif } protected virtual void SetValue(T value) @@ -246,19 +234,6 @@ protected virtual void Dispose(bool disposing) node.OnCompleted(); node = node.Next; } -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - commonPromise?.SetCanceled(); - commonPromise = null; - if (removablePromises != null) - { - foreach (var item in removablePromises) - { - item.Value.SetCanceled(); - } - removablePromises = null; - } -#endif - } public override string ToString() @@ -270,52 +245,6 @@ public bool IsRequiredSubscribeOnCurrentThread() { return false; } - - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - - static readonly Action Callback = CancelCallback; - ReactivePropertyReusablePromise commonPromise; - Dictionary> removablePromises; - - public UniTask WaitUntilValueChangedAsync(CancellationToken cancellationToken) - { - if (isDisposed) throw new ObjectDisposedException("ReactiveProperty"); - - if (!cancellationToken.CanBeCanceled) - { - if (commonPromise != null) return commonPromise.Task; - commonPromise = new ReactivePropertyReusablePromise(CancellationToken.None); - return commonPromise.Task; - } - - if (removablePromises == null) - { - removablePromises = new Dictionary>(CancellationTokenEqualityComparer.Default); - } - - if (removablePromises.TryGetValue(cancellationToken, out var newPromise)) - { - return newPromise.Task; - } - - newPromise = new ReactivePropertyReusablePromise(cancellationToken); - removablePromises.Add(cancellationToken, newPromise); - cancellationToken.RegisterWithoutCaptureExecutionContext(Callback, Tuple.Create(this, newPromise)); - - return newPromise.Task; - } - - static void CancelCallback(object state) - { - var tuple = (Tuple, ReactivePropertyReusablePromise>)state; - if (tuple.Item1.isDisposed) return; - - tuple.Item2.SetCanceled(); - tuple.Item1.removablePromises.Remove(tuple.Item2.RegisteredCancelationToken); - } - -#endif } /// @@ -461,19 +390,6 @@ protected virtual void Dispose(bool disposing) node.OnCompleted(); node = node.Next; } - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - commonPromise?.SetCanceled(); - commonPromise = null; - if (removablePromises != null) - { - foreach (var item in removablePromises) - { - item.Value.SetCanceled(); - } - removablePromises = null; - } -#endif } void IObserverLinkedList.UnsubscribeNode(ObserverNode node) @@ -521,14 +437,6 @@ void IObserver.OnNext(T value) node.OnNext(value); node = node.Next; } - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - commonPromise?.InvokeContinuation(ref value); - if (removablePromises != null) - { - PromiseHelper.TrySetResultAll(removablePromises.Values, value); - } -#endif } void IObserver.OnError(Exception error) @@ -538,7 +446,7 @@ void IObserver.OnError(Exception error) // call source.OnError var node = root; while (node != null) - { + { node.OnError(error); node = node.Next; } @@ -561,51 +469,6 @@ public bool IsRequiredSubscribeOnCurrentThread() { return false; } - -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - - static readonly Action Callback = CancelCallback; - ReactivePropertyReusablePromise commonPromise; - Dictionary> removablePromises; - - public UniTask WaitUntilValueChangedAsync(CancellationToken cancellationToken) - { - if (isDisposed) throw new ObjectDisposedException("ReadOnlyReactiveProperty"); - - if (!cancellationToken.CanBeCanceled) - { - if (commonPromise != null) return commonPromise.Task; - commonPromise = new ReactivePropertyReusablePromise(CancellationToken.None); - return commonPromise.Task; - } - - if (removablePromises == null) - { - removablePromises = new Dictionary>(CancellationTokenEqualityComparer.Default); - } - - if (removablePromises.TryGetValue(cancellationToken, out var newPromise)) - { - return newPromise.Task; - } - - newPromise = new ReactivePropertyReusablePromise(cancellationToken); - removablePromises.Add(cancellationToken, newPromise); - cancellationToken.RegisterWithoutCaptureExecutionContext(Callback, Tuple.Create(this, newPromise)); - - return newPromise.Task; - } - - static void CancelCallback(object state) - { - var tuple = (Tuple, ReactivePropertyReusablePromise>)state; - if (tuple.Item1.isDisposed) return; - - tuple.Item2.SetCanceled(); - tuple.Item1.removablePromises.Remove(tuple.Item2.RegisteredCancelationToken); - } - -#endif } /// @@ -630,14 +493,59 @@ public static ReadOnlyReactiveProperty ToReadOnlyReactiveProperty(this IOb #if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - public static UniTask.Awaiter GetAwaiter(this IReadOnlyReactiveProperty source) + static readonly Action Callback = CancelCallback; + + static void CancelCallback(object state) + { + var tuple = (Tuple)state; + tuple.Item2.Dispose(); + tuple.Item1.TrySetCanceled(); + } + + public static Task WaitUntilValueChangedAsync(this IReadOnlyReactiveProperty source, CancellationToken cancellationToken = default(CancellationToken)) + { + var tcs = new CancellableTaskCompletionSource(); + + var disposable = new SingleAssignmentDisposable(); + if (source.HasValue) + { + // Skip first value + var isFirstValue = true; + disposable.Disposable = source.Subscribe(x => + { + if (isFirstValue) + { + isFirstValue = false; + return; + } + else + { + disposable.Dispose(); // finish subscription. + tcs.TrySetResult(x); + } + }, ex => tcs.TrySetException(ex), () => tcs.TrySetCanceled()); + } + else + { + disposable.Disposable = source.Subscribe(x => + { + disposable.Dispose(); // finish subscription. + tcs.TrySetResult(x); + }, ex => tcs.TrySetException(ex), () => tcs.TrySetCanceled()); + } + + cancellationToken.Register(Callback, Tuple.Create(tcs, disposable.Disposable), false); + + return tcs.Task; + } + + public static System.Runtime.CompilerServices.TaskAwaiter GetAwaiter(this IReadOnlyReactiveProperty source) { return source.WaitUntilValueChangedAsync(CancellationToken.None).GetAwaiter(); } #endif - /// /// Create ReadOnlyReactiveProperty with distinctUntilChanged: false. /// diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs.meta index 7819654..a17fa6d 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactiveProperty.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 88e12aa895fef434fbe3ea0cc8f57301 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactivePropertyReusablePromise.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactivePropertyReusablePromise.cs deleted file mode 100644 index e6af87d..0000000 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactivePropertyReusablePromise.cs +++ /dev/null @@ -1,140 +0,0 @@ -#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) - -#pragma warning disable CS1591 - -using System; -using System.Threading; -using UniRx.Async; -using UniRx.Async.Internal; - -namespace UniRx -{ - internal class ReactivePropertyReusablePromise : IAwaiter, IResolvePromise - { - T result; - object continuation; // Action or Queue - MinimumQueue<(int, T)> queueValues; - bool running; - int waitingContinuationCount; - AwaiterStatus status; - - internal readonly CancellationToken RegisteredCancelationToken; - - public bool IsCompleted => status.IsCompleted(); - public UniTask Task => new UniTask(this); - public AwaiterStatus Status => status; - - public ReactivePropertyReusablePromise(CancellationToken cancellationToken) - { - this.RegisteredCancelationToken = cancellationToken; - this.status = AwaiterStatus.Pending; - - TaskTracker.TrackActiveTask(this, 3); - } - - public T GetResult() - { - if (status == AwaiterStatus.Canceled) throw new OperationCanceledException(); - return result; - } - - void IAwaiter.GetResult() - { - GetResult(); - } - - public void SetCanceled() - { - status = AwaiterStatus.Canceled; - // run rest continuation. - TaskTracker.RemoveTracking(this); - - result = default(T); - InvokeContinuation(ref result); - // clear - continuation = null; - queueValues = null; - } - - public void InvokeContinuation(ref T value) - { - if (continuation == null) return; - - if (continuation is Action act) - { - this.result = value; - continuation = null; - act(); - } - else - { - if (waitingContinuationCount == 0) return; - - var q = (MinimumQueue)continuation; - if (queueValues == null) queueValues = new MinimumQueue<(int, T)>(4); - queueValues.Enqueue((waitingContinuationCount, value)); - waitingContinuationCount = 0; - - if (!running) - { - running = true; - try - { - while (queueValues.Count != 0) - { - var (runCount, v) = queueValues.Dequeue(); - this.result = v; - for (int i = 0; i < runCount; i++) - { - q.Dequeue().Invoke(); - } - } - } - finally - { - running = false; - } - } - } - } - - public void OnCompleted(Action continuation) - { - UnsafeOnCompleted(continuation); - } - - public void UnsafeOnCompleted(Action action) - { - if (continuation == null) - { - continuation = action; - return; - } - else - { - if (continuation is Action act) - { - var q = new MinimumQueue(4); - q.Enqueue(act); - q.Enqueue(action); - continuation = q; - waitingContinuationCount = 2; - return; - } - else - { - ((MinimumQueue)continuation).Enqueue(action); - waitingContinuationCount++; - } - } - } - - bool IResolvePromise.TrySetResult(T value) - { - InvokeContinuation(ref value); - return true; - } - } -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactivePropertyReusablePromise.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactivePropertyReusablePromise.cs.meta deleted file mode 100644 index 428890b..0000000 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ReactivePropertyReusablePromise.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4c3ce1729c826c047afbd8ae1e85a3ab -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ScenePlaybackDetector.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ScenePlaybackDetector.cs.meta index f090f98..3e3e6d7 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ScenePlaybackDetector.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/ScenePlaybackDetector.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8d380d86e2ef6674c83ca983a1604273 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit.meta index a290e81..029446b 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 87f9d8f6c8b0b584a87f87878621769f +guid: 726595c7d6d85824887a77691e3ca50a folderAsset: yes +timeCreated: 1468655394 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit/ObjectPool.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit/ObjectPool.cs.meta index fbf8a1e..ec758de 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit/ObjectPool.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Toolkit/ObjectPool.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f4980e1e001c7e94fab3250ba284dc91 timeCreated: 1468655394 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers.meta index bde02c6..6565449 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 32cf3f2e2edea8b4cb7505281befe757 +guid: 5380144628ecdc74ab6778f80d103d51 folderAsset: yes +timeCreated: 1455373896 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableAnimatorTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableAnimatorTrigger.cs.meta index 8aff60f..f5ef20e 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableAnimatorTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableAnimatorTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e03f9257cc6667f4082439aa77d6f01e timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableBeginDragTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableBeginDragTrigger.cs.meta index 2ec62c4..827f6f2 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableBeginDragTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableBeginDragTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3a81a9b6bec6b4f4fba7e0047cd989f6 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCancelTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCancelTrigger.cs.meta index 9f3b842..105cc04 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCancelTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCancelTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4c0a9070b7cc23746b2c0e2db3ec16cd timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCanvasGroupChangedTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCanvasGroupChangedTrigger.cs.meta index a023c40..b24d785 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCanvasGroupChangedTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCanvasGroupChangedTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 54095d3e740f7714085d0568207cbfe0 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollision2DTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollision2DTrigger.cs.meta index 40ddc3e..f98f99b 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollision2DTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollision2DTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1be7847b61f30f24daa5762db87a5b19 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollisionTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollisionTrigger.cs.meta index 09399cc..f61184c 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollisionTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableCollisionTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 10b917196cbfcf74898ce1686e205d04 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDeselectTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDeselectTrigger.cs.meta index 91bdae0..dd281cf 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDeselectTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDeselectTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9fe6f69c4d869c04e8a1924aab1d3694 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDestroyTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDestroyTrigger.cs.meta index 68d8b53..0899ccf 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDestroyTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDestroyTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: cb219b23cdf4b314f94a27bca3cc8012 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDragTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDragTrigger.cs.meta index ba30a30..3b63ae6 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDragTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDragTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 79db090dc9e4db245821e8b89b0e208e timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDropTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDropTrigger.cs.meta index 1288eb8..a6a9720 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDropTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableDropTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: f2ffa8b5af3474446a310bb6aa0b180a timeCreated: 1455373902 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEnableTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEnableTrigger.cs.meta index 969370b..37c5ea3 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEnableTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEnableTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 0d9c7eb607af1fd4aa0e15f52cc0543b timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEndDragTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEndDragTrigger.cs.meta index e55cd9d..e225db3 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEndDragTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEndDragTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: b8ce8424f238d6842bd8b09c0cca1ac4 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEventTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEventTrigger.cs.meta index cc19548..1574fef 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEventTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableEventTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 48e93426b16d5454c89e8d47ccded1c5 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableFixedUpdateTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableFixedUpdateTrigger.cs.meta index aabc769..6f6a5c8 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableFixedUpdateTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableFixedUpdateTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d525c42c11d945f4398061ed8f84e5f4 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableInitializePotentialDragTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableInitializePotentialDragTrigger.cs.meta index a14ffba..57ce1b2 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableInitializePotentialDragTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableInitializePotentialDragTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3f3148a9e1b8b21409f54d2b0c2c81de timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableLateUpdateTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableLateUpdateTrigger.cs.meta index a62624a..94d5398 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableLateUpdateTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableLateUpdateTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 176ace24965d0c744bc61c8aad8b3fc7 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMouseTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMouseTrigger.cs.meta index 9611b63..ea9f707 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMouseTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMouseTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: c5f30958c5509bc4f9c14ea261a1567c timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMoveTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMoveTrigger.cs.meta index 1964275..7545c17 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMoveTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableMoveTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3e1feec0f10dcea4d9c779a81a0ee3dc timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableParticleTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableParticleTrigger.cs.meta index 184d0fe..d76755d 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableParticleTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableParticleTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9e6a20494274d5045a1b36a770ea76b4 timeCreated: 1468669952 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerClickTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerClickTrigger.cs.meta index b6d86b7..109913e 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerClickTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerClickTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: aa69c313aba23f945b760e79c45083ad timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerDownTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerDownTrigger.cs.meta index 8ca694a..07df119 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerDownTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerDownTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: c7ae5b5965df2344d99ef7792521b937 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerEnterTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerEnterTrigger.cs.meta index 655ddb2..3bb79c6 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerEnterTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerEnterTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3468b3db8d419c745b12124f6432696b timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerExitTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerExitTrigger.cs.meta index 5365e5b..1ce197f 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerExitTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerExitTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 9643e74593988274bbed9adf40384e48 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerUpTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerUpTrigger.cs.meta index ed50e6c..c390c78 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerUpTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservablePointerUpTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 41b0031b2e409894aacafa49d8583617 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableRectTransformTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableRectTransformTrigger.cs.meta index 2cd2e43..d91b250 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableRectTransformTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableRectTransformTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 20b97bcdd98f27346851c3a690ec7faf timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableScrollTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableScrollTrigger.cs.meta index 67afed9..ca981b3 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableScrollTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableScrollTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2231ec04e488f7443ae7acf609ac5f00 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSelectTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSelectTrigger.cs.meta index 3230e07..a76ab32 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSelectTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSelectTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1e4cb287d3ab8274885ed05748f26329 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableStateMachineTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableStateMachineTrigger.cs.meta index 48921b1..7acb5cf 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableStateMachineTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableStateMachineTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1e29959e46c7ea7409560769cde085ae timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSubmitTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSubmitTrigger.cs.meta index fb7cc88..6d8584c 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSubmitTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableSubmitTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 655296fedabd6004ab699ab9749e369c timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTransformChangedTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTransformChangedTrigger.cs.meta index 27fbaa5..2fd5e6d 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTransformChangedTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTransformChangedTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 835e244a602942c4c84a09c9bdedf229 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTrigger2DTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTrigger2DTrigger.cs.meta index 38a7ee3..b3c4918 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTrigger2DTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTrigger2DTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1aad3129752ef804999a880a7b2d72ef timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerBase.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerBase.cs.meta index 00d1d1a..22d4b87 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerBase.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerBase.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 850bc951297608e4fb0722795c21ed16 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.Component.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.Component.cs.meta index ded96f4..b019211 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.Component.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.Component.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d10150b3ca6f3924baae5bce4343f6c4 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.cs.meta index 830b73d..70c9c18 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 3ee4df960144b9042874516111cf2d6c timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerTrigger.cs.meta index b5dd3fe..1c9ddd2 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableTriggerTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: cadcfd987fed8a044b75709fc19ad0f7 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateSelectedTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateSelectedTrigger.cs.meta index 1f3c83c..64d22d2 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateSelectedTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateSelectedTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 4d207a04db328fd4d970c1457530deb3 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateTrigger.cs.meta index 3a2de1a..09f87a4 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableUpdateTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: ceb5e5014f40d6948815a7be8b174ff2 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableVisibleTrigger.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableVisibleTrigger.cs.meta index 9bff2e2..ea2f367 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableVisibleTrigger.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/Triggers/ObservableVisibleTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 03515121745b2d74c8782ce92eb2a1a0 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEventExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEventExtensions.cs.meta index ffe6ade..c911bbb 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEventExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityEventExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e3c4861cc04ac524484d0730a3a5bd4a timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityGraphicExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityGraphicExtensions.cs.meta index e52e1b3..13a9fce 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityGraphicExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityGraphicExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 99be646df339108498ebb70efa1b7bd4 timeCreated: 1455373900 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityUIComponentExtensions.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityUIComponentExtensions.cs.meta index 30075fd..1cdffc4 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityUIComponentExtensions.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/UnityUIComponentExtensions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7645084659bc779448e384456805d251 timeCreated: 1455373899 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/YieldInstructionCache.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/YieldInstructionCache.cs.meta index 9fac1b1..a574f0a 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/YieldInstructionCache.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/YieldInstructionCache.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2493deaccf35b0542800b0851771e665 timeCreated: 1455373897 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge.meta b/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge.meta index 086e5ec..33c919c 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 383c6945ed8402f4dac000cefd6f173e +guid: 2c03c70869bcd0240b96959097acc29d folderAsset: yes +timeCreated: 1455373896 +licenseType: Store DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/Thread.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/Thread.cs.meta index a46af85..85c96d8 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/Thread.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/Thread.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: bf1175d5dd9b5904d898eb4c9dd7e0c5 timeCreated: 1455373901 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/ThreadPoolScheduler_UnityWinRT.cs.meta b/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/ThreadPoolScheduler_UnityWinRT.cs.meta index dfa8aab..72486f7 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/ThreadPoolScheduler_UnityWinRT.cs.meta +++ b/Assets/Plugins/UniRx/Scripts/UnityWinRTBridge/ThreadPoolScheduler_UnityWinRT.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 2c36c9256c17bbb40854ef9b9e4d51c7 timeCreated: 1455373898 -licenseType: Pro +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/TestScene.unity b/Assets/TestScene.unity index 1cbd18a..da50c44 100644 --- a/Assets/TestScene.unity +++ b/Assets/TestScene.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657844, g: 0.49641222, b: 0.57481694, a: 1} + m_IndirectSpecularColor: {r: 0.18028334, g: 0.2257134, b: 0.30692226, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -50,12 +50,11 @@ LightmapSettings: m_BounceScale: 1 m_IndirectOutputScale: 1 m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 m_EnvironmentLightingMode: 0 m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 10 + serializedVersion: 12 m_Resolution: 2 m_BakeResolution: 40 m_AtlasSize: 1024 @@ -63,6 +62,7 @@ LightmapSettings: m_AOMaxDistance: 1 m_CompAOExponent: 1 m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 m_Padding: 2 m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 @@ -77,10 +77,16 @@ LightmapSettings: m_PVRDirectSampleCount: 32 m_PVRSampleCount: 500 m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 m_PVRFilterTypeDirect: 0 m_PVRFilterTypeIndirect: 0 m_PVRFilterTypeAO: 0 - m_PVRFilteringMode: 1 + m_PVREnvironmentMIS: 0 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 m_PVRFilteringGaussRadiusIndirect: 5 @@ -88,7 +94,9 @@ LightmapSettings: m_PVRFilteringAtrousPositionSigmaDirect: 0.5 m_PVRFilteringAtrousPositionSigmaIndirect: 2 m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ShowResolutionOverlay: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 m_LightingDataAsset: {fileID: 0} m_UseShadowmask: 1 --- !u!196 &4 @@ -117,7 +125,8 @@ NavMeshSettings: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 132278582} @@ -136,7 +145,8 @@ GameObject: MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 132278577} m_Enabled: 1 m_EditorHideFlags: 0 @@ -152,7 +162,8 @@ MonoBehaviour: MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 132278577} m_Enabled: 1 m_CastShadows: 1 @@ -161,7 +172,9 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: e57457a42a153bd4894a06d8105866c5, type: 2} m_StaticBatchInfo: @@ -171,6 +184,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -187,7 +201,8 @@ MeshRenderer: BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 132278577} m_Material: {fileID: 0} m_IsTrigger: 0 @@ -199,14 +214,16 @@ BoxCollider: MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 132278577} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &132278582 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 132278577} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 37.41, y: 0.5, z: 23.24} @@ -219,7 +236,8 @@ Transform: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 271199288} @@ -238,27 +256,32 @@ GameObject: AudioListener: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 271199282} m_Enabled: 1 --- !u!124 &271199285 Behaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 271199282} m_Enabled: 1 --- !u!20 &271199287 Camera: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 271199282} m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 2 m_BackGroundColor: {r: 0.15084341, g: 0.18082586, b: 0.22794116, a: 0} m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 m_SensorSize: {x: 36, y: 24} m_LensShift: {x: 0, y: 0} m_FocalLength: 50 @@ -292,7 +315,8 @@ Camera: Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 271199282} m_LocalRotation: {x: 0.2164396, y: -0, z: -0, w: 0.97629607} m_LocalPosition: {x: 0, y: 0, z: 0} @@ -305,7 +329,8 @@ Transform: MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 271199282} m_Enabled: 1 m_EditorHideFlags: 0 @@ -317,7 +342,8 @@ MonoBehaviour: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 374731286} @@ -336,7 +362,8 @@ GameObject: MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 374731282} m_Enabled: 1 m_CastShadows: 1 @@ -345,7 +372,9 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: e57457a42a153bd4894a06d8105866c5, type: 2} m_StaticBatchInfo: @@ -355,6 +384,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -371,7 +401,8 @@ MeshRenderer: BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 374731282} m_Material: {fileID: 0} m_IsTrigger: 0 @@ -383,14 +414,16 @@ BoxCollider: MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 374731282} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &374731286 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 374731282} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 30, y: 0.5, z: 30} @@ -403,7 +436,8 @@ Transform: MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 374731282} m_Enabled: 1 m_EditorHideFlags: 0 @@ -419,7 +453,8 @@ MonoBehaviour: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 761835725} @@ -438,7 +473,8 @@ GameObject: MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 761835721} m_Enabled: 1 m_CastShadows: 1 @@ -447,7 +483,9 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: e57457a42a153bd4894a06d8105866c5, type: 2} m_StaticBatchInfo: @@ -457,6 +495,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -473,7 +512,8 @@ MeshRenderer: CharacterController: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 761835721} m_Material: {fileID: 0} m_IsTrigger: 0 @@ -490,14 +530,16 @@ CharacterController: MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 761835721} m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &761835725 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 761835721} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 8, y: 1, z: 10} @@ -511,7 +553,8 @@ Transform: MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 761835721} m_Enabled: 1 m_EditorHideFlags: 0 @@ -524,7 +567,8 @@ MonoBehaviour: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 1302823950} @@ -540,7 +584,8 @@ GameObject: Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1302823949} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} @@ -553,7 +598,8 @@ Transform: MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1302823949} m_Enabled: 1 m_EditorHideFlags: 0 @@ -564,7 +610,8 @@ MonoBehaviour: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 1669096003} @@ -580,15 +627,18 @@ GameObject: Light: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1669096001} m_Enabled: 1 - serializedVersion: 8 + serializedVersion: 10 m_Type: 1 + m_Shape: 0 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 0.5 m_Range: 10 m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 m_CookieSize: 10 m_Shadows: m_Type: 2 @@ -598,6 +648,24 @@ Light: m_Bias: 0 m_NormalBias: 0.83 m_NearPlane: 0.1 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -605,19 +673,23 @@ Light: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 + m_RenderingLayerMask: 1 m_Lightmapping: 1 m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!4 &1669096003 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1669096001} m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} m_LocalPosition: {x: 25.01, y: 27.58, z: 4.71} @@ -630,7 +702,8 @@ Transform: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 1735717992} @@ -648,7 +721,8 @@ GameObject: MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1735717988} m_Enabled: 1 m_CastShadows: 1 @@ -657,7 +731,9 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 m_Materials: - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: @@ -667,6 +743,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -683,7 +760,8 @@ MeshRenderer: BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1735717988} m_Material: {fileID: 0} m_IsTrigger: 0 @@ -695,14 +773,16 @@ BoxCollider: MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1735717988} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &1735717992 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1735717988} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 26, y: 0, z: 26} @@ -715,7 +795,8 @@ Transform: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 1865069244} @@ -730,7 +811,8 @@ GameObject: Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1865069242} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 11.206564, y: -4.905942, z: 15.366896} diff --git a/Assets/TestSceneSettings.lighting b/Assets/TestSceneSettings.lighting new file mode 100644 index 0000000..cc2444d --- /dev/null +++ b/Assets/TestSceneSettings.lighting @@ -0,0 +1,62 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!850595691 &4890085278179872738 +LightingSettings: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: TestSceneSettings + serializedVersion: 2 + m_GIWorkflowMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_RealtimeEnvironmentLighting: 1 + m_BounceScale: 1 + m_AlbedoBoost: 1 + m_UsingShadowmask: 1 + m_BakeBackend: 0 + m_LightmapMaxSize: 1024 + m_BakeResolution: 40 + m_Padding: 2 + m_TextureCompression: 1 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAO: 0 + m_MixedBakeMode: 2 + m_LightmapsBakeMode: 1 + m_FilterMode: 1 + m_LightmapParameters: {fileID: 0} + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_RealtimeResolution: 2 + m_ForceWhiteAlbedo: 0 + m_ForceUpdates: 0 + m_FinalGather: 0 + m_FinalGatherRayCount: 256 + m_FinalGatherFiltering: 1 + m_PVRCulling: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_LightProbeSampleCountMultiplier: 4 + m_PVRBounces: 2 + m_PVRRussianRouletteStartBounce: 2 + m_PVREnvironmentMIS: 0 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 diff --git a/Assets/Plugins/UniRx/Examples/Sample13_ToDoItem.prefab.meta b/Assets/TestSceneSettings.lighting.meta similarity index 54% rename from Assets/Plugins/UniRx/Examples/Sample13_ToDoItem.prefab.meta rename to Assets/TestSceneSettings.lighting.meta index cbe92f5..1e43978 100644 --- a/Assets/Plugins/UniRx/Examples/Sample13_ToDoItem.prefab.meta +++ b/Assets/TestSceneSettings.lighting.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: 173222196f3e1f0448b383f260df7d44 -timeCreated: 1455373909 -licenseType: Pro +guid: c6eb88022a890e1469fec23a151ba963 NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/VFXDefaultResources.asset b/Assets/VFXDefaultResources.asset new file mode 100644 index 0000000..317a4de --- /dev/null +++ b/Assets/VFXDefaultResources.asset @@ -0,0 +1,82 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cd0a560c562a33e4b94f515804e2bd27, type: 3} + m_Name: VFXDefaultResources + m_EditorClassIdentifier: + particleTexture: {fileID: 0} + noiseTexture: {fileID: 0} + vectorField: {fileID: 0} + signedDistanceField: {fileID: 0} + mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} + animationCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.25 + value: 0.25 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + gradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 0} + key1: {r: 0.5, g: 0.5, b: 0.5, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0.8} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 6554 + atime2: 52428 + atime3: 65535 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 4 + shader: {fileID: 0} diff --git a/Assets/VFXDefaultResources.asset.meta b/Assets/VFXDefaultResources.asset.meta new file mode 100644 index 0000000..27d310c --- /dev/null +++ b/Assets/VFXDefaultResources.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 07f8badda17a87c4db712c7f0e313008 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor.meta b/Assets/Visual Behavior Tree/Editor.meta index 3d5afc6..5c86e45 100644 --- a/Assets/Visual Behavior Tree/Editor.meta +++ b/Assets/Visual Behavior Tree/Editor.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 03d7de68d91115549a1883cd567a56b9 +guid: 9a05ec06ce38b7649974ab657ccffb77 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BehaviorExtensions.cs b/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs similarity index 97% rename from Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BehaviorExtensions.cs rename to Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs index 4682ff1..ec7b3ab 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BehaviorExtensions.cs +++ b/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs @@ -9,7 +9,7 @@ using UnityEditor; using UnityEngine; -namespace Assets.Editor.BehaviorTreeViewEditor +namespace Assets.Editor { public static class BehaviorExtensions { @@ -118,8 +118,6 @@ public static void SaveBehaviorAsset(this BehaviorManager behaviorManager, strin { var runner = new Merge("Extension Root", -1, -1); runnerElementList.Add(runner); - - json = JsonConvert.SerializeObject(runnerElementList, Formatting.Indented); } json = JsonConvert.SerializeObject(runnerElementList, Formatting.Indented); asset.RunnerElementsJSON = json; diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BehaviorExtensions.cs.meta b/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs.meta similarity index 100% rename from Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BehaviorExtensions.cs.meta rename to Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs.meta diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorLogDrawer.cs b/Assets/Visual Behavior Tree/Editor/BehaviorLogDrawer.cs deleted file mode 100644 index 3ee9540..0000000 --- a/Assets/Visual Behavior Tree/Editor/BehaviorLogDrawer.cs +++ /dev/null @@ -1,179 +0,0 @@ -using Assets.Scripts.AI.Behavior_Logger; -using UniRx; -using UnityEngine; -using System; -using UnityEditor; -using Assets.Editor.BehaviorTreeViewEditor; -using System.Collections.Generic; - -namespace Assets.Editor -{ - public class BehaviorLogDrawer - { - private int BehaviorID; - private string ManagerName = "Wolf Pancakes Taste Like Fur"; - public Rect DrawHere; - - public Vector2 BoxSize; - public RectOffset TotalOffset; - - protected BehaviorLogDrawer Parent = null; - - /// - /// Depth of this drawer (taken from entry) Default: 0 - /// - private int DrawDepth = 0; - - private Dictionary ChildrenDrawers = new Dictionary(); - - /// - /// Custom Styling options for this behavior log drawer - /// - public GUIStyle Style = new GUIStyle(); - - public BehaviorLogEntry Entry { get; set; } - private IObservable LogStream; - - public BehaviorLogDrawer(string loggerName, int ID, Vector2 boxSize, GUIStyle subStyle = null) - { - BehaviorID = ID; - ManagerName = loggerName; - BoxSize = boxSize; - if (subStyle != null) - Style = subStyle; - else - { - Style = new GUIStyle(); - Style.margin = new RectOffset(15, 15, 30, 30); - } - - TotalOffset = Style.margin; - Initialize(); - } - - private bool Initialized = false; - public void Initialize() - { - ChildrenDrawers = new Dictionary(); - LogStream = ObservableBehaviorLogger.Listener - .Where(x => - x.BehaviorID == BehaviorID && - x.LoggerName == ManagerName) - .Do(x => - { - Entry = x; - if(Entry.State.HasChildren) - { - foreach (var child in Entry.State.Children) - { - if (!ChildrenDrawers.ContainsKey(child.ID)) - { - float y = (child.Depth+1) * (BoxSize.y + Style.margin.top); - ChildrenDrawers.Add(child.ID, new BehaviorLogDrawer(ManagerName, child.ID, BoxSize, Style) - { - Parent = this, - DrawHere = new Rect(Style.margin.left, y, BoxSize.x, BoxSize.y) - }); - } - } - } - }); - - Initialized = true; - } - - public void DrawBehaviorWithAllChildren() - { - if (!Initialized) - { - Initialize(); - } - //Draw Breadth First, Offset parent second - LogStream.Subscribe(); - - int offset = Style.margin.left; - - if(Entry == null) - { - return; - } - else if(Entry.State.HasChildren) - { - offset = DrawChildrenAndGetOffset() / 2; - } - var parent = Entry.State.Parent; - if (parent != null) - { - if (parent.HasChildren) - { - if (parent.Children.Count == 1) - { - offset = (int)BoxSize.x / 2; - } - } - } - this.TotalOffset.left = offset; - this.TotalOffset.right = offset; - DrawBehaviorLogEntry(); - } - - private int DrawChildrenAndGetOffset() - { - var newOffset = 0; - BehaviorLogDrawer prevChildDrawer = null; - foreach (var child in ChildrenDrawers.Values) - { - if (prevChildDrawer == null) - { - child.DrawHere.x = this.DrawHere.x; - } - else - { - child.DrawHere.x = prevChildDrawer.DrawHere.x + - BoxSize.x + - prevChildDrawer.TotalOffset.right; - - newOffset += prevChildDrawer.TotalOffset.right; - } - - newOffset += (int)BoxSize.x; - prevChildDrawer = child; - child.DrawBehaviorWithAllChildren(); - } - return newOffset; - } - //FIXED - - public void DrawBehaviorLogEntry() - { - if(Entry != null) - { - var totalX = DrawHere.x + TotalOffset.left; - var totalPosition = new Rect(totalX, DrawHere.y, - BoxSize.x, BoxSize.y); - - if(Parent != null) - { - var startVector = new Vector3(totalX + BoxSize.x / 2, DrawHere.y); - var endVector = new Vector3(Parent.DrawHere.x + BoxSize.x / 2 + Parent.TotalOffset.left, - Parent.DrawHere.y + BoxSize.y); - using (new Handles.DrawingScope(Color.black)) - { - Handles.DrawLine(startVector, endVector); - } - } - - CustomGUI.DrawQuad(totalPosition, Entry.State.CurrentState.GetBehaviorStateColor()); - - GUI.BeginGroup(totalPosition); - - if (Entry.State.Parent != null) - { - GUI.Label(new Rect(0, 20, 120, 30), new GUIContent(Entry.State.Parent.Name)); - } - GUI.Label(new Rect(0,35,120,30), new GUIContent(Entry.State.Name)); - GUI.EndGroup(); - } - } - } -} diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorLogDrawer.cs.meta b/Assets/Visual Behavior Tree/Editor/BehaviorLogDrawer.cs.meta deleted file mode 100644 index ef1818e..0000000 --- a/Assets/Visual Behavior Tree/Editor/BehaviorLogDrawer.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: 9738ef56f1e79b742a44e32a1c251288 -timeCreated: 1523326211 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorManagerEditor.cs b/Assets/Visual Behavior Tree/Editor/BehaviorManagerEditor.cs deleted file mode 100644 index 20ef9d1..0000000 --- a/Assets/Visual Behavior Tree/Editor/BehaviorManagerEditor.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Assets.Editor.BehaviorTreeViewEditor; -using Assets.Scripts.AI; -using UnityEditor; -using UnityEngine; - -namespace Assets.Editor -{ - [CustomEditor(typeof(BehaviorManager))] - public class BehaviorManagerEditor : BaseEditor - { - BehaviorManager BTreeManager; - BehaviorTreeManagerAsset _BTreeAsset; - - protected override void OnEnable() - { - base.OnEnable(); - BTreeManager = (BehaviorManager)serializedObject.targetObject; - } - - public override void OnInspectorGUI() - { - base.OnInspectorGUI(); - - if (GUILayout.Button("Reload")) - { - BTreeManager.Reinitialize(); - } - - if(GUILayout.Button("Debug")) - { - TreeDebuggerWindow.ShowWindow(); - } - } - } -} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorManagerEditor.cs.meta b/Assets/Visual Behavior Tree/Editor/BehaviorManagerEditor.cs.meta deleted file mode 100644 index f91faac..0000000 --- a/Assets/Visual Behavior Tree/Editor/BehaviorManagerEditor.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: e7a6d9a840a13454bb0138acc1d15134 -timeCreated: 1518939676 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBehaviorTreeView.cs b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBehaviorTreeView.cs index c655b23..3d9add1 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBehaviorTreeView.cs +++ b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBehaviorTreeView.cs @@ -178,6 +178,7 @@ protected override void ContextClickedItem(int id) public void OnMenuTypeSelected(object itemTypeSelected) { + Debug.Log(itemTypeSelected); object[] obj = itemTypeSelected as object[]; BehaviorTreeElement element = obj[0] as BehaviorTreeElement; element.ElementType = obj[1].ToString(); @@ -221,13 +222,13 @@ void CellGUI(Rect cellRect, TreeViewItem item, BTreeColumns case ShowParameters.Active: if (IsSelected(item.id)) { - cellRect.height = TypeDependantDrawer.GetTotalHeightOfProperties(item.data); - TypeDependantDrawer.DrawAllFields(item.data, cellRect); + //cellRect.height = TypeDependantDrawer.GetTotalHeightOfProperties(item.data); + //TypeDependantDrawer.DrawAllFields(item.data, cellRect); } break; case ShowParameters.All: - cellRect.height = TypeDependantDrawer.GetTotalHeightOfProperties(item.data); - TypeDependantDrawer.DrawAllFields(item.data, cellRect); + //cellRect.height = TypeDependantDrawer.GetTotalHeightOfProperties(item.data); + //TypeDependantDrawer.DrawAllFields(item.data, cellRect); break; default: break; @@ -249,7 +250,7 @@ protected override float GetCustomRowHeight(int row, TreeViewItem item) if((ShowParams.HasFlag(ShowParameters.Active) && IsSelected(item.id)) || ShowParams.HasFlag(ShowParameters.All)) { - maxHeight = TypeDependantDrawer.GetTotalHeightOfProperties((item as TreeViewItem).data); + //maxHeight = TypeDependantDrawer.GetTotalHeightOfProperties((item as TreeViewItem).data); } return Math.Max(20f, maxHeight); } diff --git a/Assets/Visual Behavior Tree/Editor/BuiltInResourcesWindow.cs b/Assets/Visual Behavior Tree/Editor/BuiltInResourcesWindow.cs new file mode 100644 index 0000000..732b40a --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/BuiltInResourcesWindow.cs @@ -0,0 +1,229 @@ +using System; +using UnityEditor; +using UnityEngine; +using System.Collections.Generic; + +namespace Assets.Editor.BehaviorTreeViewEditor.BackendData +{ + public class BuiltInResourcesWindow : EditorWindow + { + [MenuItem("Window/Built-in styles and icons")] + public static void ShowWindow() + { + BuiltInResourcesWindow w = (BuiltInResourcesWindow)EditorWindow.GetWindow(); + w.Show(); + } + + private struct Drawing + { + public Rect Rect; + public Action Draw; + } + + private List Drawings; + + private List _objects; + private float _scrollPos; + private float _maxY; + private Rect _oldPosition; + + private bool _showingStyles = true; + private bool _showingIcons = false; + + private string _search = ""; + + void OnGUI() + { + if (position.width != _oldPosition.width && Event.current.type == EventType.Layout) + { + Drawings = null; + _oldPosition = position; + } + + GUILayout.BeginHorizontal(); + + if (GUILayout.Toggle(_showingStyles, "Styles", EditorStyles.toolbarButton) != _showingStyles) + { + _showingStyles = !_showingStyles; + _showingIcons = !_showingStyles; + Drawings = null; + } + + if (GUILayout.Toggle(_showingIcons, "Icons", EditorStyles.toolbarButton) != _showingIcons) + { + _showingIcons = !_showingIcons; + _showingStyles = !_showingIcons; + Drawings = null; + } + + GUILayout.EndHorizontal(); + + string newSearch = GUILayout.TextField(_search); + if (newSearch != _search) + { + _search = newSearch; + Drawings = null; + } + + float top = 36; + + if (Drawings == null) + { + string lowerSearch = _search.ToLower(); + + Drawings = new List(); + + GUIContent inactiveText = new GUIContent("inactive"); + GUIContent activeText = new GUIContent("active"); + + float x = 5.0f; + float y = 5.0f; + + if (_showingStyles) + { + foreach (GUIStyle ss in GUI.skin.customStyles) + { + if (lowerSearch != "" && !ss.name.ToLower().Contains(lowerSearch)) + continue; + + GUIStyle thisStyle = ss; + + Drawing draw = new Drawing(); + + float width = Mathf.Max( + 100.0f, + GUI.skin.button.CalcSize(new GUIContent(ss.name)).x, + ss.CalcSize(inactiveText).x + ss.CalcSize(activeText).x + ) + 16.0f; + + float height = 60.0f; + + if (x + width > position.width - 32 && x > 5.0f) + { + x = 5.0f; + y += height + 10.0f; + } + + draw.Rect = new Rect(x, y, width, height); + + width -= 8.0f; + + draw.Draw = () => + { + if (GUILayout.Button(thisStyle.name, GUILayout.Width(width))) + CopyText("(GUIStyle)\"" + thisStyle.name + "\""); + + GUILayout.BeginHorizontal(); + GUILayout.Toggle(false, inactiveText, thisStyle, GUILayout.Width(width / 2)); + GUILayout.Toggle(false, activeText, thisStyle, GUILayout.Width(width / 2)); + GUILayout.EndHorizontal(); + }; + + x += width + 18.0f; + + Drawings.Add(draw); + } + } + else if (_showingIcons) + { + if (_objects == null) + { + _objects = new List(Resources.FindObjectsOfTypeAll(typeof(Texture))); + _objects.Sort((pA, pB) => System.String.Compare(pA.name, pB.name, System.StringComparison.OrdinalIgnoreCase)); + } + + float rowHeight = 0.0f; + + foreach (UnityEngine.Object oo in _objects) + { + Texture texture = (Texture)oo; + + if (texture.name == "") + continue; + + if (lowerSearch != "" && !texture.name.ToLower().Contains(lowerSearch)) + continue; + + Drawing draw = new Drawing(); + + float width = Mathf.Max( + GUI.skin.button.CalcSize(new GUIContent(texture.name)).x, + texture.width + ) + 8.0f; + + float height = texture.height + GUI.skin.button.CalcSize(new GUIContent(texture.name)).y + 8.0f; + + if (x + width > position.width - 32.0f) + { + x = 5.0f; + y += rowHeight + 8.0f; + rowHeight = 0.0f; + } + + draw.Rect = new Rect(x, y, width, height); + + rowHeight = Mathf.Max(rowHeight, height); + + width -= 8.0f; + + draw.Draw = () => + { + if (GUILayout.Button(texture.name, GUILayout.Width(width))) + CopyText("EditorGUIUtility.FindTexture( \"" + texture.name + "\" )"); + + Rect textureRect = GUILayoutUtility.GetRect(texture.width, texture.width, texture.height, texture.height, GUILayout.ExpandHeight(false), GUILayout.ExpandWidth(false)); + EditorGUI.DrawTextureTransparent(textureRect, texture); + }; + + x += width + 8.0f; + + Drawings.Add(draw); + } + } + + _maxY = y; + } + + Rect r = position; + r.y = top; + r.height -= r.y; + r.x = r.width - 16; + r.width = 16; + + float areaHeight = position.height - top; + _scrollPos = GUI.VerticalScrollbar(r, _scrollPos, areaHeight, 0.0f, _maxY); + + Rect area = new Rect(0, top, position.width - 16.0f, areaHeight); + GUILayout.BeginArea(area); + + int count = 0; + foreach (Drawing draw in Drawings) + { + Rect newRect = draw.Rect; + newRect.y -= _scrollPos; + + if (newRect.y + newRect.height > 0 && newRect.y < areaHeight) + { + GUILayout.BeginArea(newRect, GUI.skin.textField); + draw.Draw(); + GUILayout.EndArea(); + + count++; + } + } + + GUILayout.EndArea(); + } + + void CopyText(string pText) + { + TextEditor editor = new TextEditor(); + + //editor.content = new GUIContent(pText); // Unity 4.x code + editor.text = pText; // Unity 5.x code + + editor.SelectAll(); + editor.Copy(); + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenEqualityComparer.cs.meta b/Assets/Visual Behavior Tree/Editor/BuiltInResourcesWindow.cs.meta similarity index 83% rename from Assets/Plugins/UniRx/Scripts/Async/CancellationTokenEqualityComparer.cs.meta rename to Assets/Visual Behavior Tree/Editor/BuiltInResourcesWindow.cs.meta index a4fe3fd..28c0361 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenEqualityComparer.cs.meta +++ b/Assets/Visual Behavior Tree/Editor/BuiltInResourcesWindow.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7d739f510b125b74fa7290ac4335e46e +guid: 9bf60dacfc064644aa383caa186d105e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Visual Behavior Tree/Editor/CustomGUI.cs b/Assets/Visual Behavior Tree/Editor/CustomGUI.cs deleted file mode 100644 index 1ea651d..0000000 --- a/Assets/Visual Behavior Tree/Editor/CustomGUI.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Collections.Generic; -using UnityEditor; -using UnityEngine; - -namespace Assets.Editor -{ - public static class CustomGUI - { - //Taken from https://answers.unity.com/questions/37752/how-to-render-a-colored-2d-rectangle.html - private static List> quadTextures = new List>(); - public static void DrawQuad(Rect position, Color color) - { - var tmp = quadTextures.Find(t => t.Key == color); - Texture2D texture; - if (tmp.Equals(default(KeyValuePair))) - { - texture = new Texture2D(1, 1); - texture.SetPixel(0, 0, color); - texture.Apply(); - quadTextures.Add(new KeyValuePair(color, texture)); - } - else - { - texture = tmp.Value; - } - - GUI.skin.box.normal.background = texture; - GUI.Box(position, GUIContent.none); - } - } -} diff --git a/Assets/Visual Behavior Tree/Editor/CustomGUI.cs.meta b/Assets/Visual Behavior Tree/Editor/CustomGUI.cs.meta deleted file mode 100644 index 96c7e92..0000000 --- a/Assets/Visual Behavior Tree/Editor/CustomGUI.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: 3e87cbdeec6c288478c89e98393c507f -timeCreated: 1524003509 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/UniRx/Examples.meta b/Assets/Visual Behavior Tree/Editor/Drawing.meta similarity index 77% rename from Assets/Plugins/UniRx/Examples.meta rename to Assets/Visual Behavior Tree/Editor/Drawing.meta index 1c2dfc3..9a79f3a 100644 --- a/Assets/Plugins/UniRx/Examples.meta +++ b/Assets/Visual Behavior Tree/Editor/Drawing.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d276faead1c49354fa2b575652b45cc0 +guid: 58ebc041830a470429990bfaf8acd8ca folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Plugins/UniRx/Scripts/Async.meta b/Assets/Visual Behavior Tree/Editor/NodeEditor.meta similarity index 77% rename from Assets/Plugins/UniRx/Scripts/Async.meta rename to Assets/Visual Behavior Tree/Editor/NodeEditor.meta index bd70662..ac4476f 100644 --- a/Assets/Plugins/UniRx/Scripts/Async.meta +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: aa48969b4eb9be74589b999b5517b1d6 +guid: 70ef418e18b24764ba79b3f065be76c2 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs new file mode 100644 index 0000000..342a61e --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs @@ -0,0 +1,206 @@ +using Assets.Editor; +using Assets.Scripts.AI; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEditor; +using UnityEngine; +using System.Reflection; + +namespace Assets.Visual_Behavior_Tree.Editor.NodeEditor +{ + public class BehaviorEditorNode + { + public Rect fullRect; + public Rect subInspectorRect; + + public string title; + public int titleSize = 10; + + public bool isDragged; + public bool isSelected; + + [SerializeField] + public BehaviorTreeElement treeElement; + + public SerializedObject elementObject; + + public ConnectionPoint inPoint; + public ConnectionPoint outPoint; + + private GUIStyle inPointStyle; + private GUIStyle outPointStyle; + + public GUIStyle style; + public GUIStyle defaultNodeStyle; + public GUIStyle selectedNodeStyle; + + public Action OnRemoveNode; + + public BehaviorEditorNode(Vector2 position, float width, float height, BehaviorTreeElement element, Action OnClickInPoint, Action OnClickOutPoint, Action OnClickRemoveNode) + { + fullRect = new Rect(position.x, position.y, width, height); + + style = new GUIStyle(); + style.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/node1.png") as Texture2D; + style.border = new RectOffset(12, 12, 12, 12); + + defaultNodeStyle = style; + + selectedNodeStyle = new GUIStyle(); + selectedNodeStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/node1 on.png") as Texture2D; + selectedNodeStyle.border = new RectOffset(12, 12, 12, 12); + + inPointStyle = new GUIStyle(); + inPointStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn left.png") as Texture2D; + inPointStyle.active.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn left on.png") as Texture2D; + inPointStyle.border = new RectOffset(4, 4, 12, 12); + + outPointStyle = new GUIStyle(); + outPointStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn right.png") as Texture2D; + outPointStyle.active.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn right on.png") as Texture2D; + outPointStyle.border = new RectOffset(4, 4, 12, 12); + + inPoint = new ConnectionPoint(this, ConnectionPointType.In, inPointStyle, OnClickInPoint); + outPoint = new ConnectionPoint(this, ConnectionPointType.Out, outPointStyle, OnClickOutPoint); + + Vector2 inPointSize = inPoint.rect.size; + Vector2 outPointSize = outPoint.rect.size; + + subInspectorRect = new Rect(position.x + inPointSize.x, position.y + titleSize, width - inPointSize.x - outPointSize.x, height - (titleSize * 2)); + + treeElement = element; + elementObject = new SerializedObject(treeElement); + + title = treeElement.Name; + + OnRemoveNode = OnClickRemoveNode; + } + + public void AddInConnection(Connection connection) + { + inPoint.connections.Add(connection); + } + + public void RemoveInConnection(Connection connection) + { + inPoint.connections.Remove(connection); + } + + public void AddOutConnection(Connection connection) + { + outPoint.connections.Add(connection); + } + + public void RemoveOutConnection(Connection connection) + { + outPoint.connections.Remove(connection); + } + + public void Drag(Vector2 delta) + { + fullRect.position += delta; + subInspectorRect.position += delta; + } + + public void Draw() + { + inPoint.Draw(); + outPoint.Draw(); + + GUI.Box(fullRect, title, style); + GUI.Box(subInspectorRect, "", selectedNodeStyle); + + Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(treeElement.ElementType); + FieldInfo[] fields = type.GetFields(); + + var items = new List(); + foreach (FieldInfo field in fields) + { + items.Add(field.Name); + } + + var objStyle = EditorStyles.objectField; + var boxes = EditorGUIUtility.GetFlowLayoutedRects(subInspectorRect, objStyle, 2, 0, items); + for (int i = 0; i < items.Count; ++i) + { + var box = boxes[i]; + box.x = box.x + 7; + box.y = box.y + 7; + box.xMax = box.xMax - 15; + using (new GUILayout.AreaScope(box, "")) + { + var prop = elementObject.FindProperty(items[i]); + + GUILayout.BeginHorizontal(); + GUILayout.Label(prop.displayName, EditorStyles.whiteLabel, GUILayout.MinWidth(50), GUILayout.ExpandWidth(true)); + EditorGUILayout.PropertyField(prop, GUIContent.none, true, GUILayout.MinWidth(100), GUILayout.ExpandWidth(true)); + GUILayout.EndHorizontal(); + } + } + elementObject.ApplyModifiedProperties(); + } + + public bool ProcessEvents(Event e) + { + switch (e.type) + { + case EventType.MouseDown: + if (e.button == 0) + { + if (fullRect.Contains(e.mousePosition)) + { + isDragged = true; + GUI.changed = true; + isSelected = true; + style = selectedNodeStyle; + } + else + { + GUI.changed = true; + isSelected = false; + style = defaultNodeStyle; + } + } + + if (e.button == 1 && isSelected && fullRect.Contains(e.mousePosition)) + { + ProcessContextMenu(); + e.Use(); + } + break; + + case EventType.MouseUp: + isDragged = false; + break; + + case EventType.MouseDrag: + if (e.button == 0 && isDragged) + { + Drag(e.delta); + e.Use(); + return true; + } + break; + } + + return false; + } + + private void ProcessContextMenu() + { + GenericMenu genericMenu = new GenericMenu(); + genericMenu.AddItem(new GUIContent("Remove node"), false, OnClickRemoveNode); + genericMenu.ShowAsContext(); + } + + private void OnClickRemoveNode() + { + OnRemoveNode?.Invoke(this); + } + } + + +} diff --git a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenExtensions.cs.meta b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs.meta similarity index 83% rename from Assets/Plugins/UniRx/Scripts/Async/CancellationTokenExtensions.cs.meta rename to Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs.meta index 28a6958..5ca6399 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenExtensions.cs.meta +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4be7209f04146bd45ac5ee775a5f7c26 +guid: 254964a679f134e418054923f120d496 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs new file mode 100644 index 0000000..466bdee --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs @@ -0,0 +1,355 @@ +using Assets.Editor; +using Assets.Scripts.AI; +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Editor.NodeEditor +{ + public class BehaviorNodeEditorWindow : EditorWindow + { + private List nodes; + private List connections; + + private GUIStyle nodeStyle; + private GUIStyle selectedNodeStyle; + + private ConnectionPoint selectedInPoint; + private ConnectionPoint selectedOutPoint; + + private Vector2 offset; + private Vector2 drag; + + private int nodeID = -1; + + [MenuItem("Window/uVBT/Node Editor")] + private static void OpenWindow() + { + BehaviorNodeEditorWindow window = GetWindow(); + window.titleContent = new GUIContent("Behavior Node Editor"); + } + + private void OnEnable() + { + selectedNodeStyle = new GUIStyle(); + selectedNodeStyle.normal.background = EditorGUIUtility.Load("builtin skins/lightskin/images/node6 on.png") as Texture2D; + selectedNodeStyle.border = new RectOffset(10, 10, 10, 10); + } + + private void OnGUI() + { + DrawToolbar(); + + DrawGrid(20, 0.2f, Color.gray); + DrawGrid(100, 0.4f, Color.gray); + + DrawNodes(); + DrawConnections(); + + DrawConnectionLine(Event.current); + + ProcessNodeEvents(Event.current); + ProcessEvents(Event.current); + + if (GUI.changed) Repaint(); + } + + private void DrawToolbar() + { + if(GUILayout.Button("Save")) { + SaveAllNodesToFile(); + } + if (GUILayout.Button("Load")) + { + LoadNodesFromFile(); + } + } + + private void DrawGrid(float gridSpacing, float gridOpacity, Color gridColor) + { + int widthDivs = Mathf.CeilToInt(position.width / gridSpacing); + int heightDivs = Mathf.CeilToInt(position.height / gridSpacing); + + Handles.BeginGUI(); + Handles.color = new Color(gridColor.r, gridColor.g, gridColor.b, gridOpacity); + + offset += drag * 0.5f; + Vector3 newOffset = new Vector3(offset.x % gridSpacing, offset.y % gridSpacing, 0); + + for (int i = 0; i < widthDivs; i++) + { + Handles.DrawLine(new Vector3(gridSpacing * i, -gridSpacing, 0) + newOffset, new Vector3(gridSpacing * i, position.height, 0f) + newOffset); + } + + for (int j = 0; j < heightDivs; j++) + { + Handles.DrawLine(new Vector3(-gridSpacing, gridSpacing * j, 0) + newOffset, new Vector3(position.width, gridSpacing * j, 0f) + newOffset); + } + + Handles.color = Color.white; + Handles.EndGUI(); + } + + private void DrawNodes() + { + if(nodes != null) + { + for (int i = 0; i < nodes.Count; i++) + { + nodes[i].Draw(); + } + } + } + + private void DrawConnections() + { + if (connections != null) + { + for (int i = 0; i < connections.Count; i++) + { + connections[i].Draw(); + } + } + } + + private void DrawConnectionLine(Event e) + { + if (selectedInPoint != null && selectedOutPoint == null) + { + Handles.DrawBezier( + selectedInPoint.rect.center, + e.mousePosition, + selectedInPoint.rect.center + Vector2.left * 50f, + e.mousePosition - Vector2.left * 50f, + Color.white, + null, + 2f + ); + + GUI.changed = true; + } + + if (selectedOutPoint != null && selectedInPoint == null) + { + Handles.DrawBezier( + selectedOutPoint.rect.center, + e.mousePosition, + selectedOutPoint.rect.center - Vector2.left * 50f, + e.mousePosition + Vector2.left * 50f, + Color.white, + null, + 2f + ); + + GUI.changed = true; + } + } + + private void ProcessEvents(Event e) + { + drag = Vector2.zero; + + switch (e.type) + { + case EventType.MouseDown: + if (e.button == 1) + { + ProcessContextMenu(e.mousePosition); + } + break; + + case EventType.MouseDrag: + if (e.button == 0) + { + OnDrag(e.delta); + } + break; + } + } + + private void ProcessNodeEvents(Event e) + { + if (nodes != null) + { + for (int i = nodes.Count - 1; i >= 0; i--) + { + bool guiChanged = nodes[i].ProcessEvents(e); + + if (guiChanged) + { + GUI.changed = true; + } + } + } + } + + private void ProcessContextMenu(Vector2 mousePosition) + { + GenericMenu genericMenu = new GenericMenu(); + genericMenu.CreateTypeMenu((typeName) => OnClickAddNode(mousePosition, typeName)); + genericMenu.ShowAsContext(); + } + + private void OnClickAddNode(Vector2 mousePosition, object itemTypeSelected) + { + if (nodes == null) + { + nodes = new List(); + } + + Type type = typeof(BehaviorTreeElement).Assembly.GetType((string)itemTypeSelected, true); + + var treeElement = (BehaviorTreeElement)CreateInstance(type); + treeElement.ID = 0; + treeElement.Name = type.ToString().Split('.').Last(); + treeElement.Depth = -1; + treeElement.ElementType = type.ToString(); + + nodes.Add(new BehaviorEditorNode(mousePosition, 200, 150, treeElement, OnClickInPoint, OnClickOutPoint, OnClickRemoveNode)); + } + + private void OnClickRemoveNode(BehaviorEditorNode node) + { + if (connections != null) + { + List connectionsToRemove = new List(); + + for (int i = 0; i < connections.Count; i++) + { + if (connections[i].inPoint == node.inPoint || connections[i].outPoint == node.outPoint) + { + connectionsToRemove.Add(connections[i]); + } + } + + for (int i = 0; i < connectionsToRemove.Count; i++) + { + connections.Remove(connectionsToRemove[i]); + } + + connectionsToRemove = null; + } + + nodes.Remove(node); + } + + private void OnDrag(Vector2 delta) + { + drag = delta; + + if (nodes != null) + { + for (int i = 0; i < nodes.Count; i++) + { + nodes[i].Drag(delta); + } + } + + GUI.changed = true; + } + + private void OnClickInPoint(ConnectionPoint inPoint) + { + selectedInPoint = inPoint; + + if (selectedOutPoint != null) + { + if (selectedOutPoint.node != selectedInPoint.node) + { + CreateConnection(); + } + ClearConnectionSelection(); + } + } + + private void OnClickOutPoint(ConnectionPoint outPoint) + { + selectedOutPoint = outPoint; + + if (selectedInPoint != null) + { + if (selectedOutPoint.node != selectedInPoint.node) + { + CreateConnection(); + } + ClearConnectionSelection(); + } + } + + private void OnClickRemoveConnection(Connection connection) + { + connection.inPoint.connections.Remove(connection); + connection.outPoint.connections.Remove(connection); + connections.Remove(connection); + } + + private void CreateConnection() + { + if (connections == null) + { + connections = new List(); + } + + var connection = new Connection(selectedInPoint, selectedOutPoint, OnClickRemoveConnection); + + selectedInPoint.connections.Add(connection); + selectedOutPoint.connections.Add(connection); + connections.Add(connection); + } + + private void ClearConnectionSelection() + { + selectedInPoint = null; + selectedOutPoint = null; + } + + private void SaveAllNodesToFile() + { + var path = EditorUtility.SaveFilePanelInProject( + "Save behavior tree", + "New Behavior Tree.asset", + "asset", + "Save behavior tree asset"); + + var validator = new TreeValidator(selectedNodeStyle); + + if (IsValidTree()) + { + TreeSaver saver = new TreeSaver(validator); + saver.SaveTree(nodes, path); + } + } + + private void LoadNodesFromFile() + { + var path = EditorUtility.OpenFilePanel( + "Save behavior tree", + "", + "asset"); + + + TreeLoader loader = new TreeLoader(); + var root = loader.LoadFromAsset(path); + nodes = loader.GetNodes(OnClickInPoint, OnClickOutPoint, OnClickRemoveNode); + connections = loader.GetConnectionsFromRoot(root, OnClickRemoveConnection); + + + } + + private bool IsValidTree() + { + DeselectAllNodes(); + return new TreeValidator(selectedNodeStyle).IsValidTreeByNodes(nodes); + } + + private void DeselectAllNodes() + { + foreach(var node in nodes) + { + node.style = node.defaultNodeStyle; + } + } + } +} diff --git a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenSourceExtensions.cs.meta b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs.meta similarity index 83% rename from Assets/Plugins/UniRx/Scripts/Async/CancellationTokenSourceExtensions.cs.meta rename to Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs.meta index fd09fe4..70da8e7 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/CancellationTokenSourceExtensions.cs.meta +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 22d85d07f1e70ab42a7a4c25bd65e661 +guid: ef59855f1150f8742bcd883baed3b122 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Visual Behavior Tree/Editor/NodeEditor/Connection.cs b/Assets/Visual Behavior Tree/Editor/NodeEditor/Connection.cs new file mode 100644 index 0000000..ada0298 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor/Connection.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEditor; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Editor.NodeEditor +{ + public class Connection + { + public ConnectionPoint inPoint; + public ConnectionPoint outPoint; + public Action OnClickRemoveConnection; + + public Connection(ConnectionPoint inPoint, ConnectionPoint outPoint, Action OnClickRemoveConnection) + { + this.inPoint = inPoint; + this.outPoint = outPoint; + this.OnClickRemoveConnection = OnClickRemoveConnection; + } + + public void Draw() + { + Handles.DrawBezier( + inPoint.rect.center, + outPoint.rect.center, + inPoint.rect.center + Vector2.left * 50f, + outPoint.rect.center - Vector2.left * 50f, + Color.white, + null, + 2f + ); + + if (Handles.Button((inPoint.rect.center + outPoint.rect.center) * 0.5f, Quaternion.identity, 4, 8, Handles.RectangleHandleCap)) + { + OnClickRemoveConnection?.Invoke(this); + } + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/NodeEditor/Connection.cs.meta b/Assets/Visual Behavior Tree/Editor/NodeEditor/Connection.cs.meta new file mode 100644 index 0000000..9d0938d --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor/Connection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ac308657714d51a46bd948e79efc2b85 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/NodeEditor/ConnectionPoint.cs b/Assets/Visual Behavior Tree/Editor/NodeEditor/ConnectionPoint.cs new file mode 100644 index 0000000..a6c4cd5 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor/ConnectionPoint.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Editor.NodeEditor +{ + public enum ConnectionPointType { In, Out } + + public class ConnectionPoint + { + public Rect rect; + + public ConnectionPointType type; + + public BehaviorEditorNode node; + + public GUIStyle style; + + public Action OnClickConnectionPoint; + + public List connections = new List(); + + public ConnectionPoint(BehaviorEditorNode node, ConnectionPointType type, GUIStyle style, Action OnClickConnectionPoint) + { + this.node = node; + this.type = type; + this.style = style; + this.OnClickConnectionPoint = OnClickConnectionPoint; + rect = new Rect(0, 0, 10f, 20f); + } + + public void Draw() + { + rect.y = node.fullRect.y + (node.fullRect.height * 0.5f) - rect.height * 0.5f; + + switch (type) + { + case ConnectionPointType.In: + rect.x = node.fullRect.x - rect.width + 8f; + break; + + case ConnectionPointType.Out: + rect.x = node.fullRect.x + node.fullRect.width - 8f; + break; + } + + if (GUI.Button(rect, "", style)) + { + OnClickConnectionPoint?.Invoke(this); + } + } + } +} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/NodeEditor/ConnectionPoint.cs.meta b/Assets/Visual Behavior Tree/Editor/NodeEditor/ConnectionPoint.cs.meta new file mode 100644 index 0000000..e019b05 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor/ConnectionPoint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2971b473c2b353548830401e10a3e6ab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/TreeDebuggerWindow.cs b/Assets/Visual Behavior Tree/Editor/TreeDebuggerWindow.cs deleted file mode 100644 index 684f974..0000000 --- a/Assets/Visual Behavior Tree/Editor/TreeDebuggerWindow.cs +++ /dev/null @@ -1,154 +0,0 @@ -using System; -using System.Collections.Generic; -using Assets.Editor.BehaviorTreeViewEditor; -using Assets.Scripts.AI; -using Assets.Scripts.AI.Behavior_Logger; -using UniRx; -using UnityEditor; -using UnityEngine; -using System.Linq; - -namespace Assets.Editor -{ - public class TreeDebuggerWindow : EditorWindow - { - private static Vector2 BehaviorLogRectSize = new Vector2(120, 120); - private RectOffset MinimumMargins; - - private GUIStyle TreeStyle = new GUIStyle(); - - private void OnEnable() - { - Initialize(); - } - - private CompositeDisposable Disposables = new CompositeDisposable(); - - public StringReactiveProperty ManagerName = new StringReactiveProperty(); - - /// - /// Behavior IDs to track current behaviors being watched. - /// - public Dictionary LogDrawers = new Dictionary(); - public Dictionary> LogDrawersByDepth = new Dictionary>(); - - - Rect TopToolbarRect - { - get { return new Rect(10f, 5f, position.width - 40f, 30f); } - } - - Rect TreeDrawArea - { - get { return new Rect(6f, 20f, position.width - 30f, position.height - 40f); } - } - - [MenuItem("Behavior Tree/Debugger")] - public static TreeDebuggerWindow ShowWindow() - { - var window = GetWindow(); - window.Focus(); - window.Repaint(); - return window; - } - - private void OnGUI() - { - if (!Initialized) Initialize(); - - using (new EditorGUILayout.VerticalScope()) - { - TopToolbar(TopToolbarRect); - TreeLogArea(TreeDrawArea); - } - } - - private bool Initialized = false; - private void Initialize() - { - BehaviorLogRectSize = new Vector2(120, 120); - MinimumMargins = new RectOffset(5, 5, 25, 25); - LogDrawers = new Dictionary(); - rowTotalDrawn = new Dictionary(); - parents = new HashSet(); - this.autoRepaintOnSceneChange = true; - - TreeStyle.margin = MinimumMargins; - Initialized = true; - Repaint(); - } - - GenericMenu ManagerSelectMenu = new GenericMenu(); - private void TopToolbar(Rect rect) - { - using(new EditorGUILayout.HorizontalScope()) - { - GUILayout.Space(5); - string dropDownName = "Manager To Debug"; - if (ManagerName.Value != "") dropDownName = ManagerName.Value; - - if(EditorGUILayout.DropdownButton(new GUIContent(dropDownName, "Change visible debugger"), FocusType.Passive, GUILayout.Height(30))) - { - ManagerSelectMenu.CreateManagerMenu(OnManagerSelected); - ManagerSelectMenu.ShowAsContext(); - } - } - } - - private void OnManagerSelected(object name) - { - ManagerName.SetValueAndForceNotify((string)name); - Initialize(); - } - - private Dictionary rowTotalDrawn = new Dictionary(); - private HashSet parents = new HashSet(); - bool parentPaddingSet = false; - - private void TreeLogArea(Rect rect) - { - ObservableBehaviorLogger.Listener - .Where(x => x.LoggerName == ManagerName.Value && - x.State.HasChildren) - .Do(x => - { - //keep a single drawer per ID value - if (!LogDrawers.ContainsKey(x.BehaviorID)) - { - GUIStyle subStyle = new GUIStyle(); - subStyle.margin = MinimumMargins; - //keep only the parents. Parents are responsible for drawing their children. - LogDrawers.Add(x.BehaviorID, - new BehaviorLogDrawer(x.LoggerName, x.BehaviorID, BehaviorLogRectSize, subStyle) - { - TotalOffset = MinimumMargins, - Entry = x - }); - - - } - }) - .Subscribe(); - GUI.BeginGroup(rect); - DrawAllLogDrawers(); - GUI.EndGroup(); - } - - private void DrawAllLogDrawers() - { - var parentsDepthSorted = LogDrawers.Values.Where(x => x.Entry.State.Depth == -1); - - foreach (var parentDrawer in parentsDepthSorted) - { - //Should be called in sorted order, from bottom to top. - //this allows lower depth parents to know the correct spacing of their children - parentDrawer.DrawBehaviorWithAllChildren(); - } - } - - private void OnDestroy() - { - Disposables.Clear(); - } - } -} diff --git a/Assets/Visual Behavior Tree/Editor/TreeDebuggerWindow.cs.meta b/Assets/Visual Behavior Tree/Editor/TreeDebuggerWindow.cs.meta deleted file mode 100644 index 229ee9d..0000000 --- a/Assets/Visual Behavior Tree/Editor/TreeDebuggerWindow.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: f24d03852519aec4f9b0dbb8e2fd015b -timeCreated: 1522900582 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/TreeLoader.cs b/Assets/Visual Behavior Tree/Editor/TreeLoader.cs new file mode 100644 index 0000000..ebd7130 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/TreeLoader.cs @@ -0,0 +1,89 @@ +using Assets.Scripts.AI; +using Assets.Scripts.AI.Tree; +using Assets.Visual_Behavior_Tree.Editor.NodeEditor; +using Assets.Visual_Behavior_Tree.Scripts; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Editor +{ + public class TreeLoader + { + private TreeNodeAsset asset; + + private List behaviorElements = new List(); + + private BehaviorTreeElement root; + + private List nodes; + private List connections = new List(); + + public BehaviorTreeElement LoadFromAsset(string path) + { + var filename = path.Substring(path.LastIndexOf("Assets/")); + asset = AssetDatabase.LoadAssetAtPath(filename); + + var elements = JsonConvert.DeserializeObject>(asset.treeElements); + + behaviorElements = new List(); + foreach (dynamic el in elements) + { + string typeName = el.ElementType; + Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(typeName); + dynamic newBehavior = Activator.CreateInstance(type, (string)el.Name, (int)el.Depth, (int)el.ID); + JsonConvert.PopulateObject(JsonConvert.SerializeObject(el), newBehavior); + behaviorElements.Add(newBehavior); + } + root = TreeElementUtility.ListToTree(behaviorElements); + return root; + } + + public List GetNodes(Action OnClickInPoint, Action OnClickOutPoint, Action OnClickRemoveNode) + { + nodes = new List(); + + for(int i = 0; i < behaviorElements.Count; ++i) + { + var nodeRect = asset.positions[i]; + var newNode = new BehaviorEditorNode(nodeRect.position, nodeRect.width, nodeRect.height, behaviorElements[i], OnClickInPoint, OnClickOutPoint, OnClickRemoveNode); + + nodes.Add(newNode); + } + + return nodes; + } + + internal List GetConnectionsFromRoot(BehaviorTreeElement root, Action onClickRemoveConnection) + { + for (int parentIndex = 0; parentIndex < behaviorElements.Count; parentIndex++) + { + var parent = behaviorElements[parentIndex]; + + int parentDepth = parent.Depth; + + // Count children based depth value, we are looking at children until it's the same depth as this object + for (int i = parentIndex + 1; i < behaviorElements.Count; i++) + { + if (behaviorElements[i].Depth == parentDepth + 1) + { + var inPoint = nodes[i].inPoint; + var connection = new Connection(nodes[i].inPoint, nodes[parentIndex].outPoint, onClickRemoveConnection); + nodes[i].inPoint.connections.Add(connection); + nodes[parentIndex].outPoint.connections.Add(connection); + connections.Add(connection); + } + + if (behaviorElements[i].Depth <= parentDepth) + break; + } + } + return connections; + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/TreeLoader.cs.meta b/Assets/Visual Behavior Tree/Editor/TreeLoader.cs.meta new file mode 100644 index 0000000..83f4092 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/TreeLoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4ddb318f7b8e3554285cf50db163ac7c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/TreeSaver.cs b/Assets/Visual Behavior Tree/Editor/TreeSaver.cs new file mode 100644 index 0000000..57b8163 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/TreeSaver.cs @@ -0,0 +1,79 @@ +using Assets.Scripts.AI; +using Assets.Scripts.AI.Tree; +using Assets.Visual_Behavior_Tree.Editor.NodeEditor; +using Assets.Visual_Behavior_Tree.Scripts; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Editor +{ + public class TreeSaver + { + private TreeValidator treeValidator; + + private List positions; + + public TreeSaver(TreeValidator validator) + { + treeValidator = validator; + } + + public void SaveTree(List nodes, string path) + { + BehaviorEditorNode rootNode = nodes.Find(node => node.inPoint.connections.Count == 0); + + positions = new List(); + positions.Add(rootNode.fullRect); + + RecursiveAddChildren(rootNode); + + var json = GetJsonSaveDataFromRoot(rootNode.treeElement); + + Debug.Log(json); + + SaveAssetToDatabase(path, positions, json); + } + + private void RecursiveAddChildren(BehaviorEditorNode rootNode) + { + rootNode.treeElement.Children = new List(); + var rootNodeConnections = rootNode.outPoint.connections; + rootNodeConnections.ForEach(outNode => + { + var outInpointNode = outNode.inPoint.node; + if (outInpointNode != rootNode) + { + var treeElement = outInpointNode.treeElement; + treeElement.Parent = rootNode.treeElement; + treeElement.Depth = rootNode.treeElement.Depth + 1; + rootNode.treeElement.Children.Add(treeElement); + var pos = outInpointNode.fullRect; + positions.Add(pos); + RecursiveAddChildren(outInpointNode); + } + }); + } + + private string GetJsonSaveDataFromRoot(BehaviorTreeElement root) + { + var elementList = new List(); + TreeElementUtility.TreeToList(root, elementList); + + return JsonConvert.SerializeObject(elementList, Formatting.Indented); + } + + private void SaveAssetToDatabase(string path, List positions, string json) + { + TreeNodeAsset asset = ScriptableObject.CreateInstance(); + asset.positions = positions; + asset.treeElements = json; + + AssetDatabase.CreateAsset(asset, path); + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/TreeSaver.cs.meta b/Assets/Visual Behavior Tree/Editor/TreeSaver.cs.meta new file mode 100644 index 0000000..cc0ac79 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/TreeSaver.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b3745f49c3c3fff42bdcf8166a2a93e3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/TreeValidator.cs b/Assets/Visual Behavior Tree/Editor/TreeValidator.cs new file mode 100644 index 0000000..ee2dac5 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/TreeValidator.cs @@ -0,0 +1,47 @@ +using Assets.Visual_Behavior_Tree.Editor.NodeEditor; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Editor +{ + public class TreeValidator + { + private GUIStyle errorHighlightStyle; + + public TreeValidator(GUIStyle errorStyle) + { + errorHighlightStyle = errorStyle; + } + + public bool IsValidTreeByNodes(List nodes) + { + return HasExactlyOneRootNode(nodes); + } + + private bool HasExactlyOneRootNode(List nodes) + { + var rootNodes = nodes.FindAll(node => node.inPoint.connections.Count() == 0); + + if(rootNodes.Count > 1) + { + Debug.LogError("Behavior Tree Is INVALID! You cannot have more than one root node (node with no inConnections)! Check Highlighted nodes."); + HighlightErrorNodes(rootNodes); + return false; + } + + return true; + } + + private void HighlightErrorNodes(List errorNodes) + { + foreach(var node in errorNodes) + { + node.style = errorHighlightStyle; + } + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/TreeValidator.cs.meta b/Assets/Visual Behavior Tree/Editor/TreeValidator.cs.meta new file mode 100644 index 0000000..2c165f2 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/TreeValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 54a09d70d14018b499150b3616af1d05 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/TypeDependantDrawer.cs b/Assets/Visual Behavior Tree/Editor/TypeDependantDrawer.cs deleted file mode 100644 index e923285..0000000 --- a/Assets/Visual Behavior Tree/Editor/TypeDependantDrawer.cs +++ /dev/null @@ -1,82 +0,0 @@ -using Assets.Scripts.AI; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Reflection; -using UnityEditor; -using UnityEngine; - -namespace Assets.Editor -{ - public static class TypeDependantDrawer - { - private static float parameterBuffer = 10f; - - public static void DrawAllFields(dynamic element, Rect rect) - { - DrawFieldsFlowLayout(new GUIContent(""), element, rect); - } - - private static GUIContent MakeLabel(FieldInfo field) - { - GUIContent guiContent = new GUIContent(); - guiContent.text = field.Name; - object[] descriptions = field.GetCustomAttributes(typeof(DescriptionAttribute), true); - - if (descriptions.Length > 0) - { - //just use the first one. - guiContent.tooltip = (descriptions[0] as DescriptionAttribute).Description; - } - - return guiContent; - } - - - private static void DrawFieldsFlowLayout(GUIContent label, dynamic target, Rect rect) - { - Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(target.ElementType); - FieldInfo[] fields = type.GetFields(); - - var items = new List(); - foreach (FieldInfo field in fields) - { - items.Add(field.Name); - } - - var style = EditorStyles.objectField; - style.stretchWidth = false; - style.fixedWidth = EditorGUIUtility.fieldWidth + EditorGUIUtility.labelWidth + 4; - - var boxes = EditorGUIUtility.GetFlowLayoutedRects(rect, style, 4, 4, items); - for(int i = 0; i < items.Count; ++i) - { - using (new GUILayout.AreaScope(boxes[i],"", EditorStyles.boldLabel)) - { - if (fields[i].FieldType == typeof(int)) - { - fields[i].SetValue(target, EditorGUILayout.IntField( - MakeLabel(fields[i]), (int)fields[i].GetValue(target))); - } - else if (fields[i].FieldType == typeof(float)) - { - fields[i].SetValue(target, EditorGUILayout.FloatField( - MakeLabel(fields[i]), (float)fields[i].GetValue(target))); - } - else if (fields[i].FieldType == typeof(string)) - { - fields[i].SetValue(target, EditorGUILayout.TextField( - MakeLabel(fields[i]), (string)fields[i].GetValue(target))); - } - } - } - } - - public static float GetTotalHeightOfProperties(dynamic element) - { - Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(element.ElementType); - var newHeight = 4 + EditorGUIUtility.singleLineHeight * type.GetFields().Length / 2; - return newHeight + parameterBuffer; - } - } -} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/TypeDependantDrawer.cs.meta b/Assets/Visual Behavior Tree/Editor/TypeDependantDrawer.cs.meta deleted file mode 100644 index bf33a24..0000000 --- a/Assets/Visual Behavior Tree/Editor/TypeDependantDrawer.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: 90308faa417a3b74c8637363e3fce29d -timeCreated: 1519165561 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/uVBT-Editor.asmdef.meta b/Assets/Visual Behavior Tree/Editor/uVBT-Editor.asmdef.meta deleted file mode 100644 index 1f2b8e0..0000000 --- a/Assets/Visual Behavior Tree/Editor/uVBT-Editor.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 420ba072673e29d42823595a11bb8771 -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/uVBT-Editor.asmdef b/Assets/Visual Behavior Tree/Editor/uVBT.Editor.asmdef similarity index 93% rename from Assets/Visual Behavior Tree/Editor/uVBT-Editor.asmdef rename to Assets/Visual Behavior Tree/Editor/uVBT.Editor.asmdef index 18cf85b..f4bdaf2 100644 --- a/Assets/Visual Behavior Tree/Editor/uVBT-Editor.asmdef +++ b/Assets/Visual Behavior Tree/Editor/uVBT.Editor.asmdef @@ -1,5 +1,5 @@ { - "name": "uVBT-Editor", + "name": "uVBT.Editor", "references": [ "uVBT", "UniRx", diff --git a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniRx.Async.Editor.asmdef.meta b/Assets/Visual Behavior Tree/Editor/uVBT.Editor.asmdef.meta similarity index 76% rename from Assets/Plugins/UniRx/Scripts/Async/Editor/UniRx.Async.Editor.asmdef.meta rename to Assets/Visual Behavior Tree/Editor/uVBT.Editor.asmdef.meta index 821b87b..95607c8 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/Editor/UniRx.Async.Editor.asmdef.meta +++ b/Assets/Visual Behavior Tree/Editor/uVBT.Editor.asmdef.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4129704b5a1a13841ba16f230bf24a57 +guid: 81a9318645aef0549a52f7c944a2eca5 AssemblyDefinitionImporter: externalObjects: {} userData: diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset new file mode 100644 index 0000000..4c1db40 --- /dev/null +++ b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset @@ -0,0 +1,28 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ccda9b5dedb28eb4788e2d2d8c20a954, type: 3} + m_Name: New BehaviorTreeManagerAsset 5 + m_EditorClassIdentifier: + TimesToTick: 0 + MilliSecondsBetweenTicks: 100 + RunnerElementsJSON: "[\r\n {\r\n \"SucceedFailPercentForSucceess\": 51.0,\r\n + \ \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": + 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Merge\",\r\n + \ \"Depth\": -1,\r\n \"HasChildren\": true,\r\n \"Name\": \"root\",\r\n + \ \"ID\": -1\r\n },\r\n {\r\n \"SucceedFailPercentForSucceess\": 51.0,\r\n + \ \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": + 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Merge\",\r\n + \ \"Depth\": 0,\r\n \"HasChildren\": true,\r\n \"Name\": \"Merge 1\",\r\n + \ \"ID\": 1\r\n },\r\n {\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": + {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": + \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"Depth\": 1,\r\n \"HasChildren\": + false,\r\n \"Name\": \"Inverter 0\",\r\n \"ID\": 0\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset.meta b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset.meta new file mode 100644 index 0000000..2a0fdc3 --- /dev/null +++ b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f2be543ba1a85ca42a027ed814bdd51e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset new file mode 100644 index 0000000..a333594 --- /dev/null +++ b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ccda9b5dedb28eb4788e2d2d8c20a954, type: 3} + m_Name: New BehaviorTreeManagerAsset 6 + m_EditorClassIdentifier: + TimesToTick: 0 + MilliSecondsBetweenTicks: 100 + RunnerElementsJSON: "[\r\n {\r\n \"SucceedFailPercentForSucceess\": 51.0,\r\n + \ \"Initialized\": false,\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Merge\",\r\n + \ \"Depth\": -1,\r\n \"HasChildren\": false,\r\n \"Name\": \"root\",\r\n + \ \"ID\": -1\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset.meta b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset.meta new file mode 100644 index 0000000..3c3146c --- /dev/null +++ b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6ae43df7a677cb84e95a789a9a1c2173 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Examples/TEST.asset b/Assets/Visual Behavior Tree/Examples/TEST.asset new file mode 100644 index 0000000..88240c0 --- /dev/null +++ b/Assets/Visual Behavior Tree/Examples/TEST.asset @@ -0,0 +1,27 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7130206f8e2d7e4b94035cb63f37007, type: 3} + m_Name: TEST + m_EditorClassIdentifier: + positions: [] + treeElements: "[\r\n {\r\n \"ElementType\": \"Assets.Scripts.AI.Decorators.Inverter\",\r\n + \"HasChildren\": true,\r\n \"Name\": \"Inverter\",\r\n \"ID\": 0,\r\n + \"Depth\": -1,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"SucceedPercentToSucceed\": 0.0,\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Merge\",\r\n + \"HasChildren\": true,\r\n \"Name\": \"Merge\",\r\n \"ID\": 0,\r\n \"Depth\": + 0,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"debugOutText\": + null,\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n + \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n + \"Depth\": 1,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"ElementType\": \"Assets.Scripts.AI.Components.Selector\",\r\n \"HasChildren\": + false,\r\n \"Name\": \"Selector\",\r\n \"ID\": 0,\r\n \"Depth\": 1,\r\n + \"name\": \"\",\r\n \"hideFlags\": 0\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/TEST.asset.meta b/Assets/Visual Behavior Tree/Examples/TEST.asset.meta new file mode 100644 index 0000000..6620881 --- /dev/null +++ b/Assets/Visual Behavior Tree/Examples/TEST.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: db1c8867af04f054eafc9b7672881a4c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs index ae1a19a..ae55006 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs @@ -97,7 +97,6 @@ public void Reinitialize() message: "Ticked!", behaviorID: xr.ID, newState: xr.CurrentState, - ticknum: xr.NumberOfTicksReceived.Value, context: this, state: xr); BehaviorLogger.Raw(logEntry); diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs index e4cd208..d467136 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs @@ -11,25 +11,24 @@ namespace Assets.Scripts.AI [Serializable] public abstract class BehaviorTreeElement : TreeElement, IDisposable { - //is this needed? - public LongReactiveProperty NumberOfTicksReceived { get; private set; } - //used for reflection upon JSON loading public string ElementType { get; set; } - public BehaviorTreeElement(string name, int depth, int id) + public BehaviorTreeElement(string name,int depth, int id) : base(name, depth, id) { - NumberOfTicksReceived = new LongReactiveProperty(0); ElementType = this.GetType().ToString(); CurrentState = (BehaviorState.Null); Children = new List(); } [Newtonsoft.Json.JsonIgnore] - public BehaviorState CurrentState; + private BehaviorState _currentState; + [Newtonsoft.Json.JsonIgnore] + public BehaviorState CurrentState { get => _currentState; set => _currentState = value; } + - public bool Initialized = false; + private bool Initialized = false; /// /// The primary method of action diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs index bf6280f..2e99855 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs @@ -14,7 +14,7 @@ public class Merge : BehaviorComponent { [Range(0, 100)] [SerializeField] - public float SucceedFailPercentForSucceess = 51; + public float SucceedPercentToSucceed = 51; public Merge(string name, int depth, int id) : base(name, depth, id) { } @@ -43,7 +43,7 @@ public override IObservable Start() new { total = acc.total + 1, acc.succeeded }; }) .Select(a => 100 * ((float)a.succeeded / a.total)) - .Select(ratio => ratio >= SucceedFailPercentForSucceess ? + .Select(ratio => ratio >= SucceedPercentToSucceed ? BehaviorState.Success : BehaviorState.Fail) .Publish(srcLast => src.Select(s => BehaviorState.Running) diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs index b1695b3..669dc5e 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs @@ -8,6 +8,8 @@ namespace Assets.Scripts.AI.Nodes [Serializable] public class DebugOutNode : BehaviorNode { + public string debugOutText; + public DebugOutNode(string name, int depth, int id) : base(name, depth, id) { } @@ -19,7 +21,7 @@ public override IObservable Start() CurrentState = BehaviorState.Running; //Forces an update on the state between succeeds. //DO STUFF HERE - Debug.Log("Debug Out Node " + Name + " Doing stuff"); + Debug.Log(debugOutText); //DO MORE STUFF?! return Observable.Return(BehaviorState.Success); diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElement.cs b/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElement.cs index d5be763..8cc2642 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElement.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElement.cs @@ -6,20 +6,14 @@ namespace Assets.Scripts.AI.Tree { [Serializable] - public class TreeElement + public class TreeElement : ScriptableObject { [SerializeField] int _ID; [SerializeField] string _Name; - [SerializeField] int _Depth; + [SerializeField] int _Depth; [NonSerialized] TreeElement _Parent; [NonSerialized] List _Children; - public int Depth - { - get { return _Depth; } - set { _Depth = value; } - } - [JsonIgnore] public TreeElement Parent { @@ -49,7 +43,9 @@ public int ID get { return _ID; } set { _ID = value; } } - public TreeElement () + public int Depth { get => _Depth; set => _Depth = value; } + + public TreeElement () { } @@ -57,7 +53,7 @@ public TreeElement (string name, int depth, int id) { _Name = name; _ID = id; - _Depth = depth; + _Depth = depth; } } } diff --git a/Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs b/Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs new file mode 100644 index 0000000..5ec6da8 --- /dev/null +++ b/Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs @@ -0,0 +1,17 @@ +using Assets.Scripts.AI; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Scripts +{ + public class TreeNodeAsset : ScriptableObject + { + public List positions; + + public string treeElements; + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs.meta b/Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs.meta new file mode 100644 index 0000000..e25a651 --- /dev/null +++ b/Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b7130206f8e2d7e4b94035cb63f37007 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Tests/MergeTests.cs b/Assets/Visual Behavior Tree/Tests/MergeTests.cs index d8fc326..4da094a 100644 --- a/Assets/Visual Behavior Tree/Tests/MergeTests.cs +++ b/Assets/Visual Behavior Tree/Tests/MergeTests.cs @@ -20,7 +20,7 @@ class MergeTests public void TestMergeSucceedRatioSucceeds() { var runner = new Merge("", 1, 1); - runner.SucceedFailPercentForSucceess = 51; //over 50% succeed should succeed + runner.SucceedPercentToSucceed = 51; //over 50% succeed should succeed runner.AddChild(TestingResources.GetRunRunSuccess()); //publish running, success = 1/1 runner.AddChild(TestingResources.GetRunRunSuccess()); //publish running, success = 2/2 @@ -44,7 +44,7 @@ public void TestMergeSucceedRatioSucceeds() public void TestMergeFailRatioFails() { var runner = new Merge("", 1, 1); - runner.SucceedFailPercentForSucceess = 40; //under 40% succeed should fail + runner.SucceedPercentToSucceed = 40; //under 40% succeed should fail runner.AddChild(TestingResources.GetRunRunSuccess()); //success = 1/1 runner.AddChild(TestingResources.GetRunRunFail()); //success = 1/2 diff --git a/Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef.meta b/Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef.meta deleted file mode 100644 index 808cba1..0000000 --- a/Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 02f991e9e8dc94b47adc0a3ac0f8b1c5 -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef b/Assets/Visual Behavior Tree/Tests/uVBT.Tests.asmdef similarity index 93% rename from Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef rename to Assets/Visual Behavior Tree/Tests/uVBT.Tests.asmdef index 8e5d0fe..5febb8e 100644 --- a/Assets/Visual Behavior Tree/Tests/uVBT-Tests.asmdef +++ b/Assets/Visual Behavior Tree/Tests/uVBT.Tests.asmdef @@ -1,5 +1,5 @@ { - "name": "uVBT-Tests", + "name": "uVBT.Tests", "references": [ "UniRx", "uVBT" diff --git a/Assets/Plugins/UniRx/Scripts/Async/UniRx.Async.asmdef.meta b/Assets/Visual Behavior Tree/Tests/uVBT.Tests.asmdef.meta similarity index 76% rename from Assets/Plugins/UniRx/Scripts/Async/UniRx.Async.asmdef.meta rename to Assets/Visual Behavior Tree/Tests/uVBT.Tests.asmdef.meta index e497045..0e42241 100644 --- a/Assets/Plugins/UniRx/Scripts/Async/UniRx.Async.asmdef.meta +++ b/Assets/Visual Behavior Tree/Tests/uVBT.Tests.asmdef.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f51ebe6a0ceec4240a699833d6309b23 +guid: 48f2461a9bb04a84ca5ab4a6d387dfee AssemblyDefinitionImporter: externalObjects: {} userData: diff --git a/Logs/Packages-Update.log b/Logs/Packages-Update.log index 5881ddb..3107af9 100644 --- a/Logs/Packages-Update.log +++ b/Logs/Packages-Update.log @@ -22,3 +22,60 @@ The following packages were added: The following packages were updated: com.unity.analytics from version 2.0.16 to 3.2.2 com.unity.package-manager-ui from version 1.9.11 to 2.0.3 + +=== Thu Mar 21 17:20:29 2019 + +Packages were changed. +Update Mode: updateDependencies + +The following packages were updated: + com.unity.package-manager-ui from version 2.0.3 to 2.0.7 + +=== Thu Jun 20 19:43:55 2019 + +Packages were changed. +Update Mode: updateDependencies + +The following packages were added: + com.unity.2d.tilemap@1.0.0 + com.unity.ext.nunit@1.0.0 + com.unity.test-framework@1.0.13 + com.unity.timeline@1.1.0 + com.unity.2d.sprite@1.0.0 + com.unity.ide.vscode@1.0.7 + com.unity.ide.visualstudio@1.0.11 + com.unity.ide.rider@1.0.8 + com.unity.ugui@1.0.0 + com.unity.modules.androidjni@1.0.0 + com.unity.multiplayer-hlapi@1.0.2 + com.unity.xr.legacyinputhelpers@2.0.2 +The following packages were updated: + com.unity.analytics from version 3.2.2 to 3.3.2 + com.unity.collab-proxy from version 1.2.15 to 1.2.16 + com.unity.textmeshpro from version 1.3.0 to 2.0.1 +The following packages were removed: + com.unity.package-manager-ui@2.0.7 + +=== Tue Jan 21 18:39:11 2020 + +Packages were changed. +Update Mode: updateDependencies + +The following packages were updated: + com.unity.analytics from version 3.3.2 to 3.3.4 + com.unity.ide.rider from version 1.0.8 to 1.1.4 + com.unity.ide.vscode from version 1.0.7 to 1.1.3 + com.unity.test-framework from version 1.0.14 to 1.1.9 + com.unity.timeline from version 1.1.0 to 1.2.9 + +=== Sun Jan 26 20:20:22 2020 + +Packages were changed. +Update Mode: updateDependencies + +The following packages were updated: + com.unity.collab-proxy from version 1.2.16 to 1.3.5 + com.unity.ide.rider from version 1.1.4 to 1.2.1 + com.unity.ide.visualstudio from version 1.0.11 to 2.0.0 + com.unity.ide.vscode from version 1.1.3 to 1.1.4 + com.unity.textmeshpro from version 2.0.1 to 3.0.0-preview.1 diff --git a/Packages/manifest.json b/Packages/manifest.json index e48993f..ea55305 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,10 +1,22 @@ { "dependencies": { - "com.unity.analytics": "3.2.2", - "com.unity.collab-proxy": "1.2.15", - "com.unity.package-manager-ui": "2.0.3", - "com.unity.textmeshpro": "1.3.0", + "com.unity.2d.sprite": "1.0.0", + "com.unity.2d.tilemap": "1.0.0", + "com.unity.analytics": "3.3.4", + "com.unity.collab-proxy": "1.3.5", + "com.unity.ext.nunit": "1.0.0", + "com.unity.ide.rider": "1.2.1", + "com.unity.ide.visualstudio": "2.0.0", + "com.unity.ide.vscode": "1.1.4", + "com.unity.multiplayer-hlapi": "1.0.4", + "com.unity.test-framework": "1.1.9", + "com.unity.textmeshpro": "3.0.0-preview.1", + "com.unity.timeline": "1.2.9", + "com.unity.ugui": "1.0.0", + "com.unity.xr.legacyinputhelpers": "2.0.2", + "nuget.mono-cecil": "0.1.6-preview", "com.unity.modules.ai": "1.0.0", + "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", "com.unity.modules.assetbundle": "1.0.0", "com.unity.modules.audio": "1.0.0", @@ -34,5 +46,11 @@ "com.unity.modules.vr": "1.0.0", "com.unity.modules.wind": "1.0.0", "com.unity.modules.xr": "1.0.0" - } + }, + "testables": [ + "com.unity.render-pipelines.core", + "com.unity.render-pipelines.high-definition", + "com.unity.shadergraph", + "com.unity.testframework.graphics" + ] } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 87f2544..a714dfc 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -3,7 +3,7 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 15 + serializedVersion: 17 productGUID: f9df9aaab2b9a2e4783a09e2eebba9d9 AndroidProfiler: 0 AndroidFilterTouchesWhenObscured: 0 @@ -47,7 +47,7 @@ PlayerSettings: defaultScreenWidthWeb: 960 defaultScreenHeightWeb: 600 m_StereoRenderingPath: 0 - m_ActiveColorSpace: 0 + m_ActiveColorSpace: 1 m_MTRendering: 1 m_StackTraceTypes: 010000000100000001000000010000000100000001000000 iosShowActivityIndicatorOnLoading: -1 @@ -65,6 +65,7 @@ PlayerSettings: disableDepthAndStencilBuffers: 0 androidStartInFullscreen: 1 androidRenderOutsideSafeArea: 0 + androidUseSwappy: 0 androidBlitType: 0 defaultIsNativeResolution: 1 macRetinaSupport: 1 @@ -79,6 +80,7 @@ PlayerSettings: usePlayerLog: 1 bakeCollisionMeshes: 0 forceSingleInstance: 0 + useFlipModelSwapchain: 1 resizableWindow: 0 useMacAppStoreValidation: 0 macAppStoreCategory: public.app-category.games @@ -106,6 +108,11 @@ PlayerSettings: xboxOneDisableEsram: 0 xboxOnePresentImmediateThreshold: 0 switchQueueCommandMemory: 0 + switchQueueControlMemory: 16384 + switchQueueComputeMemory: 262144 + switchNVNShaderPoolsGranularity: 33554432 + switchNVNDefaultPoolsGranularity: 16777216 + switchNVNOtherPoolsGranularity: 16777216 vulkanEnableSetSRGBWrite: 0 m_SupportedAspectRatios: 4:3: 1 @@ -120,7 +127,6 @@ PlayerSettings: m_HolographicPauseOnTrackingLoss: 1 xboxOneDisableKinectGpuReservation: 0 xboxOneEnable7thCore: 0 - isWsaHolographicRemotingEnabled: 0 vrSettings: cardboard: depthFormat: 0 @@ -135,10 +141,18 @@ PlayerSettings: hololens: depthFormat: 1 depthBufferSharingEnabled: 0 + lumin: + depthFormat: 0 + frameTiming: 2 + enableGLCache: 0 + glCacheMaxBlobSize: 524288 + glCacheMaxFileSize: 8388608 oculus: sharedDepthBuffer: 0 dashSupport: 0 + lowOverheadMode: 0 enable360StereoCapture: 0 + isWsaHolographicRemotingEnabled: 0 protectGraphicsMemory: 0 enableFrameTimingStats: 0 useHDRDisplay: 0 @@ -150,7 +164,7 @@ PlayerSettings: applicationIdentifier: {} buildNumber: {} AndroidBundleVersionCode: 1 - AndroidMinSdkVersion: 16 + AndroidMinSdkVersion: 19 AndroidTargetSdkVersion: 0 AndroidPreferredInstallLocation: 1 aotOptions: @@ -187,6 +201,10 @@ PlayerSettings: iPadHighResPortraitSplashScreen: {fileID: 0} iPadLandscapeSplashScreen: {fileID: 0} iPadHighResLandscapeSplashScreen: {fileID: 0} + iPhone65inPortraitSplashScreen: {fileID: 0} + iPhone65inLandscapeSplashScreen: {fileID: 0} + iPhone61inPortraitSplashScreen: {fileID: 0} + iPhone61inLandscapeSplashScreen: {fileID: 0} appleTVSplashScreen: {fileID: 0} appleTVSplashScreen2x: {fileID: 0} tvOSSmallIconLayers: [] @@ -230,6 +248,7 @@ PlayerSettings: tvOSManualSigningProvisioningProfileType: 0 appleEnableAutomaticSigning: 0 iOSRequireARKit: 0 + iOSAutomaticallyDetectAndAddCapabilities: 1 appleEnableProMotion: 0 clonedFromGUID: 00000000000000000000000000000000 templatePackageId: @@ -237,7 +256,7 @@ PlayerSettings: AndroidTargetArchitectures: 5 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} - AndroidKeystoreName: + AndroidKeystoreName: '{inproject}: ' AndroidKeyaliasName: AndroidBuildApkPerCpuArchitecture: 0 AndroidTVCompatibility: 1 @@ -245,20 +264,24 @@ PlayerSettings: AndroidEnableTango: 0 androidEnableBanner: 1 androidUseLowAccuracyLocation: 0 + androidUseCustomKeystore: 0 m_AndroidBanners: - width: 320 height: 180 banner: {fileID: 0} androidGamepadSupportLevel: 0 + AndroidValidateAppBundleSize: 1 + AndroidAppBundleSizeToValidate: 150 resolutionDialogBanner: {fileID: 0} m_BuildTargetIcons: [] m_BuildTargetPlatformIcons: [] m_BuildTargetBatching: [] m_BuildTargetGraphicsAPIs: [] m_BuildTargetVRSettings: [] - m_BuildTargetEnableVuforiaSettings: [] openGLRequireES31: 0 openGLRequireES31AEP: 0 + openGLRequireES32: 0 + vuforiaEnabled: 0 m_TemplateCustomTags: {} mobileMTRendering: Android: 1 @@ -388,6 +411,7 @@ PlayerSettings: switchAllowsRuntimeAddOnContentInstall: 0 switchDataLossConfirmation: 0 switchUserAccountLockEnabled: 0 + switchSystemResourceMemory: 16777216 switchSupportedNpadStyles: 3 switchNativeFsCacheSize: 32 switchIsHoldTypeHorizontal: 0 @@ -441,6 +465,7 @@ PlayerSettings: ps4DownloadDataSize: 0 ps4GarlicHeapSize: 2048 ps4ProGarlicHeapSize: 2560 + playerPrefsMaxSize: 32768 ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ ps4pnSessions: 1 ps4pnPresence: 1 @@ -474,6 +499,7 @@ PlayerSettings: monoEnv: splashScreenBackgroundSourceLandscape: {fileID: 0} splashScreenBackgroundSourcePortrait: {fileID: 0} + blurSplashScreenBackground: 1 spritePackerPolicy: webGLMemorySize: 256 webGLExceptionSupport: 1 @@ -488,7 +514,17 @@ PlayerSettings: webGLCompressionFormat: 1 webGLLinkerTarget: 1 webGLThreadsSupport: 0 - scriptingDefineSymbols: {} + webGLWasmStreaming: 0 + scriptingDefineSymbols: + 1: UNITY_POST_PROCESSING_STACK_V2 + 7: UNITY_POST_PROCESSING_STACK_V2 + 13: UNITY_POST_PROCESSING_STACK_V2 + 19: UNITY_POST_PROCESSING_STACK_V2 + 21: UNITY_POST_PROCESSING_STACK_V2 + 25: UNITY_POST_PROCESSING_STACK_V2 + 26: UNITY_POST_PROCESSING_STACK_V2 + 27: UNITY_POST_PROCESSING_STACK_V2 + 28: UNITY_POST_PROCESSING_STACK_V2 platformArchitecture: {} scriptingBackend: Standalone: 0 @@ -498,6 +534,8 @@ PlayerSettings: allowUnsafeCode: 0 additionalIl2CppArgs: scriptingRuntimeVersion: 1 + gcIncremental: 0 + gcWBarrierValidation: 0 apiCompatibilityLevelPerPlatform: {} m_RenderingPath: 1 m_MobileRenderingPath: 1 @@ -528,7 +566,6 @@ PlayerSettings: metroFTAName: metroFTAFileTypes: [] metroProtocolName: - metroCompilationOverrides: 1 XboxOneProductId: XboxOneUpdateKey: XboxOneSandboxId: @@ -553,7 +590,6 @@ PlayerSettings: XboxOneAllowedProductIds: [] XboxOnePersistentLocalStorageSize: 0 XboxOneXTitleMemory: 8 - xboxOneScriptCompiler: 0 XboxOneOverrideIdentityName: vrEditorSettings: daydream: @@ -566,7 +602,7 @@ PlayerSettings: m_PortalFolderPath: luminCert: m_CertPath: - m_PrivateKeyPath: + m_SignPackage: 1 luminIsChannelApp: 0 luminVersion: m_VersionCode: 1 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index ca32b1e..fc223cd 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1 +1,2 @@ -m_EditorVersion: 2018.3.0f2 +m_EditorVersion: 2020.1.0a20 +m_EditorVersionWithRevision: 2020.1.0a20 (019325219793) diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset index 7ef343a..4238298 100644 --- a/ProjectSettings/QualitySettings.asset +++ b/ProjectSettings/QualitySettings.asset @@ -29,9 +29,16 @@ QualitySettings: vSyncCount: 0 lodBias: 0.3 maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 particleRaycastBudget: 4 asyncUploadTimeSlice: 2 asyncUploadBufferSize: 4 + asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 excludedTargetPlatforms: [] - serializedVersion: 2 @@ -57,9 +64,16 @@ QualitySettings: vSyncCount: 0 lodBias: 0.4 maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 particleRaycastBudget: 16 asyncUploadTimeSlice: 2 asyncUploadBufferSize: 4 + asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 excludedTargetPlatforms: [] - serializedVersion: 2 @@ -85,9 +99,16 @@ QualitySettings: vSyncCount: 1 lodBias: 0.7 maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 particleRaycastBudget: 64 asyncUploadTimeSlice: 2 asyncUploadBufferSize: 4 + asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 excludedTargetPlatforms: [] - serializedVersion: 2 @@ -113,9 +134,16 @@ QualitySettings: vSyncCount: 1 lodBias: 1 maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 particleRaycastBudget: 256 asyncUploadTimeSlice: 2 asyncUploadBufferSize: 4 + asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 excludedTargetPlatforms: [] - serializedVersion: 2 @@ -141,9 +169,16 @@ QualitySettings: vSyncCount: 1 lodBias: 1.5 maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 particleRaycastBudget: 1024 asyncUploadTimeSlice: 2 asyncUploadBufferSize: 4 + asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 excludedTargetPlatforms: [] - serializedVersion: 2 @@ -169,9 +204,18 @@ QualitySettings: vSyncCount: 1 lodBias: 2 maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 particleRaycastBudget: 4096 asyncUploadTimeSlice: 2 asyncUploadBufferSize: 4 + asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 excludedTargetPlatforms: [] - m_PerPlatformDefaultQuality: {} + m_PerPlatformDefaultQuality: + Standalone: 0 + Windows Store Apps: 0 diff --git a/ProjectSettings/VFXManager.asset b/ProjectSettings/VFXManager.asset index 99af3a01f05a35b9a68f504645a46c020dbe9c55..65345a68d363f15a8a23741947279fba6a2eba16 100644 GIT binary patch literal 337 zcmZ{fK~IA~5QXpiE4GJvl7%f1+r3o@wuwYinx>x22m`FbLfFN$G5&YA>%mj!INzH$ z@6BJ==`-bwllgxAL}$~C8mPsjq&bHrEBfws5pXVu=Xn>p3h%>c5v`W=hLb~bOhG}7 zqac)aZ!hm3SeT70F=?UJf(CBARizv)$QvlFlzvyT#cgcykK>R1aDJGo3dd`TydSS# z?@(FSOb(c%F;dk!1JekaLGfv$Y2S8Wt`GZ?dV&`1r^3`D42}QyQ2YNTtyJi5;$7yV fCGv#jUUrxp9Bg0~@W{>5;S^3WwgxT=NAJilbfRlq literal 4148 zcmeH_OG*Pl5QeKAYoL1A<>xRcRzk`eP@(gDTIEEBwdxDecU z059ML^a{Fl=?NVF>Iowx2XNB`m8tqt^-uSo5Dj#QW>$!37Ee5gGO6@haygkQW#}gi zLm|M%5}&IShV#dRkN0=kx$mz+^XPRc#11_md4yw?D8Ndnn}E5XXN!UtLBSv(&qXO{ z9Q7h{0y%)>5U4(&kwVS$mS%zGN$9MjAL)JvN$^N#8;o@lNRD2eAxw2O0|qh}xZjyNXkh%_or=KKz^#oW^OUBC|CcaphIiw-e+iR6AN z=7OHUZqf7nG?IgTV19?1dGtdP74oMCZp|%ApKM$C8@YP5(NfZ>xJBt_sd~0oD|)`X zP!R#hdslLA2ZimbiY{{X#?5xCRFZx?m%4MW)sSl2iZt$PbgmJ()U>q - + diff --git a/UIElementsSchema/UnityEditor.Experimental.UIElements.xsd b/UIElementsSchema/UnityEditor.Experimental.UIElements.xsd index 318e4ce..67d928d 100644 --- a/UIElementsSchema/UnityEditor.Experimental.UIElements.xsd +++ b/UIElementsSchema/UnityEditor.Experimental.UIElements.xsd @@ -1,16 +1,18 @@  - + - - - - + + + + + - + + @@ -21,12 +23,14 @@ - - - - + + + + + - + + @@ -37,12 +41,14 @@ - - - - + + + + + - + + @@ -53,12 +59,14 @@ - - - - + + + + + - + + @@ -69,8 +77,10 @@ - - + + + + @@ -80,9 +90,11 @@ - - - + + + + + @@ -92,11 +104,13 @@ - - + + + + - - + + @@ -107,9 +121,10 @@ - - - + + + + @@ -117,12 +132,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + @@ -132,8 +207,10 @@ - - + + + + @@ -147,8 +224,10 @@ - - + + + + @@ -160,8 +239,10 @@ - - + + + + @@ -174,8 +255,10 @@ - - + + + + @@ -189,8 +272,10 @@ - - + + + + @@ -202,7 +287,7 @@ - + @@ -215,9 +300,11 @@ - - - + + + + + @@ -225,4 +312,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/UIElementsSchema/UnityEditor.PackageManager.UI.xsd b/UIElementsSchema/UnityEditor.PackageManager.UI.xsd index 7dfcab5..99da975 100644 --- a/UIElementsSchema/UnityEditor.PackageManager.UI.xsd +++ b/UIElementsSchema/UnityEditor.PackageManager.UI.xsd @@ -1,5 +1,5 @@  - + @@ -8,13 +8,14 @@ - - + + + - + @@ -22,13 +23,29 @@ - - + + + - + + + + + + + + + + + + + + + + @@ -36,13 +53,14 @@ - - + + + - + @@ -50,13 +68,14 @@ - - + + + - + @@ -64,13 +83,14 @@ - - + + + - + @@ -78,39 +98,57 @@ - - + + + + + + + + + + + + + + + + + + - - + + - - + + + - - + + - - + + + - + \ No newline at end of file diff --git a/UIElementsSchema/UnityEngine.Experimental.UIElements.xsd b/UIElementsSchema/UnityEngine.Experimental.UIElements.xsd index 9a5f2d9..cb3129a 100644 --- a/UIElementsSchema/UnityEngine.Experimental.UIElements.xsd +++ b/UIElementsSchema/UnityEngine.Experimental.UIElements.xsd @@ -1,5 +1,5 @@  - + @@ -10,7 +10,7 @@ - + @@ -23,8 +23,9 @@ - - + + + @@ -34,8 +35,9 @@ - - + + + @@ -45,8 +47,9 @@ - - + + + @@ -56,8 +59,9 @@ - - + + + @@ -68,8 +72,9 @@ - - + + + @@ -82,8 +87,9 @@ - - + + + @@ -98,18 +104,14 @@ - - - - - - - - - - - - + + + + + + + + @@ -125,10 +127,11 @@ - - - - + + + + + @@ -146,11 +149,13 @@ - - - - - + + + + + + + @@ -158,16 +163,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + - + + @@ -178,8 +226,10 @@ - - + + + + @@ -194,8 +244,9 @@ - - + + + @@ -205,8 +256,9 @@ - - + + + @@ -220,8 +272,9 @@ - - + + + @@ -234,8 +287,9 @@ - - + + + @@ -246,20 +300,67 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset new file mode 100644 index 0000000..0947dc2 --- /dev/null +++ b/UserSettings/EditorUserSettings.asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!162 &1 +EditorUserSettings: + m_ObjectHideFlags: 0 + serializedVersion: 4 + m_ConfigSettings: + UnityEditor.ShaderGraph.FloatingWindowsLayout: + value: 181344140043005e1a220d3b1f364b524c0c5a27130c293326201334cee5322ca0bd22fbf23f737e343dcb3307350831f53e061bb4510c0a1d1df84253f22f2514d70ccc19c91333cd1f0fcbd95f8bb186829aba94a9eae7f6d0b2fbeeffe0ecf4fd8afdacbbf9d4e8f5ace1f98c978883c788f7c5dccc85e0c993cbfc8983878198d59a9b9e9a8188daf6c3f28dbae8d1a3a89796ae9ba49c8c989e61aaa075722532a1feb589a4b2ba668a7c77a88d7463c423718b839f8cde3d81abaa9e8c4993979c72948ad93b8a5f8b6403226e5e636d477e516c6d57466a584e6835317f777628662b3b6a2310184d564964474b553447153e4a433f2b0c5b6e00071a011645596365504d0f607b384c3b60797b714768795b6a326b47614b62ae6729fe7d76ebe426fd3effdefe07e60a3ae7c5fee20f4e521d52154ba74296965a488e850f8b9d4b4b4a57b2d201 + flags: 0 + UnityRemoteResolution: + value: 2d5e460b0459 + flags: 0 + vcSharedLogLevel: + value: 0d5e400f0650 + flags: 0 + m_VCAutomaticAdd: 1 + m_VCDebugCom: 0 + m_VCDebugCmd: 0 + m_VCDebugOut: 0 + m_SemanticMergeMode: 2 + m_VCShowFailedCheckout: 1 + m_VCOverwriteFailedCheckoutAssets: 1 + m_VCOverlayIcons: 1 + m_VCAllowAsyncUpdate: 0 diff --git a/stuff b/stuff new file mode 100644 index 0000000..4ddfd60 --- /dev/null +++ b/stuff @@ -0,0 +1,31 @@ +[ + { + "SucceedPercentToSucceed": 0.0, + "ElementType": "Assets.Scripts.AI.Components.Merge", + "HasChildren": true, + "Name": "Merge", + "ID": 0, + "Depth": -1, + "name": "", + "hideFlags": 0 + }, + { + "debugOutText": null, + "ElementType": "Assets.Scripts.AI.Nodes.DebugOutNode", + "HasChildren": false, + "Name": "DebugOutNode", + "ID": 0, + "Depth": 0, + "name": "", + "hideFlags": 0 + }, + { + "ElementType": "Assets.Scripts.AI.Decorators.Inverter", + "HasChildren": false, + "Name": "Inverter", + "ID": 0, + "Depth": 0, + "name": "", + "hideFlags": 0 + } +] \ No newline at end of file From e57d90296c123382313f53bb659f85ebabc9129c Mon Sep 17 00:00:00 2001 From: Pooka The Wolf Date: Sat, 22 Feb 2020 17:16:46 -0700 Subject: [PATCH 09/16] Working Save/Load --- Assets/New Behavior Tree.asset | 87 ------------------- Assets/TestScene.unity | 28 +++--- .../Visual Behavior Tree/Editor/BaseEditor.cs | 5 -- .../Editor/BehaviorExtensions.cs | 15 ++-- .../BackendData/MultiColumnBTreeWindow.cs | 31 +++---- .../Editor/NodeEditor/BehaviorEditorNode.cs | 9 +- .../NodeEditor/BehaviorNodeEditorWindow.cs | 25 +++--- .../Visual Behavior Tree/Editor/TreeSaver.cs | 9 +- .../Editor/TreeValidator.cs | 23 ++++- .../Examples/New Behavior Tree.asset | 47 ++++++++++ .../Examples}/New Behavior Tree.asset.meta | 2 +- .../Examples/New Behavior Tree2.asset | 24 +++++ ...set.meta => New Behavior Tree2.asset.meta} | 2 +- .../Examples/New Behavior Tree3.asset | 71 +++++++++++++++ ...set.meta => New Behavior Tree3.asset.meta} | 4 +- .../New BehaviorTreeManagerAsset 1.asset | 20 ----- .../New BehaviorTreeManagerAsset 1.asset.meta | 8 -- .../New BehaviorTreeManagerAsset 2.asset | 20 ----- .../New BehaviorTreeManagerAsset 2.asset.meta | 8 -- .../New BehaviorTreeManagerAsset 3.asset | 27 ------ .../New BehaviorTreeManagerAsset 4.asset | 20 ----- .../New BehaviorTreeManagerAsset 4.asset.meta | 8 -- .../New BehaviorTreeManagerAsset 5.asset | 28 ------ .../New BehaviorTreeManagerAsset 5.asset.meta | 8 -- .../New BehaviorTreeManagerAsset 6.asset | 20 ----- .../New BehaviorTreeManagerAsset 6.asset.meta | 8 -- .../New BehaviorTreeManagerAsset.asset | 43 --------- .../New BehaviorTreeManagerAsset.asset.meta | 8 -- .../Visual Behavior Tree/Examples/TEST.asset | 27 ------ .../Visual Behavior Tree/Examples/test2.asset | 53 ----------- .../Examples/test2.asset.meta | 10 --- .../Scripts/AI/BehaviorManager.cs | 76 +++++----------- .../Scripts/AI/BehaviorTreeManagerAsset.cs | 56 ------------ .../AI/BehaviorTreeManagerAsset.cs.meta | 13 --- .../Scripts/AI/Components/Merge.cs | 10 +-- .../Scripts/AI/Components/Selector.cs | 2 - .../Scripts/AI/Components/Sequencer.cs | 2 +- .../Scripts/AI/Nodes/DebugOutNode.cs | 4 +- .../Scripts/TreeNodeAsset.cs | 22 +++++ .../Visual Behavior Tree/Tests/MergeTests.cs | 4 +- 40 files changed, 284 insertions(+), 603 deletions(-) delete mode 100644 Assets/New Behavior Tree.asset create mode 100644 Assets/Visual Behavior Tree/Examples/New Behavior Tree.asset rename Assets/{ => Visual Behavior Tree/Examples}/New Behavior Tree.asset.meta (78%) create mode 100644 Assets/Visual Behavior Tree/Examples/New Behavior Tree2.asset rename Assets/Visual Behavior Tree/Examples/{TEST.asset.meta => New Behavior Tree2.asset.meta} (78%) create mode 100644 Assets/Visual Behavior Tree/Examples/New Behavior Tree3.asset rename Assets/Visual Behavior Tree/Examples/{New BehaviorTreeManagerAsset 3.asset.meta => New Behavior Tree3.asset.meta} (64%) delete mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 1.asset delete mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 1.asset.meta delete mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 2.asset delete mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 2.asset.meta delete mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 3.asset delete mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 4.asset delete mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 4.asset.meta delete mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset delete mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset.meta delete mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset delete mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset.meta delete mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset.asset delete mode 100644 Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset.asset.meta delete mode 100644 Assets/Visual Behavior Tree/Examples/TEST.asset delete mode 100644 Assets/Visual Behavior Tree/Examples/test2.asset delete mode 100644 Assets/Visual Behavior Tree/Examples/test2.asset.meta delete mode 100644 Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs delete mode 100644 Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs.meta diff --git a/Assets/New Behavior Tree.asset b/Assets/New Behavior Tree.asset deleted file mode 100644 index 9ddf5d1..0000000 --- a/Assets/New Behavior Tree.asset +++ /dev/null @@ -1,87 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b7130206f8e2d7e4b94035cb63f37007, type: 3} - m_Name: New Behavior Tree - m_EditorClassIdentifier: - positions: - - serializedVersion: 2 - x: 55 - y: 150 - width: 200 - height: 150 - - serializedVersion: 2 - x: 322 - y: 172 - width: 200 - height: 150 - - serializedVersion: 2 - x: 568 - y: 82 - width: 200 - height: 150 - - serializedVersion: 2 - x: 805 - y: 39 - width: 200 - height: 150 - - serializedVersion: 2 - x: 570 - y: 227 - width: 200 - height: 150 - - serializedVersion: 2 - x: 810 - y: 347 - width: 200 - height: 150 - - serializedVersion: 2 - x: 1061 - y: 344 - width: 200 - height: 150 - - serializedVersion: 2 - x: 796 - y: 187 - width: 200 - height: 150 - - serializedVersion: 2 - x: 1060 - y: 187 - width: 200 - height: 150 - treeElements: "[\r\n {\r\n \"debugOutText\": \"AWOOOOOOOO\",\r\n \"ElementType\": - \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n \"HasChildren\": true,\r\n - \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n \"Depth\": -1,\r\n \"name\": - \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"SucceedPercentToSucceed\": - 69.0,\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Merge\",\r\n - \"HasChildren\": true,\r\n \"Name\": \"Merge\",\r\n \"ID\": 0,\r\n \"Depth\": - 0,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"debugOutText\": - \"ALSO AWOOO\",\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n - \"HasChildren\": true,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n - \"Depth\": 1,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n - \"debugOutText\": null,\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n - \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n - \"Depth\": 2,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n - \"ElementType\": \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"HasChildren\": - true,\r\n \"Name\": \"Inverter\",\r\n \"ID\": 0,\r\n \"Depth\": 1,\r\n - \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"ElementType\": - \"Assets.Scripts.AI.Components.Selector\",\r\n \"HasChildren\": true,\r\n - \"Name\": \"Selector\",\r\n \"ID\": 0,\r\n \"Depth\": 2,\r\n \"name\": - \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Sequencer\",\r\n - \"HasChildren\": false,\r\n \"Name\": \"Sequencer\",\r\n \"ID\": 0,\r\n - \"Depth\": 3,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n - \"ElementType\": \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"HasChildren\": - true,\r\n \"Name\": \"Inverter\",\r\n \"ID\": 0,\r\n \"Depth\": 2,\r\n - \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"ElementType\": - \"Assets.Scripts.AI.Components.Sequencer\",\r\n \"HasChildren\": false,\r\n - \"Name\": \"Sequencer\",\r\n \"ID\": 0,\r\n \"Depth\": 3,\r\n \"name\": - \"\",\r\n \"hideFlags\": 0\r\n }\r\n]" diff --git a/Assets/TestScene.unity b/Assets/TestScene.unity index da50c44..7b859ee 100644 --- a/Assets/TestScene.unity +++ b/Assets/TestScene.unity @@ -38,12 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.18028334, g: 0.2257134, b: 0.30692226, a: 1} + m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 11 + serializedVersion: 12 m_GIWorkflowMode: 0 m_GISettings: serializedVersion: 2 @@ -98,7 +98,8 @@ LightmapSettings: m_TrainingDataDestination: TrainingData m_LightProbeSampleCountMultiplier: 4 m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 1 + m_LightingSettings: {fileID: 4890085278179872738, guid: c6eb88022a890e1469fec23a151ba963, + type: 2} --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -153,11 +154,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 73bc91841bad4424992751c051af5030, type: 3} m_Name: m_EditorClassIdentifier: - BehaviorTreeFile: {fileID: 11400000, guid: f4cb4c96e175fa243baf0700d4057360, type: 2} + BehaviorTreeFiles: [] MilliSecondsBetweenTicks: 10000 TimesToTick: -1 - spliceNewIntoTree: 0 - SpliceList: [] --- !u!23 &132278579 MeshRenderer: m_ObjectHideFlags: 0 @@ -173,6 +172,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -197,6 +197,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!65 &132278580 BoxCollider: m_ObjectHideFlags: 0 @@ -373,6 +374,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -397,6 +399,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!65 &374731284 BoxCollider: m_ObjectHideFlags: 0 @@ -444,11 +447,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 73bc91841bad4424992751c051af5030, type: 3} m_Name: m_EditorClassIdentifier: - BehaviorTreeFile: {fileID: 11400000, guid: f4cb4c96e175fa243baf0700d4057360, type: 2} - MilliSecondsBetweenTicks: 1000 - TimesToTick: -1 - spliceNewIntoTree: 0 - SpliceList: [] + BehaviorTreeFiles: + - {fileID: 11400000, guid: b98c8b4c9f285114db64fe1fbab3f31a, type: 2} + MilliSecondsBetweenTicks: 100 + TimesToTick: 10 --- !u!1 &761835721 GameObject: m_ObjectHideFlags: 0 @@ -484,6 +486,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -508,6 +511,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!143 &761835723 CharacterController: m_ObjectHideFlags: 0 @@ -732,6 +736,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -756,6 +761,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!65 &1735717990 BoxCollider: m_ObjectHideFlags: 0 diff --git a/Assets/Visual Behavior Tree/Editor/BaseEditor.cs b/Assets/Visual Behavior Tree/Editor/BaseEditor.cs index 97686b3..d6926a8 100644 --- a/Assets/Visual Behavior Tree/Editor/BaseEditor.cs +++ b/Assets/Visual Behavior Tree/Editor/BaseEditor.cs @@ -54,11 +54,6 @@ protected void DrawDefaultInspectors(GUIContent label, T target) field.SetValue(target, EditorGUILayout.FloatField( MakeLabel(field), (float)field.GetValue(target))); } - else if(field.FieldType == typeof(List)) - { - var fieldProp = serializedObject.FindProperty(field.Name); - EditorList.Show(fieldProp, EditorListOption.Buttons | EditorListOption.ElementLabels); - } else if(field.FieldType == typeof(GameObject[])) { var fieldProp = serializedObject.FindProperty(field.Name); diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs b/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs index ec7b3ab..4465180 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs +++ b/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs @@ -1,6 +1,7 @@ using Assets.Scripts.AI; using Assets.Scripts.AI.Components; using Assets.Scripts.AI.Tree; +using Assets.Visual_Behavior_Tree.Scripts; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -84,10 +85,10 @@ public static Color GetBehaviorStateColor(this BehaviorState state) /// /// public static void SaveBehaviorAsset(this BehaviorManager behaviorManager, string filePath, - BehaviorTreeManagerAsset asset, Merge root = null) + TreeNodeAsset asset, Merge root = null) { if (asset == null) - asset = ScriptableObject.CreateInstance(); + asset = ScriptableObject.CreateInstance(); var runnerElementList = new List(); @@ -98,13 +99,13 @@ public static void SaveBehaviorAsset(this BehaviorManager behaviorManager, strin asset.name = filePath.Substring(indexS, indexD); - var json = asset.RunnerElementsJSON; + var json = asset.treeElements; if(behaviorManager != null) { behaviorManager.Reinitialize(); - asset.MilliSecondsBetweenTicks =behaviorManager.MilliSecondsBetweenTicks; - asset.TimesToTick = behaviorManager.TimesToTick; + //asset.MilliSecondsBetweenTicks =behaviorManager.MilliSecondsBetweenTicks; + //asset.TimesToTick = behaviorManager.TimesToTick; TreeElementUtility.TreeToList(behaviorManager.Runner, runnerElementList); } @@ -120,9 +121,9 @@ public static void SaveBehaviorAsset(this BehaviorManager behaviorManager, strin runnerElementList.Add(runner); } json = JsonConvert.SerializeObject(runnerElementList, Formatting.Indented); - asset.RunnerElementsJSON = json; + asset.treeElements = json; - Debug.Log("JSON Saved: " + asset.RunnerElementsJSON); + Debug.Log("JSON Saved: " + asset.treeElements); var curPath = AssetDatabase.GetAssetPath(asset); diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs index 36ba764..b155505 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs +++ b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs @@ -1,6 +1,7 @@ using Assets.Scripts.AI; using Assets.Scripts.AI.Components; using Assets.Scripts.AI.Tree; +using Assets.Visual_Behavior_Tree.Scripts; using System; using System.Collections.Generic; using System.Linq; @@ -18,7 +19,7 @@ class MultiColumnBTreeWindow : EditorWindow [SerializeField] MultiColumnHeaderState _MultiColumnHeaderState; SearchField _SearchField; MultiColumnBehaviorTreeView _TreeView; - [SerializeField] BehaviorTreeManagerAsset _BehaviorTreeManagerAsset; + [SerializeField] TreeNodeAsset _TreeNodeAsset; string FilePath = ""; private static string FileDir = "Assets/Behaviors/"; @@ -36,7 +37,7 @@ public static MultiColumnBTreeWindow GetWindow() [OnOpenAsset] public static bool OnOpenAsset(int instanceID, int line) { - var BTreeAsset = EditorUtility.InstanceIDToObject(instanceID) as BehaviorTreeManagerAsset; + var BTreeAsset = EditorUtility.InstanceIDToObject(instanceID) as TreeNodeAsset; if (BTreeAsset != null) { var window = GetWindow(); @@ -46,13 +47,13 @@ public static bool OnOpenAsset(int instanceID, int line) return false; // we did not handle the open } - public void SetTreeAsset(BehaviorTreeManagerAsset BehaviorTreeAsset) + public void SetTreeAsset(TreeNodeAsset BehaviorTreeAsset) { - if(BehaviorTreeAsset == null || BehaviorTreeAsset.RunnerElementsJSON == "") + if(BehaviorTreeAsset == null || BehaviorTreeAsset.treeElements == "") { CreateNewTree(); } - _BehaviorTreeManagerAsset = BehaviorTreeAsset; + _TreeNodeAsset = BehaviorTreeAsset; _Initialized = false; } @@ -112,12 +113,12 @@ void InitIfNeeded() IList GetData() { - if (_BehaviorTreeManagerAsset == null) + if (_TreeNodeAsset == null) { CreateNewTree(); } - var treeRoot = _BehaviorTreeManagerAsset.LoadFromJSON(); + var treeRoot = _TreeNodeAsset.LoadRoot(); if(treeRoot == null) { treeRoot = new Merge("New Root",-1, -1); @@ -131,11 +132,11 @@ IList GetData() void CreateNewTree() { - CustomAssetUtility.CreateAsset(); - _BehaviorTreeManagerAsset = (BehaviorTreeManagerAsset)Selection.activeObject; + CustomAssetUtility.CreateAsset(); + _TreeNodeAsset = (TreeNodeAsset)Selection.activeObject; var root =new Merge("root",-1,-1); - BehaviorExtensions.SaveBehaviorAsset(null, AssetDatabase.GetAssetPath(_BehaviorTreeManagerAsset), - _BehaviorTreeManagerAsset,(Merge)root); + //BehaviorExtensions.SaveBehaviorAsset(null, AssetDatabase.GetAssetPath(_TreeNodeAsset), + // _TreeNodeAsset,(Merge)root); } void OnSelectionChange() @@ -143,10 +144,10 @@ void OnSelectionChange() if (!_Initialized) return; - var BehaviorTreeAsset = Selection.activeObject as BehaviorTreeManagerAsset; - if (BehaviorTreeAsset != null && BehaviorTreeAsset != _BehaviorTreeManagerAsset) + var BehaviorTreeAsset = Selection.activeObject as TreeNodeAsset; + if (BehaviorTreeAsset != null && BehaviorTreeAsset != _TreeNodeAsset) { - _BehaviorTreeManagerAsset = BehaviorTreeAsset; + _TreeNodeAsset = BehaviorTreeAsset; _TreeView.treeModel.SetData(GetData()); _TreeView.Reload(); } @@ -195,7 +196,7 @@ void TopToolbar(Rect rect) if (GUILayout.Button("Save Tree")) { FilePath = EditorUtility.SaveFilePanel("", FileDir, "New Behavior Tree", "asset"); - BehaviorExtensions.SaveBehaviorAsset(null, FilePath, _BehaviorTreeManagerAsset, (Merge)_TreeView.treeModel.Root); + //BehaviorExtensions.SaveBehaviorAsset(null, FilePath, _TreeNodeAsset, (Merge)_TreeView.treeModel.Root); } } diff --git a/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs index 342a61e..f872337 100644 --- a/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs @@ -128,15 +128,16 @@ public void Draw() { var box = boxes[i]; box.x = box.x + 7; - box.y = box.y + 7; - box.xMax = box.xMax - 15; + box.y = box.y + 9; + box.xMax = subInspectorRect.xMax - 10; using (new GUILayout.AreaScope(box, "")) { var prop = elementObject.FindProperty(items[i]); GUILayout.BeginHorizontal(); - GUILayout.Label(prop.displayName, EditorStyles.whiteLabel, GUILayout.MinWidth(50), GUILayout.ExpandWidth(true)); - EditorGUILayout.PropertyField(prop, GUIContent.none, true, GUILayout.MinWidth(100), GUILayout.ExpandWidth(true)); + var label = new GUIContent(prop.displayName,prop.displayName); + EditorGUILayout.LabelField(label, EditorStyles.whiteLabel, GUILayout.MinWidth(45), GUILayout.ExpandWidth(true)); + EditorGUILayout.PropertyField(prop, GUIContent.none, true, GUILayout.MinWidth(95), GUILayout.ExpandWidth(true)); GUILayout.EndHorizontal(); } } diff --git a/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs index 466bdee..0977a65 100644 --- a/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs @@ -226,7 +226,17 @@ private void OnClickRemoveNode(BehaviorEditorNode node) for (int i = 0; i < connectionsToRemove.Count; i++) { - connections.Remove(connectionsToRemove[i]); + var connection = connectionsToRemove[i]; + connections.Remove(connection); + if(connection.inPoint.connections.Contains(connection)) + { + connection.inPoint.connections.Remove(connection); + } + + if (connection.outPoint.connections.Contains(connection)) + { + connection.outPoint.connections.Remove(connection); + } } connectionsToRemove = null; @@ -307,17 +317,15 @@ private void ClearConnectionSelection() private void SaveAllNodesToFile() { - var path = EditorUtility.SaveFilePanelInProject( + if (IsValidTree()) + { + var path = EditorUtility.SaveFilePanelInProject( "Save behavior tree", "New Behavior Tree.asset", "asset", "Save behavior tree asset"); - var validator = new TreeValidator(selectedNodeStyle); - - if (IsValidTree()) - { - TreeSaver saver = new TreeSaver(validator); + TreeSaver saver = new TreeSaver(); saver.SaveTree(nodes, path); } } @@ -329,13 +337,10 @@ private void LoadNodesFromFile() "", "asset"); - TreeLoader loader = new TreeLoader(); var root = loader.LoadFromAsset(path); nodes = loader.GetNodes(OnClickInPoint, OnClickOutPoint, OnClickRemoveNode); connections = loader.GetConnectionsFromRoot(root, OnClickRemoveConnection); - - } private bool IsValidTree() diff --git a/Assets/Visual Behavior Tree/Editor/TreeSaver.cs b/Assets/Visual Behavior Tree/Editor/TreeSaver.cs index 57b8163..84c23a8 100644 --- a/Assets/Visual Behavior Tree/Editor/TreeSaver.cs +++ b/Assets/Visual Behavior Tree/Editor/TreeSaver.cs @@ -14,19 +14,14 @@ namespace Assets.Visual_Behavior_Tree.Editor { public class TreeSaver { - private TreeValidator treeValidator; - private List positions; - public TreeSaver(TreeValidator validator) - { - treeValidator = validator; - } - public void SaveTree(List nodes, string path) { BehaviorEditorNode rootNode = nodes.Find(node => node.inPoint.connections.Count == 0); + rootNode.treeElement.Depth = -1; + positions = new List(); positions.Add(rootNode.fullRect); diff --git a/Assets/Visual Behavior Tree/Editor/TreeValidator.cs b/Assets/Visual Behavior Tree/Editor/TreeValidator.cs index ee2dac5..acd745b 100644 --- a/Assets/Visual Behavior Tree/Editor/TreeValidator.cs +++ b/Assets/Visual Behavior Tree/Editor/TreeValidator.cs @@ -10,6 +10,7 @@ namespace Assets.Visual_Behavior_Tree.Editor { public class TreeValidator { + private List checkNodes; private GUIStyle errorHighlightStyle; public TreeValidator(GUIStyle errorStyle) @@ -19,12 +20,13 @@ public TreeValidator(GUIStyle errorStyle) public bool IsValidTreeByNodes(List nodes) { - return HasExactlyOneRootNode(nodes); + checkNodes = nodes; + return HasExactlyOneRootNode() && NoChildHasTwoParents(); } - private bool HasExactlyOneRootNode(List nodes) + private bool HasExactlyOneRootNode() { - var rootNodes = nodes.FindAll(node => node.inPoint.connections.Count() == 0); + var rootNodes = checkNodes.FindAll(node => node.inPoint.connections.Count() == 0); if(rootNodes.Count > 1) { @@ -36,6 +38,21 @@ private bool HasExactlyOneRootNode(List nodes) return true; } + private bool NoChildHasTwoParents() + { + var errorChildNodes = checkNodes.FindAll(node => node.inPoint.connections.Count() > 1); + + if(errorChildNodes.Count > 0) + { + Debug.LogError("Behavior Tree Is INVALID! You cannot have more than one parent node for a child! Check Highlighted nodes."); + + HighlightErrorNodes(errorChildNodes); + return false; + } + + return true; + } + private void HighlightErrorNodes(List errorNodes) { foreach(var node in errorNodes) diff --git a/Assets/Visual Behavior Tree/Examples/New Behavior Tree.asset b/Assets/Visual Behavior Tree/Examples/New Behavior Tree.asset new file mode 100644 index 0000000..d93390a --- /dev/null +++ b/Assets/Visual Behavior Tree/Examples/New Behavior Tree.asset @@ -0,0 +1,47 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7130206f8e2d7e4b94035cb63f37007, type: 3} + m_Name: New Behavior Tree + m_EditorClassIdentifier: + positions: + - serializedVersion: 2 + x: 80 + y: 144 + width: 200 + height: 150 + - serializedVersion: 2 + x: 321 + y: 246 + width: 200 + height: 150 + - serializedVersion: 2 + x: 603 + y: 246 + width: 200 + height: 150 + - serializedVersion: 2 + x: 319 + y: 94 + width: 200 + height: 150 + treeElements: "[\r\n {\r\n \"SucceedPercent\": 100.0,\r\n \"ElementType\": + \"Assets.Scripts.AI.Components.Merge\",\r\n \"HasChildren\": true,\r\n + \"Name\": \"Merge\",\r\n \"ID\": 0,\r\n \"Depth\": -1,\r\n \"name\": + \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Selector\",\r\n + \"HasChildren\": true,\r\n \"Name\": \"Selector\",\r\n \"ID\": 0,\r\n + \"Depth\": 0,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"debugOutText\": \"SELECT AWOO\",\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n + \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n + \"Depth\": 1,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"debugOutText\": \"AWOO\",\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n + \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n + \"Depth\": 0,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n }\r\n]" diff --git a/Assets/New Behavior Tree.asset.meta b/Assets/Visual Behavior Tree/Examples/New Behavior Tree.asset.meta similarity index 78% rename from Assets/New Behavior Tree.asset.meta rename to Assets/Visual Behavior Tree/Examples/New Behavior Tree.asset.meta index 2db324f..3f670c0 100644 --- a/Assets/New Behavior Tree.asset.meta +++ b/Assets/Visual Behavior Tree/Examples/New Behavior Tree.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7582ae5e6ac4036408cbbc9d5fd58439 +guid: c5480270339fde44f90517cbc0a3108f NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 diff --git a/Assets/Visual Behavior Tree/Examples/New Behavior Tree2.asset b/Assets/Visual Behavior Tree/Examples/New Behavior Tree2.asset new file mode 100644 index 0000000..2c5b718 --- /dev/null +++ b/Assets/Visual Behavior Tree/Examples/New Behavior Tree2.asset @@ -0,0 +1,24 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7130206f8e2d7e4b94035cb63f37007, type: 3} + m_Name: New Behavior Tree2 + m_EditorClassIdentifier: + positions: + - serializedVersion: 2 + x: 355 + y: 158 + width: 200 + height: 150 + treeElements: "[\r\n {\r\n \"debugOutText\": \"AWOO\",\r\n \"ElementType\": + \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n \"HasChildren\": false,\r\n + \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n \"Depth\": -1,\r\n \"name\": + \"\",\r\n \"hideFlags\": 0\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/TEST.asset.meta b/Assets/Visual Behavior Tree/Examples/New Behavior Tree2.asset.meta similarity index 78% rename from Assets/Visual Behavior Tree/Examples/TEST.asset.meta rename to Assets/Visual Behavior Tree/Examples/New Behavior Tree2.asset.meta index 6620881..1aa7316 100644 --- a/Assets/Visual Behavior Tree/Examples/TEST.asset.meta +++ b/Assets/Visual Behavior Tree/Examples/New Behavior Tree2.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: db1c8867af04f054eafc9b7672881a4c +guid: 47aa65c014fca5c4b84622b79234ac8b NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 diff --git a/Assets/Visual Behavior Tree/Examples/New Behavior Tree3.asset b/Assets/Visual Behavior Tree/Examples/New Behavior Tree3.asset new file mode 100644 index 0000000..788c050 --- /dev/null +++ b/Assets/Visual Behavior Tree/Examples/New Behavior Tree3.asset @@ -0,0 +1,71 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7130206f8e2d7e4b94035cb63f37007, type: 3} + m_Name: New Behavior Tree3 + m_EditorClassIdentifier: + positions: + - serializedVersion: 2 + x: -156 + y: 88 + width: 200 + height: 150 + - serializedVersion: 2 + x: 85 + y: 190 + width: 200 + height: 150 + - serializedVersion: 2 + x: 325 + y: 192 + width: 200 + height: 150 + - serializedVersion: 2 + x: 83 + y: 38 + width: 200 + height: 150 + - serializedVersion: 2 + x: 86 + y: 348 + width: 200 + height: 150 + - serializedVersion: 2 + x: 311 + y: 346 + width: 200 + height: 150 + - serializedVersion: 2 + x: 539 + y: 350 + width: 200 + height: 150 + treeElements: "[\r\n {\r\n \"SucceedPercent\": 100.0,\r\n \"ElementType\": + \"Assets.Scripts.AI.Components.Merge\",\r\n \"HasChildren\": true,\r\n + \"Name\": \"Merge\",\r\n \"ID\": 0,\r\n \"Depth\": -1,\r\n \"name\": + \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Selector\",\r\n + \"HasChildren\": true,\r\n \"Name\": \"Selector\",\r\n \"ID\": 0,\r\n + \"Depth\": 0,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"debugOutText\": \"SELECT AWOO\",\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n + \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n + \"Depth\": 1,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"debugOutText\": \"AWOO\",\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n + \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n + \"Depth\": 0,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"ElementType\": \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"HasChildren\": + true,\r\n \"Name\": \"Inverter\",\r\n \"ID\": 0,\r\n \"Depth\": 0,\r\n + \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"ElementType\": + \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"HasChildren\": true,\r\n + \"Name\": \"Inverter\",\r\n \"ID\": 0,\r\n \"Depth\": 1,\r\n \"name\": + \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"debugOutText\": \"ALSO + AWOO\",\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n + \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n + \"Depth\": 2,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 3.asset.meta b/Assets/Visual Behavior Tree/Examples/New Behavior Tree3.asset.meta similarity index 64% rename from Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 3.asset.meta rename to Assets/Visual Behavior Tree/Examples/New Behavior Tree3.asset.meta index 8dc54ab..765ca78 100644 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 3.asset.meta +++ b/Assets/Visual Behavior Tree/Examples/New Behavior Tree3.asset.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: 4e6f222bb6258d74fbb9b433517c5811 +guid: b98c8b4c9f285114db64fe1fbab3f31a NativeFormatImporter: externalObjects: {} - mainObjectFileID: 11400000 + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 1.asset b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 1.asset deleted file mode 100644 index 4cf49f9..0000000 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 1.asset +++ /dev/null @@ -1,20 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ccda9b5dedb28eb4788e2d2d8c20a954, type: 3} - m_Name: New BehaviorTreeManagerAsset 1 - m_EditorClassIdentifier: - TimesToTick: 0 - SecondsBetweenTicks: 0.1 - RunnerElementsJSON: "[\r\n {\r\n \"NumberOfFailuresBeforeFail\": 0,\r\n \"NumberOfSuccessBeforeSucceed\": - 0,\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.ParallelRunner\",\r\n - \ \"Depth\": -1,\r\n \"HasChildren\": false,\r\n \"Name\": \"root\",\r\n - \ \"ID\": -1\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 1.asset.meta b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 1.asset.meta deleted file mode 100644 index 7426080..0000000 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 1.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ffad9363e8ef7564ab91378eeac8c5a8 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 2.asset b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 2.asset deleted file mode 100644 index 7331a81..0000000 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 2.asset +++ /dev/null @@ -1,20 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ccda9b5dedb28eb4788e2d2d8c20a954, type: 3} - m_Name: New BehaviorTreeManagerAsset 2 - m_EditorClassIdentifier: - TimesToTick: 0 - SecondsBetweenTicks: 0.1 - RunnerElementsJSON: "[\r\n {\r\n \"NumberOfFailuresBeforeFail\": 0,\r\n \"NumberOfSuccessBeforeSucceed\": - 0,\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.ParallelRunner\",\r\n - \ \"Depth\": -1,\r\n \"HasChildren\": false,\r\n \"Name\": \"root\",\r\n - \ \"ID\": -1\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 2.asset.meta b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 2.asset.meta deleted file mode 100644 index 358b714..0000000 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 2.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 65b380827923ec54a9e62d5a93692437 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 3.asset b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 3.asset deleted file mode 100644 index 676affc..0000000 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 3.asset +++ /dev/null @@ -1,27 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ccda9b5dedb28eb4788e2d2d8c20a954, type: 3} - m_Name: New BehaviorTreeManagerAsset 3 - m_EditorClassIdentifier: - TimesToTick: -1 - SecondsBetweenTicks: 1 - RunnerElementsJSON: "[\r\n {\r\n \"NumberOfFailuresBeforeFail\": 0,\r\n \"NumberOfSuccessBeforeSucceed\": - 0,\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.ParallelRunner\",\r\n - \ \"Depth\": -1,\r\n \"HasChildren\": true,\r\n \"Name\": \"root\",\r\n - \ \"ID\": -1\r\n },\r\n {\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": - {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": - \"Assets.Scripts.AI.Components.Sequencer\",\r\n \"Depth\": 0,\r\n \"HasChildren\": - true,\r\n \"Name\": \"Sequencer 6\",\r\n \"ID\": 6\r\n },\r\n {\r\n \"prefabsToSwapBetween\": - null,\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Visual_Behavior_Tree.Scripts.AI.Nodes.SwapPrefabsOnTime\",\r\n - \ \"Depth\": 1,\r\n \"HasChildren\": false,\r\n \"Name\": \"SwapPrefabsOnTime - 7\",\r\n \"ID\": 7\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 4.asset b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 4.asset deleted file mode 100644 index 30a27d2..0000000 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 4.asset +++ /dev/null @@ -1,20 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ccda9b5dedb28eb4788e2d2d8c20a954, type: 3} - m_Name: New BehaviorTreeManagerAsset 4 - m_EditorClassIdentifier: - TimesToTick: 0 - SecondsBetweenTicks: 0.1 - RunnerElementsJSON: "[\r\n {\r\n \"NumberOfFailuresBeforeFail\": 0,\r\n \"NumberOfSuccessBeforeSucceed\": - 0,\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.ParallelRunner\",\r\n - \ \"Depth\": -1,\r\n \"HasChildren\": false,\r\n \"Name\": \"root\",\r\n - \ \"ID\": -1\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 4.asset.meta b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 4.asset.meta deleted file mode 100644 index 7424b30..0000000 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 4.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6c70252dce4e7cc46a0c93655e40c458 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset deleted file mode 100644 index 4c1db40..0000000 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset +++ /dev/null @@ -1,28 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ccda9b5dedb28eb4788e2d2d8c20a954, type: 3} - m_Name: New BehaviorTreeManagerAsset 5 - m_EditorClassIdentifier: - TimesToTick: 0 - MilliSecondsBetweenTicks: 100 - RunnerElementsJSON: "[\r\n {\r\n \"SucceedFailPercentForSucceess\": 51.0,\r\n - \ \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Merge\",\r\n - \ \"Depth\": -1,\r\n \"HasChildren\": true,\r\n \"Name\": \"root\",\r\n - \ \"ID\": -1\r\n },\r\n {\r\n \"SucceedFailPercentForSucceess\": 51.0,\r\n - \ \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Merge\",\r\n - \ \"Depth\": 0,\r\n \"HasChildren\": true,\r\n \"Name\": \"Merge 1\",\r\n - \ \"ID\": 1\r\n },\r\n {\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": - {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": - \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"Depth\": 1,\r\n \"HasChildren\": - false,\r\n \"Name\": \"Inverter 0\",\r\n \"ID\": 0\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset.meta b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset.meta deleted file mode 100644 index 2a0fdc3..0000000 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 5.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f2be543ba1a85ca42a027ed814bdd51e -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset deleted file mode 100644 index a333594..0000000 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset +++ /dev/null @@ -1,20 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ccda9b5dedb28eb4788e2d2d8c20a954, type: 3} - m_Name: New BehaviorTreeManagerAsset 6 - m_EditorClassIdentifier: - TimesToTick: 0 - MilliSecondsBetweenTicks: 100 - RunnerElementsJSON: "[\r\n {\r\n \"SucceedFailPercentForSucceess\": 51.0,\r\n - \ \"Initialized\": false,\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Merge\",\r\n - \ \"Depth\": -1,\r\n \"HasChildren\": false,\r\n \"Name\": \"root\",\r\n - \ \"ID\": -1\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset.meta b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset.meta deleted file mode 100644 index 3c3146c..0000000 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset 6.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6ae43df7a677cb84e95a789a9a1c2173 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset.asset b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset.asset deleted file mode 100644 index 92812ba..0000000 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset.asset +++ /dev/null @@ -1,43 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ccda9b5dedb28eb4788e2d2d8c20a954, type: 3} - m_Name: New BehaviorTreeManagerAsset - m_EditorClassIdentifier: - TimesToTick: 0 - SecondsBetweenTicks: 0.1 - RunnerElementsJSON: "[\r\n {\r\n \"NumberOfFailuresBeforeFail\": 0,\r\n \"NumberOfSuccessBeforeSucceed\": - 0,\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.ParallelRunner\",\r\n - \ \"Depth\": -1,\r\n \"HasChildren\": true,\r\n \"Name\": \"root\",\r\n - \ \"ID\": -1\r\n },\r\n {\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": - {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": - \"Assets.Scripts.AI.Components.Sequencer\",\r\n \"Depth\": 0,\r\n \"HasChildren\": - true,\r\n \"Name\": \"Sequencer 0\",\r\n \"ID\": 0\r\n },\r\n {\r\n \"NumberOfFailuresBeforeFail\": - 0,\r\n \"NumberOfSuccessBeforeSucceed\": 0,\r\n \"Initialized\": false,\r\n - \ \"NumberOfTicksReceived\": {\r\n \"Value\": 0,\r\n \"HasValue\": - true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.ParallelRunner\",\r\n - \ \"Depth\": 1,\r\n \"HasChildren\": true,\r\n \"Name\": \"ParallelRunner - 4\",\r\n \"ID\": 4\r\n },\r\n {\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": - {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": - \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"Depth\": 2,\r\n \"HasChildren\": - true,\r\n \"Name\": \"Inverter 5\",\r\n \"ID\": 5\r\n },\r\n {\r\n \"Initialized\": - false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": 0,\r\n \"HasValue\": - true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n - \ \"Depth\": 3,\r\n \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode - 3\",\r\n \"ID\": 3\r\n },\r\n {\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": - {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": - \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"Depth\": 1,\r\n \"HasChildren\": - true,\r\n \"Name\": \"Inverter 1\",\r\n \"ID\": 1\r\n },\r\n {\r\n \"MoveSpeed\": - 1.0,\r\n \"UpdatePlayersTickInterval\": 20,\r\n \"UpdateSelfPositionTickInterval\": - 5,\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.MoveEnemyIfCloseToPlayer\",\r\n - \ \"Depth\": 2,\r\n \"HasChildren\": false,\r\n \"Name\": \"MoveEnemyIfCloseToPlayer - 2\",\r\n \"ID\": 2\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset.asset.meta b/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset.asset.meta deleted file mode 100644 index 3011d52..0000000 --- a/Assets/Visual Behavior Tree/Examples/New BehaviorTreeManagerAsset.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 04be9775676dbc24c92412e08aa55b82 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Examples/TEST.asset b/Assets/Visual Behavior Tree/Examples/TEST.asset deleted file mode 100644 index 88240c0..0000000 --- a/Assets/Visual Behavior Tree/Examples/TEST.asset +++ /dev/null @@ -1,27 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b7130206f8e2d7e4b94035cb63f37007, type: 3} - m_Name: TEST - m_EditorClassIdentifier: - positions: [] - treeElements: "[\r\n {\r\n \"ElementType\": \"Assets.Scripts.AI.Decorators.Inverter\",\r\n - \"HasChildren\": true,\r\n \"Name\": \"Inverter\",\r\n \"ID\": 0,\r\n - \"Depth\": -1,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n - \"SucceedPercentToSucceed\": 0.0,\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Merge\",\r\n - \"HasChildren\": true,\r\n \"Name\": \"Merge\",\r\n \"ID\": 0,\r\n \"Depth\": - 0,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"debugOutText\": - null,\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n - \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n - \"Depth\": 1,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n - \"ElementType\": \"Assets.Scripts.AI.Components.Selector\",\r\n \"HasChildren\": - false,\r\n \"Name\": \"Selector\",\r\n \"ID\": 0,\r\n \"Depth\": 1,\r\n - \"name\": \"\",\r\n \"hideFlags\": 0\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/test2.asset b/Assets/Visual Behavior Tree/Examples/test2.asset deleted file mode 100644 index ee0cb2c..0000000 --- a/Assets/Visual Behavior Tree/Examples/test2.asset +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ccda9b5dedb28eb4788e2d2d8c20a954, type: 3} - m_Name: test2 - m_EditorClassIdentifier: - TimesToTick: 135 - MilliSecondsBetweenTicks: 1000 - RunnerElementsJSON: "[\r\n {\r\n \"NumberOfFailuresBeforeFail\": 0,\r\n \"NumberOfSuccessBeforeSucceed\": - 0,\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.ParallelRunner\",\r\n - \ \"Depth\": -1,\r\n \"HasChildren\": true,\r\n \"Name\": \"New Root\",\r\n - \ \"ID\": -1\r\n },\r\n {\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": - {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": - \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n \"Depth\": 0,\r\n \"HasChildren\": - false,\r\n \"Name\": \"DebugOutNode 9\",\r\n \"ID\": 9\r\n },\r\n {\r\n - \ \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Decorators.Inverter\",\r\n - \ \"Depth\": 0,\r\n \"HasChildren\": true,\r\n \"Name\": \"Inverter 4\",\r\n - \ \"ID\": 4\r\n },\r\n {\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": - {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": - \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n \"Depth\": 1,\r\n \"HasChildren\": - false,\r\n \"Name\": \"DebugOutNode 2\",\r\n \"ID\": 2\r\n },\r\n {\r\n - \ \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Selector\",\r\n - \ \"Depth\": 0,\r\n \"HasChildren\": true,\r\n \"Name\": \"Selector 0\",\r\n - \ \"ID\": 0\r\n },\r\n {\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": - {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": - \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"Depth\": 1,\r\n \"HasChildren\": - true,\r\n \"Name\": \"Inverter 10\",\r\n \"ID\": 10\r\n },\r\n {\r\n \"Initialized\": - false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": 0,\r\n \"HasValue\": - true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Selector\",\r\n - \ \"Depth\": 2,\r\n \"HasChildren\": true,\r\n \"Name\": \"Selector 11\",\r\n - \ \"ID\": 11\r\n },\r\n {\r\n \"Initialized\": false,\r\n \"NumberOfTicksReceived\": - {\r\n \"Value\": 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": - \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n \"Depth\": 3,\r\n \"HasChildren\": - false,\r\n \"Name\": \"DebugOutNode 13\",\r\n \"ID\": 13\r\n },\r\n {\r\n - \ \"Initialized\": false,\r\n \"NumberOfTicksReceived\": {\r\n \"Value\": - 0,\r\n \"HasValue\": true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n - \ \"Depth\": 3,\r\n \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode - 12\",\r\n \"ID\": 12\r\n },\r\n {\r\n \"MoveSpeed\": 12.0,\r\n \"UpdatePlayersTickInterval\": - 6,\r\n \"UpdateSelfPositionTickInterval\": 3,\r\n \"Initialized\": false,\r\n - \ \"NumberOfTicksReceived\": {\r\n \"Value\": 0,\r\n \"HasValue\": - true\r\n },\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.MoveEnemyIfCloseToPlayer\",\r\n - \ \"Depth\": 1,\r\n \"HasChildren\": false,\r\n \"Name\": \"MoveEnemyIfCloseToPlayer - 3\",\r\n \"ID\": 3\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/test2.asset.meta b/Assets/Visual Behavior Tree/Examples/test2.asset.meta deleted file mode 100644 index a426336..0000000 --- a/Assets/Visual Behavior Tree/Examples/test2.asset.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: f4cb4c96e175fa243baf0700d4057360 -timeCreated: 1521491226 -licenseType: Free -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs index ae55006..348b8f6 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs @@ -10,6 +10,7 @@ using System.Linq; using Assets.Scripts.AI.Behavior_Logger; using UniRx.Diagnostics; +using Assets.Visual_Behavior_Tree.Scripts; namespace Assets.Scripts.AI { @@ -22,7 +23,7 @@ public BehaviorLogger BehaviorLogger { if(behaviorLogger == null) { - behaviorLogger = new BehaviorLogger(gameObject.name + ": " + BehaviorTreeFile.name + " Tree"); + behaviorLogger = new BehaviorLogger(gameObject.name + ": " + BehaviorTreeFiles.Count + " Trees"); } return behaviorLogger; } @@ -37,10 +38,10 @@ private set /// The file to actually save/load to/from. /// [JsonIgnore] - [Description("The currently loaded tree asset that will be run.")] - public BehaviorTreeManagerAsset BehaviorTreeFile; + [Description("The currently loaded tree assets that will be run concurrently.")] + public List BehaviorTreeFiles; - public Merge Runner { get; set; } = new Merge("Main Root", -1, -1); + public BehaviorTreeElement Runner { get; set; } /// /// Seconds between every tick. At "0" this will tick every frame (basically an update loop) @@ -57,14 +58,6 @@ private set [Description("Times to tick this tree before stopping. Negative values indicate infinitely running behavior.")] public int TimesToTick = 10; - [Description("Open a list to splice other trees into this tree.")] - public bool spliceNewIntoTree = false; - /// - /// A list of trees to splice into the current tree. These trees are not directly editable from here. - /// - [JsonIgnore] - public List SpliceList; - private bool initialized = false; public void InitIfNeeded() @@ -80,13 +73,21 @@ public void InitIfNeeded() public void Reinitialize() { //TODO: Change to runner extension - Runner = BehaviorTreeFile.LoadFromJSON(this); - - if(spliceNewIntoTree) SpliceIntoRunner(); - TreeElementUtility.TreeToList(Runner, treeList); + if(BehaviorTreeFiles.Count > 1) + { + Runner = ScriptableObject.CreateInstance(); + Runner.Depth = -1; + Runner.ID = -1; + foreach (var asset in BehaviorTreeFiles) + { + var childRoot = asset.LoadRoot(); + Debug.Log("child root: " + childRoot); + ((Merge)Runner).AddChild(childRoot); + } + } + else Runner = BehaviorTreeFiles.First().LoadRoot(); - var treeQuery = treeList.AsEnumerable(); TreeSubject = new Subject(); TreeSubject.Subscribe(xr => { @@ -100,7 +101,7 @@ public void Reinitialize() context: this, state: xr); BehaviorLogger.Raw(logEntry); - Debug.Log("xr debug initialize"); + Debug.Log(logEntry); }).AddTo(this); initialized = true; @@ -120,46 +121,15 @@ void Start() .Do(cx => { if (TimesToTick > 0) --TimesToTick; - Debug.Log(TimesToTick); - Runner.Start(); - TreeSubject.OnNext(Runner); + Runner.Start().Subscribe(); + + //TreeSubject.OnNext(Runner); }) - .Debug("") + //.Debug("") .Subscribe() .AddTo(this); } - /// - /// Splice all trees in the "splice" area of the editor and return "true" if new trees were spliced. - /// - /// - /// - //TODO: Swap this to a reactive approach. - public bool SpliceIntoRunner() - { - if (SpliceList != null) - { - foreach (var behaviorAsset in SpliceList) - { - if (behaviorAsset == null) return false; - - var spliceTree = behaviorAsset.LoadFromJSON(); - - foreach (var behavior in spliceTree.Children) - { - if (behavior.Depth == -1 || behavior.Name == "root") continue; - - dynamic newBehavior = Activator.CreateInstance(Type.GetType(((BehaviorTreeElement)behavior).ElementType), - behavior.Name, behavior.Depth, behavior.ID); - newBehavior.BehaviorTreeManager = this; - Runner.AddChild(newBehavior); - } - } - return true; - } - else return false; - } - public void Dispose() { Runner.Dispose(); diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs deleted file mode 100644 index 5b85584..0000000 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Assets.Scripts.AI.Components; -using Assets.Scripts.AI.Tree; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Reflection; -using UnityEngine; - -namespace Assets.Scripts.AI -{ - [System.Serializable] - public class BehaviorTreeManagerAsset : ScriptableObject - { - public int TimesToTick; - public double MilliSecondsBetweenTicks = 100; - - public string RunnerElementsJSON; - } - - public static class AssetExtensions - { - public static Merge LoadFromJSON(this BehaviorTreeManagerAsset asset, BehaviorManager manager = null) - { - //TODO: Confirm reload from json - if (asset == null) - { - Debug.Log("Asset is null when loading"); - return new Merge("Empty Root", -1, -1); - } - else - { - //Elements should be a list of dynamic objects - var elements = JsonConvert.DeserializeObject>(asset.RunnerElementsJSON); - - var newElements = new List(); - foreach(dynamic el in elements) - { - string typeName = el.ElementType; - Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(typeName); - dynamic newBehavior = Activator.CreateInstance(type, (string)el.Name, (int)el.Depth, (int)el.ID); - - JsonConvert.PopulateObject(JsonConvert.SerializeObject(el), newBehavior); - newElements.Add(newBehavior); - } - var str = ""; - foreach(var e in newElements) - { - str += e.Name + "\n"; - } - - var tree = TreeElementUtility.ListToTree(newElements); - return (Merge)tree; - } - } - } -} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs.meta b/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs.meta deleted file mode 100644 index 0cddf6f..0000000 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeManagerAsset.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: ccda9b5dedb28eb4788e2d2d8c20a954 -timeCreated: 1519777428 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs index 2e99855..1fff71b 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs @@ -14,7 +14,7 @@ public class Merge : BehaviorComponent { [Range(0, 100)] [SerializeField] - public float SucceedPercentToSucceed = 51; + public float SucceedPercent = 51; public Merge(string name, int depth, int id) : base(name, depth, id) { } @@ -23,7 +23,7 @@ public override IObservable Start() { if (Children == null || Children.Count == 0) { - Debug.LogWarning("Children Null in parallel runner"); + Debug.LogWarning("Children Null in merge component"); return Observable.Return(BehaviorState.Fail); } @@ -33,8 +33,8 @@ public override IObservable Start() .Where(st => st != BehaviorState.Running)); - //should take all streams and publish running until last stream finishes... - //once last stream finishes, must emit "success" or "fail" based on set ratio... + //takes all children streams and publishes running until last stream finishes. + //once last stream finishes, emits "success" or "fail" based on set success ratio. return source.Publish(src => src.Aggregate(new { total = 0, succeeded = 0 }, (acc, childResult) => { @@ -43,7 +43,7 @@ public override IObservable Start() new { total = acc.total + 1, acc.succeeded }; }) .Select(a => 100 * ((float)a.succeeded / a.total)) - .Select(ratio => ratio >= SucceedPercentToSucceed ? + .Select(ratio => ratio >= SucceedPercent ? BehaviorState.Success : BehaviorState.Fail) .Publish(srcLast => src.Select(s => BehaviorState.Running) diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs index 6f16aa6..5746ba4 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs @@ -27,14 +27,12 @@ public override IObservable Start() Debug.LogWarning("Children Null in " + this.Name); return Observable.Return(BehaviorState.Fail); } - var sourceConcat = Children.ToObservable() .Select(child => ((BehaviorTreeElement)child).Start() .Where(st => st != BehaviorState.Running)) .Concat(); //Sequentially run children and select the final value (should be fail/succeed/error) - // return sourceConcat.Publish(src => src.Any(e => e == BehaviorState.Success) //true if any succeed, false if none succeed .Select(e => e ? BehaviorState.Success : BehaviorState.Fail) //Success if any succeed, fail if all fail diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs b/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs index 9b6ab28..a534dbf 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs @@ -1,4 +1,4 @@ -using Assets.Visual_Behavior_Tree.Scripts; + using Assets.Visual_Behavior_Tree.Scripts; using System; using System.Collections; using System.ComponentModel; diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs index 669dc5e..050e238 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs +++ b/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs @@ -17,9 +17,9 @@ public DebugOutNode(string name, int depth, int id) public override IObservable Start() { - base.Initialize(); + //base.Initialize(); - CurrentState = BehaviorState.Running; //Forces an update on the state between succeeds. + CurrentState = BehaviorState.Null; //Forces an update on the state between succeeds. //DO STUFF HERE Debug.Log(debugOutText); //DO MORE STUFF?! diff --git a/Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs b/Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs index 5ec6da8..441eb11 100644 --- a/Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs +++ b/Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs @@ -1,7 +1,10 @@ using Assets.Scripts.AI; +using Assets.Scripts.AI.Tree; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using UnityEngine; @@ -14,4 +17,23 @@ public class TreeNodeAsset : ScriptableObject public string treeElements; } + + public static class AssetExtensions + { + public static BehaviorTreeElement LoadRoot(this TreeNodeAsset asset) + { + var elements = JsonConvert.DeserializeObject>(asset.treeElements); + + var behaviorElements = new List(); + foreach (dynamic el in elements) + { + string typeName = el.ElementType; + Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(typeName); + dynamic newBehavior = Activator.CreateInstance(type, (string)el.Name, (int)el.Depth, (int)el.ID); + JsonConvert.PopulateObject(JsonConvert.SerializeObject(el), newBehavior); + behaviorElements.Add(newBehavior); + } + return TreeElementUtility.ListToTree(behaviorElements); + } + } } diff --git a/Assets/Visual Behavior Tree/Tests/MergeTests.cs b/Assets/Visual Behavior Tree/Tests/MergeTests.cs index 4da094a..9e4f919 100644 --- a/Assets/Visual Behavior Tree/Tests/MergeTests.cs +++ b/Assets/Visual Behavior Tree/Tests/MergeTests.cs @@ -20,7 +20,7 @@ class MergeTests public void TestMergeSucceedRatioSucceeds() { var runner = new Merge("", 1, 1); - runner.SucceedPercentToSucceed = 51; //over 50% succeed should succeed + runner.SucceedPercent = 51; //over 50% succeed should succeed runner.AddChild(TestingResources.GetRunRunSuccess()); //publish running, success = 1/1 runner.AddChild(TestingResources.GetRunRunSuccess()); //publish running, success = 2/2 @@ -44,7 +44,7 @@ public void TestMergeSucceedRatioSucceeds() public void TestMergeFailRatioFails() { var runner = new Merge("", 1, 1); - runner.SucceedPercentToSucceed = 40; //under 40% succeed should fail + runner.SucceedPercent = 40; //under 40% succeed should fail runner.AddChild(TestingResources.GetRunRunSuccess()); //success = 1/1 runner.AddChild(TestingResources.GetRunRunFail()); //success = 1/2 From 4b50ccf5c4263df6444aaa4e71ba27aeb9e176f8 Mon Sep 17 00:00:00 2001 From: Pooka The Wolf Date: Fri, 3 Jul 2020 17:22:29 -0700 Subject: [PATCH 10/16] Added UI Toolkit-based window editor --- .../{Visual Behavior Tree => }/Scripts.meta | 0 .../Scripts/AI.meta | 20 +- .../Scripts/AI/Behavior Logger.meta | 20 +- .../BehaviorDebugExtensions.cs | 44 +- .../BehaviorDebugExtensions.cs.meta | 26 +- .../AI/Behavior Logger/BehaviorLogEntry.cs | 132 +-- .../Behavior Logger/BehaviorLogEntry.cs.meta | 26 +- .../AI/Behavior Logger/BehaviorLogger.cs | 272 +++--- .../AI/Behavior Logger/BehaviorLogger.cs.meta | 26 +- .../ObservableBehaviorLogger.cs | 52 +- .../ObservableBehaviorLogger.cs.meta | 26 +- .../Scripts/AI/BehaviorManager.cs | 263 +++--- .../Scripts/AI/BehaviorManager.cs.meta | 24 +- .../Scripts/AI/BehaviorState.cs | 28 +- .../Scripts/AI/BehaviorState.cs.meta | 26 +- .../Scripts/AI/BehaviorTreeElement.cs | 256 ++--- .../Scripts/AI/BehaviorTreeElement.cs.meta | 26 +- .../Scripts/AI/Components.meta | 20 +- .../AI/Components/BehaviorComponent.cs | 60 +- .../AI/Components/BehaviorComponent.cs.meta | 26 +- .../Scripts/AI/Components/Merge.cs | 110 +-- .../Scripts/AI/Components/Merge.cs.meta | 0 .../Scripts/AI/Components/Selector.cs | 88 +- .../Scripts/AI/Components/Selector.cs.meta | 26 +- .../Scripts/AI/Components/Sequencer.cs | 86 +- .../Scripts/AI/Components/Sequencer.cs.meta | 26 +- .../Scripts/AI/Decorators.meta | 20 +- .../AI/Decorators/BehaviorDecorator.cs | 32 +- .../AI/Decorators/BehaviorDecorator.cs.meta | 26 +- .../Scripts/AI/Decorators/Inverter.cs | 60 +- .../Scripts/AI/Decorators/Inverter.cs.meta | 26 +- .../Scripts/AI/Nodes.meta | 20 +- .../Scripts/AI/Nodes/BehaviorNode.cs | 22 +- .../Scripts/AI/Nodes/BehaviorNode.cs.meta | 26 +- .../Scripts/AI/Nodes/DebugOutNode.cs | 59 +- .../Scripts/AI/Nodes/DebugOutNode.cs.meta | 26 +- Assets/Scripts/AI/Nodes/MoveToNode.cs | 69 ++ Assets/Scripts/AI/Nodes/MoveToNode.cs.meta | 11 + .../Scripts/AI/Tree.meta | 20 +- .../Scripts/AI/Tree/TreeElement.cs | 118 +-- .../Scripts/AI/Tree/TreeElement.cs.meta | 24 +- .../Scripts/AI/Tree/TreeElementUtility.cs | 334 +++---- .../AI/Tree/TreeElementUtility.cs.meta | 24 +- .../Scripts/AI/Tree/TreeModel.cs | 588 ++++++------ .../Scripts/AI/Tree/TreeModel.cs.meta | 24 +- .../Scripts/BehaviorReactiveExtensions.cs | 74 +- .../BehaviorReactiveExtensions.cs.meta | 0 .../Scripts/TreeNodeAsset.cs | 78 +- .../Scripts/TreeNodeAsset.cs.meta | 0 Assets/TestScene.meta | 8 + Assets/TestScene.unity | 65 +- Assets/TestScene/NavMesh.asset | Bin 0 -> 7876 bytes Assets/TestScene/NavMesh.asset.meta | 8 + .../Editor/BehaviorDebuggerWindow.cs | 39 + .../Editor/BehaviorDebuggerWindow.cs.meta | 11 + .../Editor/NodeEditor/BehaviorEditorNode.cs | 395 ++++---- .../NodeEditor/BehaviorNodeEditorWindow.cs | 703 +++++++------- .../Editor/NodeEditor/Connection.cs | 73 +- .../Editor/NodeEditor/ConnectionPoint.cs | 104 +- .../Visual Behavior Tree/Editor/TreeSaver.cs | 191 ++-- .../Editor/UIENodeEditor.meta | 8 + .../Editor/UIENodeEditor/Connection.meta | 8 + .../UIENodeEditor/Connection/Connection.cs | 85 ++ .../Connection/Connection.cs.meta | 11 + .../UIENodeEditor/Connection/Connection.uss | 4 + .../Connection/Connection.uss.meta | 11 + .../Editor/UIENodeEditor/ConnectionPoint.meta | 8 + .../ConnectionPoint/ConnectionPoint.cs | 74 ++ .../ConnectionPoint/ConnectionPoint.cs.meta | 11 + .../ConnectionPoint/ConnectionPoint.uss | 5 + .../ConnectionPoint/ConnectionPoint.uss.meta | 11 + .../ConnectionPoint/ConnectionPoint.uxml | 9 + .../ConnectionPoint/ConnectionPoint.uxml.meta | 10 + .../Editor/UIENodeEditor/Editor Window.meta | 8 + .../Editor Window/BehaviorEditorWindow.cs | 271 ++++++ .../BehaviorEditorWindow.cs.meta | 11 + .../Editor Window/BehaviorEditorWindow.uss | 26 + .../BehaviorEditorWindow.uss.meta | 11 + .../Editor Window/BehaviorEditorWindow.uxml | 16 + .../BehaviorEditorWindow.uxml.meta | 10 + .../Editor/UIENodeEditor/Manipulators.meta | 8 + .../Manipulators/BehaviorEditorDragger.cs | 88 ++ .../BehaviorEditorDragger.cs.meta | 11 + .../Manipulators/EditorNodeSelector.cs | 49 + .../Manipulators/EditorNodeSelector.cs.meta | 11 + .../UIENodeEditor/Manipulators/NodeDragger.cs | 87 ++ .../Manipulators/NodeDragger.cs.meta | 11 + .../Editor/UIENodeEditor/Node.meta | 8 + .../Editor/UIENodeEditor/Node/EditorNode.cs | 160 ++++ .../UIENodeEditor/Node/EditorNode.cs.meta | 11 + .../Editor/UIENodeEditor/Node/EditorNode.uss | 63 ++ .../UIENodeEditor/Node/EditorNode.uss.meta | 11 + .../Editor/UIENodeEditor/Node/EditorNode.uxml | 20 + .../UIENodeEditor/Node/EditorNode.uxml.meta | 10 + .../Editor/UIENodeEditor/UIETreeLoader.cs | 85 ++ .../UIENodeEditor/UIETreeLoader.cs.meta | 11 + .../Editor/UIENodeEditor/Util.meta | 8 + .../UIENodeEditor/Util/UIETreeValidator.cs | 61 ++ .../Util/UIETreeValidator.cs.meta | 11 + .../Examples/New Behavior Tree2.asset | 20 +- .../Examples/New Behavior Tree3.asset | 42 +- .../Examples/New Behavior Tree4.asset | 87 ++ .../Examples/New Behavior Tree4.asset.meta | 8 + .../Examples/New TreeNodeAsset.asset | 16 + .../Examples/New TreeNodeAsset.asset.meta | 8 + Logs/Packages-Update.log | 183 ++-- Packages/manifest.json | 12 +- Packages/packages-lock.json | 374 ++++++++ ProjectSettings/ProjectVersion.txt | 4 +- UIElementsSchema/UIElements.xsd | 14 +- ...llaborate.Components.ChangeListEntries.xsd | 109 +++ .../Unity.Cloud.Collaborate.Components.xsd | 309 ++++++ .../Unity.Cloud.Collaborate.Views.xsd | 67 ++ .../UnityEditor.PackageManager.UI.xsd | 465 ++++++--- .../UnityEditor.UIElements.Debugger.xsd | 27 + UIElementsSchema/UnityEditor.UIElements.xsd | 887 ++++++++++++++++++ UIElementsSchema/UnityEngine.UIElements.xsd | 636 +++++++++++++ stuff | 31 - 118 files changed, 6929 insertions(+), 2689 deletions(-) rename Assets/{Visual Behavior Tree => }/Scripts.meta (100%) rename Assets/{Visual Behavior Tree => }/Scripts/AI.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Behavior Logger.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Behavior Logger/BehaviorDebugExtensions.cs (96%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Behavior Logger/BehaviorDebugExtensions.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Behavior Logger/BehaviorLogEntry.cs (97%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Behavior Logger/BehaviorLogEntry.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Behavior Logger/BehaviorLogger.cs (97%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Behavior Logger/BehaviorLogger.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Behavior Logger/ObservableBehaviorLogger.cs (96%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Behavior Logger/ObservableBehaviorLogger.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/BehaviorManager.cs (81%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/BehaviorManager.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/BehaviorState.cs (96%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/BehaviorState.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/BehaviorTreeElement.cs (63%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/BehaviorTreeElement.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Components.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Components/BehaviorComponent.cs (88%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Components/BehaviorComponent.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Components/Merge.cs (92%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Components/Merge.cs.meta (100%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Components/Selector.cs (97%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Components/Selector.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Components/Sequencer.cs (97%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Components/Sequencer.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Decorators.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Decorators/BehaviorDecorator.cs (83%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Decorators/BehaviorDecorator.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Decorators/Inverter.cs (91%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Decorators/Inverter.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Nodes.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Nodes/BehaviorNode.cs (76%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Nodes/BehaviorNode.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Nodes/DebugOutNode.cs (86%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Nodes/DebugOutNode.cs.meta (95%) create mode 100644 Assets/Scripts/AI/Nodes/MoveToNode.cs create mode 100644 Assets/Scripts/AI/Nodes/MoveToNode.cs.meta rename Assets/{Visual Behavior Tree => }/Scripts/AI/Tree.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Tree/TreeElement.cs (94%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Tree/TreeElement.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Tree/TreeElementUtility.cs (96%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Tree/TreeElementUtility.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Tree/TreeModel.cs (96%) rename Assets/{Visual Behavior Tree => }/Scripts/AI/Tree/TreeModel.cs.meta (95%) rename Assets/{Visual Behavior Tree => }/Scripts/BehaviorReactiveExtensions.cs (97%) rename Assets/{Visual Behavior Tree => }/Scripts/BehaviorReactiveExtensions.cs.meta (100%) rename Assets/{Visual Behavior Tree => }/Scripts/TreeNodeAsset.cs (97%) rename Assets/{Visual Behavior Tree => }/Scripts/TreeNodeAsset.cs.meta (100%) create mode 100644 Assets/TestScene.meta create mode 100644 Assets/TestScene/NavMesh.asset create mode 100644 Assets/TestScene/NavMesh.asset.meta create mode 100644 Assets/Visual Behavior Tree/Editor/BehaviorDebuggerWindow.cs create mode 100644 Assets/Visual Behavior Tree/Editor/BehaviorDebuggerWindow.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.uss create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.uss.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.cs create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uss create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uss.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uxml create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uxml.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uxml create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uxml.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/BehaviorEditorDragger.cs create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/BehaviorEditorDragger.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeSelector.cs create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeSelector.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/NodeDragger.cs create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/NodeDragger.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uss create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uss.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uxml create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uxml.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/UIETreeLoader.cs create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/UIETreeLoader.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Util.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Util/UIETreeValidator.cs create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Util/UIETreeValidator.cs.meta create mode 100644 Assets/Visual Behavior Tree/Examples/New Behavior Tree4.asset create mode 100644 Assets/Visual Behavior Tree/Examples/New Behavior Tree4.asset.meta create mode 100644 Assets/Visual Behavior Tree/Examples/New TreeNodeAsset.asset create mode 100644 Assets/Visual Behavior Tree/Examples/New TreeNodeAsset.asset.meta create mode 100644 Packages/packages-lock.json create mode 100644 UIElementsSchema/Unity.Cloud.Collaborate.Components.ChangeListEntries.xsd create mode 100644 UIElementsSchema/Unity.Cloud.Collaborate.Components.xsd create mode 100644 UIElementsSchema/Unity.Cloud.Collaborate.Views.xsd create mode 100644 UIElementsSchema/UnityEditor.UIElements.Debugger.xsd create mode 100644 UIElementsSchema/UnityEditor.UIElements.xsd create mode 100644 UIElementsSchema/UnityEngine.UIElements.xsd delete mode 100644 stuff diff --git a/Assets/Visual Behavior Tree/Scripts.meta b/Assets/Scripts.meta similarity index 100% rename from Assets/Visual Behavior Tree/Scripts.meta rename to Assets/Scripts.meta diff --git a/Assets/Visual Behavior Tree/Scripts/AI.meta b/Assets/Scripts/AI.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI.meta rename to Assets/Scripts/AI.meta index 501e3d3..48a5a06 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI.meta +++ b/Assets/Scripts/AI.meta @@ -1,10 +1,10 @@ -fileFormatVersion: 2 -guid: 581b7f319f546074e858a826dbf8c5ca -folderAsset: yes -timeCreated: 1519367469 -licenseType: Free -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 581b7f319f546074e858a826dbf8c5ca +folderAsset: yes +timeCreated: 1519367469 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger.meta b/Assets/Scripts/AI/Behavior Logger.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger.meta rename to Assets/Scripts/AI/Behavior Logger.meta index 84271ab..d4fc7b3 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger.meta +++ b/Assets/Scripts/AI/Behavior Logger.meta @@ -1,10 +1,10 @@ -fileFormatVersion: 2 -guid: fd95b8ef1325b85439d13b53209cfcd0 -folderAsset: yes -timeCreated: 1522736380 -licenseType: Free -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: fd95b8ef1325b85439d13b53209cfcd0 +folderAsset: yes +timeCreated: 1522736380 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorDebugExtensions.cs b/Assets/Scripts/AI/Behavior Logger/BehaviorDebugExtensions.cs similarity index 96% rename from Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorDebugExtensions.cs rename to Assets/Scripts/AI/Behavior Logger/BehaviorDebugExtensions.cs index ae63e39..e51c5e3 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorDebugExtensions.cs +++ b/Assets/Scripts/AI/Behavior Logger/BehaviorDebugExtensions.cs @@ -1,22 +1,22 @@ -using System; -using UniRx; - -namespace Assets.Scripts.AI.Behavior_Logger -{ - public static class BehaviorDebugExtensions - { - public static IObservable Debug(this IObservable source, BehaviorLogger logger) - { -#if DEBUG - return source.Materialize() - .Do(x => logger.Debug(x.ToString())) - .Dematerialize() - .DoOnCancel(() => logger.Debug("OnCancel")) - .DoOnSubscribe(() => logger.Debug("OnSubscribe")); -#else - return source; -#endif - } - - } -} +using System; +using UniRx; + +namespace Assets.Scripts.AI.Behavior_Logger +{ + public static class BehaviorDebugExtensions + { + public static IObservable Debug(this IObservable source, BehaviorLogger logger) + { +#if DEBUG + return source.Materialize() + .Do(x => logger.Debug(x.ToString())) + .Dematerialize() + .DoOnCancel(() => logger.Debug("OnCancel")) + .DoOnSubscribe(() => logger.Debug("OnSubscribe")); +#else + return source; +#endif + } + + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorDebugExtensions.cs.meta b/Assets/Scripts/AI/Behavior Logger/BehaviorDebugExtensions.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorDebugExtensions.cs.meta rename to Assets/Scripts/AI/Behavior Logger/BehaviorDebugExtensions.cs.meta index 2565df1..d58fe05 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorDebugExtensions.cs.meta +++ b/Assets/Scripts/AI/Behavior Logger/BehaviorDebugExtensions.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: 4b66684c79dce4a4aac13d3657a78ab7 -timeCreated: 1522812431 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 4b66684c79dce4a4aac13d3657a78ab7 +timeCreated: 1522812431 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorLogEntry.cs b/Assets/Scripts/AI/Behavior Logger/BehaviorLogEntry.cs similarity index 97% rename from Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorLogEntry.cs rename to Assets/Scripts/AI/Behavior Logger/BehaviorLogEntry.cs index b0b9cd5..8fdb43c 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorLogEntry.cs +++ b/Assets/Scripts/AI/Behavior Logger/BehaviorLogEntry.cs @@ -1,66 +1,66 @@ -using System; -using UnityEngine; - -namespace Assets.Scripts.AI.Behavior_Logger -{ - [Serializable] - public class BehaviorLogEntry - { - // requires - public string LoggerName { get; private set; } - public LogType LogType { get; private set; } - public string Message { get; private set; } - public DateTime Timestamp { get; private set; } - - // options - /// - /// [Optional] Used to keep track of frames for debugging. - /// - public long TickNumber { get; private set; } - - public BehaviorState NewState { get; private set; } - - public int BehaviorID { get; private set; } - - /// [Optional] - public UnityEngine.Object Context { get; private set; } - /// [Optional] - public Exception Exception { get; private set; } - /// [Optional] - public string StackTrace { get; private set; } - /// [Optional] - public BehaviorTreeElement State { get; private set; } - - public BehaviorLogEntry(string loggerName, LogType logType, DateTime timestamp, string message, int behaviorID = -2, - BehaviorState newState = BehaviorState.Null, long ticknum = -1, - UnityEngine.Object context = null, Exception exception = null, - string stackTrace = null, BehaviorTreeElement state = null) - { - this.LoggerName = loggerName; - this.LogType = logType; - this.Timestamp = timestamp; - this.Message = message; - this.BehaviorID = behaviorID; - this.NewState = newState; - this.TickNumber = ticknum; - this.Context = context; - this.Exception = exception; - this.StackTrace = stackTrace; - this.State = state; - } - - public override string ToString() - { - var plusEx = (Exception != null) ? (Environment.NewLine + Exception.ToString()) : ""; - return - "[" + LoggerName + "]" + Environment.NewLine - + "[ID:" + BehaviorID + "]" + Environment.NewLine - + "[" + Timestamp.ToString() + "]" + Environment.NewLine - + "[" + TickNumber + "]" + Environment.NewLine - //+ "[" + LogType.ToString() + "]" - + "[" + NewState + "]" + Environment.NewLine - + Message - + plusEx + Environment.NewLine; - } - } -} +using System; +using UnityEngine; + +namespace Assets.Scripts.AI.Behavior_Logger +{ + [Serializable] + public class BehaviorLogEntry + { + // requires + public string LoggerName { get; private set; } + public LogType LogType { get; private set; } + public string Message { get; private set; } + public DateTime Timestamp { get; private set; } + + // options + /// + /// [Optional] Used to keep track of frames for debugging. + /// + public long TickNumber { get; private set; } + + public BehaviorState NewState { get; private set; } + + public int BehaviorID { get; private set; } + + /// [Optional] + public UnityEngine.Object Context { get; private set; } + /// [Optional] + public Exception Exception { get; private set; } + /// [Optional] + public string StackTrace { get; private set; } + /// [Optional] + public BehaviorTreeElement State { get; private set; } + + public BehaviorLogEntry(string loggerName, LogType logType, DateTime timestamp, string message, int behaviorID = -2, + BehaviorState newState = BehaviorState.Null, long ticknum = -1, + UnityEngine.Object context = null, Exception exception = null, + string stackTrace = null, BehaviorTreeElement state = null) + { + this.LoggerName = loggerName; + this.LogType = logType; + this.Timestamp = timestamp; + this.Message = message; + this.BehaviorID = behaviorID; + this.NewState = newState; + this.TickNumber = ticknum; + this.Context = context; + this.Exception = exception; + this.StackTrace = stackTrace; + this.State = state; + } + + public override string ToString() + { + var plusEx = (Exception != null) ? (Environment.NewLine + Exception.ToString()) : ""; + return + "[" + LoggerName + "]" + Environment.NewLine + + "[ID:" + BehaviorID + "]" + Environment.NewLine + + "[" + Timestamp.ToString() + "]" + Environment.NewLine + + "[" + TickNumber + "]" + Environment.NewLine + //+ "[" + LogType.ToString() + "]" + + "[" + NewState + "]" + Environment.NewLine + + Message + + plusEx + Environment.NewLine; + } + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorLogEntry.cs.meta b/Assets/Scripts/AI/Behavior Logger/BehaviorLogEntry.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorLogEntry.cs.meta rename to Assets/Scripts/AI/Behavior Logger/BehaviorLogEntry.cs.meta index c6eed10..6457d1a 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorLogEntry.cs.meta +++ b/Assets/Scripts/AI/Behavior Logger/BehaviorLogEntry.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: 5f695ffe72055774a8ccbfb9e33c1280 -timeCreated: 1522736382 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 5f695ffe72055774a8ccbfb9e33c1280 +timeCreated: 1522736382 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorLogger.cs b/Assets/Scripts/AI/Behavior Logger/BehaviorLogger.cs similarity index 97% rename from Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorLogger.cs rename to Assets/Scripts/AI/Behavior Logger/BehaviorLogger.cs index 33eb6e3..b036ee4 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorLogger.cs +++ b/Assets/Scripts/AI/Behavior Logger/BehaviorLogger.cs @@ -1,137 +1,137 @@ -using System; -using UnityEngine; - -namespace Assets.Scripts.AI.Behavior_Logger -{ - public partial class BehaviorLogger - { - static bool isInitialized = false; - static bool isDebugBuild = false; - - public string Name { get; private set; } - protected readonly Action logPublisher; - - public BehaviorLogger(string loggerName) - { - this.Name = loggerName; - this.logPublisher = ObservableBehaviorLogger.RegisterLogger(this); - } - - /// Output LogType.Log but only enabled if isDebugBuild - public virtual void Debug(object message, UnityEngine.Object context = null) - { - if (!isInitialized) - { - isInitialized = true; - isDebugBuild = UnityEngine.Debug.isDebugBuild; - } - - if (isDebugBuild) - { - logPublisher(new BehaviorLogEntry( - message: (message != null) ? message.ToString() : "", - logType: LogType.Log, - timestamp: DateTime.Now, - loggerName: Name, - context: context)); - } - } - - /// Output LogType.Log but only enables isDebugBuild - public virtual void DebugFormat(string format, params object[] args) - { - if (!isInitialized) - { - isInitialized = true; - isDebugBuild = UnityEngine.Debug.isDebugBuild; - } - - if (isDebugBuild) - { - logPublisher(new BehaviorLogEntry( - message: (format != null) ? string.Format(format, args) : "", - logType: LogType.Log, - timestamp: DateTime.Now, - loggerName: Name, - context: null)); - } - } - - public virtual void Log(object message, UnityEngine.Object context = null) - { - logPublisher(new BehaviorLogEntry( - message: (message != null) ? message.ToString() : "", - logType: LogType.Log, - timestamp: DateTime.Now, - loggerName: Name, - context: context)); - } - - public virtual void LogFormat(string format, params object[] args) - { - logPublisher(new BehaviorLogEntry( - message: (format != null) ? string.Format(format, args) : "", - logType: LogType.Log, - timestamp: DateTime.Now, - loggerName: Name, - context: null)); - } - - public virtual void Warning(object message, UnityEngine.Object context = null) - { - logPublisher(new BehaviorLogEntry( - message: (message != null) ? message.ToString() : "", - logType: LogType.Warning, - timestamp: DateTime.Now, - loggerName: Name, - context: context)); - } - - public virtual void WarningFormat(string format, params object[] args) - { - logPublisher(new BehaviorLogEntry( - message: (format != null) ? string.Format(format, args) : "", - logType: LogType.Warning, - timestamp: DateTime.Now, - loggerName: Name, - context: null)); - } - - public virtual void Error(object message, UnityEngine.Object context = null) - { - logPublisher(new BehaviorLogEntry( - message: (message != null) ? message.ToString() : "", - logType: LogType.Error, - timestamp: DateTime.Now, - loggerName: Name, - context: context)); - } - - public virtual void ErrorFormat(string format, params object[] args) - { - logPublisher(new BehaviorLogEntry( - message: (format != null) ? string.Format(format, args) : "", - logType: LogType.Error, - timestamp: DateTime.Now, - loggerName: Name, - context: null)); - } - - public virtual void Exception(Exception exception, UnityEngine.Object context = null) - { - logPublisher(new BehaviorLogEntry( - message: (exception != null) ? exception.ToString() : "", - exception: exception, - logType: LogType.Exception, - timestamp: DateTime.Now, - loggerName: Name, - context: context)); - } - - /// Publish raw LogEntry. - public virtual void Raw(BehaviorLogEntry logEntry) - { - logPublisher(logEntry); - } - } +using System; +using UnityEngine; + +namespace Assets.Scripts.AI.Behavior_Logger +{ + public partial class BehaviorLogger + { + static bool isInitialized = false; + static bool isDebugBuild = false; + + public string Name { get; private set; } + protected readonly Action logPublisher; + + public BehaviorLogger(string loggerName) + { + this.Name = loggerName; + this.logPublisher = ObservableBehaviorLogger.RegisterLogger(this); + } + + /// Output LogType.Log but only enabled if isDebugBuild + public virtual void Debug(object message, UnityEngine.Object context = null) + { + if (!isInitialized) + { + isInitialized = true; + isDebugBuild = UnityEngine.Debug.isDebugBuild; + } + + if (isDebugBuild) + { + logPublisher(new BehaviorLogEntry( + message: (message != null) ? message.ToString() : "", + logType: LogType.Log, + timestamp: DateTime.Now, + loggerName: Name, + context: context)); + } + } + + /// Output LogType.Log but only enables isDebugBuild + public virtual void DebugFormat(string format, params object[] args) + { + if (!isInitialized) + { + isInitialized = true; + isDebugBuild = UnityEngine.Debug.isDebugBuild; + } + + if (isDebugBuild) + { + logPublisher(new BehaviorLogEntry( + message: (format != null) ? string.Format(format, args) : "", + logType: LogType.Log, + timestamp: DateTime.Now, + loggerName: Name, + context: null)); + } + } + + public virtual void Log(object message, UnityEngine.Object context = null) + { + logPublisher(new BehaviorLogEntry( + message: (message != null) ? message.ToString() : "", + logType: LogType.Log, + timestamp: DateTime.Now, + loggerName: Name, + context: context)); + } + + public virtual void LogFormat(string format, params object[] args) + { + logPublisher(new BehaviorLogEntry( + message: (format != null) ? string.Format(format, args) : "", + logType: LogType.Log, + timestamp: DateTime.Now, + loggerName: Name, + context: null)); + } + + public virtual void Warning(object message, UnityEngine.Object context = null) + { + logPublisher(new BehaviorLogEntry( + message: (message != null) ? message.ToString() : "", + logType: LogType.Warning, + timestamp: DateTime.Now, + loggerName: Name, + context: context)); + } + + public virtual void WarningFormat(string format, params object[] args) + { + logPublisher(new BehaviorLogEntry( + message: (format != null) ? string.Format(format, args) : "", + logType: LogType.Warning, + timestamp: DateTime.Now, + loggerName: Name, + context: null)); + } + + public virtual void Error(object message, UnityEngine.Object context = null) + { + logPublisher(new BehaviorLogEntry( + message: (message != null) ? message.ToString() : "", + logType: LogType.Error, + timestamp: DateTime.Now, + loggerName: Name, + context: context)); + } + + public virtual void ErrorFormat(string format, params object[] args) + { + logPublisher(new BehaviorLogEntry( + message: (format != null) ? string.Format(format, args) : "", + logType: LogType.Error, + timestamp: DateTime.Now, + loggerName: Name, + context: null)); + } + + public virtual void Exception(Exception exception, UnityEngine.Object context = null) + { + logPublisher(new BehaviorLogEntry( + message: (exception != null) ? exception.ToString() : "", + exception: exception, + logType: LogType.Exception, + timestamp: DateTime.Now, + loggerName: Name, + context: context)); + } + + /// Publish raw LogEntry. + public virtual void Raw(BehaviorLogEntry logEntry) + { + logPublisher(logEntry); + } + } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorLogger.cs.meta b/Assets/Scripts/AI/Behavior Logger/BehaviorLogger.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorLogger.cs.meta rename to Assets/Scripts/AI/Behavior Logger/BehaviorLogger.cs.meta index 84d53e6..5465b42 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/BehaviorLogger.cs.meta +++ b/Assets/Scripts/AI/Behavior Logger/BehaviorLogger.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: 06592c43911849341b408d8d16e715b7 -timeCreated: 1522736380 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 06592c43911849341b408d8d16e715b7 +timeCreated: 1522736380 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/ObservableBehaviorLogger.cs b/Assets/Scripts/AI/Behavior Logger/ObservableBehaviorLogger.cs similarity index 96% rename from Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/ObservableBehaviorLogger.cs rename to Assets/Scripts/AI/Behavior Logger/ObservableBehaviorLogger.cs index 1586ddf..3f1141b 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/ObservableBehaviorLogger.cs +++ b/Assets/Scripts/AI/Behavior Logger/ObservableBehaviorLogger.cs @@ -1,27 +1,27 @@ -using System; -using UniRx; - -namespace Assets.Scripts.AI.Behavior_Logger -{ - public class ObservableBehaviorLogger : IObservable - { - static readonly Subject logPublisher = new Subject(); - - public static readonly ObservableBehaviorLogger Listener = new ObservableBehaviorLogger(); - - private ObservableBehaviorLogger() - { } - - public static Action RegisterLogger(BehaviorLogger logger) - { - if (logger.Name == null) throw new ArgumentNullException("logger.Name is null"); - - return logPublisher.OnNext; - } - - public IDisposable Subscribe(IObserver observer) - { - return logPublisher.Subscribe(observer); - } - } +using System; +using UniRx; + +namespace Assets.Scripts.AI.Behavior_Logger +{ + public class ObservableBehaviorLogger : IObservable + { + static readonly Subject logPublisher = new Subject(); + + public static readonly ObservableBehaviorLogger Listener = new ObservableBehaviorLogger(); + + private ObservableBehaviorLogger() + { } + + public static Action RegisterLogger(BehaviorLogger logger) + { + if (logger.Name == null) throw new ArgumentNullException("logger.Name is null"); + + return logPublisher.OnNext; + } + + public IDisposable Subscribe(IObserver observer) + { + return logPublisher.Subscribe(observer); + } + } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/ObservableBehaviorLogger.cs.meta b/Assets/Scripts/AI/Behavior Logger/ObservableBehaviorLogger.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/ObservableBehaviorLogger.cs.meta rename to Assets/Scripts/AI/Behavior Logger/ObservableBehaviorLogger.cs.meta index 2e5abb9..3befca1 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Behavior Logger/ObservableBehaviorLogger.cs.meta +++ b/Assets/Scripts/AI/Behavior Logger/ObservableBehaviorLogger.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: bb7b4389cc29fff418225c1ce967a103 -timeCreated: 1522736382 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: bb7b4389cc29fff418225c1ce967a103 +timeCreated: 1522736382 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs b/Assets/Scripts/AI/BehaviorManager.cs similarity index 81% rename from Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs rename to Assets/Scripts/AI/BehaviorManager.cs index 348b8f6..55c6cd2 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs +++ b/Assets/Scripts/AI/BehaviorManager.cs @@ -1,138 +1,125 @@ -using Assets.Scripts.AI.Components; -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using Newtonsoft.Json; -using System.ComponentModel; -using UniRx; -using Assets.Scripts.AI.Tree; -using System.Linq; -using Assets.Scripts.AI.Behavior_Logger; -using UniRx.Diagnostics; -using Assets.Visual_Behavior_Tree.Scripts; - -namespace Assets.Scripts.AI -{ - public class BehaviorManager : MonoBehaviour, IDisposable - { - private BehaviorLogger behaviorLogger; - public BehaviorLogger BehaviorLogger - { - get - { - if(behaviorLogger == null) - { - behaviorLogger = new BehaviorLogger(gameObject.name + ": " + BehaviorTreeFiles.Count + " Trees"); - } - return behaviorLogger; - } - - private set - { - behaviorLogger = value; - } - } - - /// - /// The file to actually save/load to/from. - /// - [JsonIgnore] - [Description("The currently loaded tree assets that will be run concurrently.")] - public List BehaviorTreeFiles; - - public BehaviorTreeElement Runner { get; set; } - - /// - /// Seconds between every tick. At "0" this will tick every frame (basically an update loop) - /// - [SerializeField] - - [Description("Seconds between every tick. At 0 this will tick every frame")] - public double MilliSecondsBetweenTicks = 100; - - /// - /// Number of times to tick the full tree. Set to a negative number to make an infinitely running behavior tree. - /// - [SerializeField] - [Description("Times to tick this tree before stopping. Negative values indicate infinitely running behavior.")] - public int TimesToTick = 10; - - private bool initialized = false; - - public void InitIfNeeded() - { - if (initialized == false) - { - Reinitialize(); - } - } - - public Subject TreeSubject { get; private set; } - List treeList = new List(); - public void Reinitialize() - { - //TODO: Change to runner extension - - if(BehaviorTreeFiles.Count > 1) - { - Runner = ScriptableObject.CreateInstance(); - Runner.Depth = -1; - Runner.ID = -1; - foreach (var asset in BehaviorTreeFiles) - { - var childRoot = asset.LoadRoot(); - Debug.Log("child root: " + childRoot); - ((Merge)Runner).AddChild(childRoot); - } - } - else Runner = BehaviorTreeFiles.First().LoadRoot(); - - TreeSubject = new Subject(); - TreeSubject.Subscribe(xr => - { - var logEntry = new BehaviorLogEntry( - loggerName: BehaviorLogger.Name, - logType: LogType.Log, - timestamp: DateTime.Now, - message: "Ticked!", - behaviorID: xr.ID, - newState: xr.CurrentState, - context: this, - state: xr); - BehaviorLogger.Raw(logEntry); - Debug.Log(logEntry); - }).AddTo(this); - - initialized = true; - } - - /// - /// Ticks on the aggregate ParallelRunner then continues ticking for as long as the runner is in running state - /// - /// - //TODO: CHANGE TO Zip() instead of loop - void Start() - { - InitIfNeeded(); - - var timeStep = Observable.Interval(TimeSpan.FromMilliseconds(MilliSecondsBetweenTicks)) - .TakeWhile((_) => TimesToTick != 0) - .Do(cx => - { - if (TimesToTick > 0) --TimesToTick; - Runner.Start().Subscribe(); - - //TreeSubject.OnNext(Runner); - }) - //.Debug("") - .Subscribe() - .AddTo(this); - } - - public void Dispose() - { - Runner.Dispose(); - } - } -} +using Assets.Scripts.AI.Components; +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Newtonsoft.Json; +using System.ComponentModel; +using UniRx; +using Assets.Scripts.AI.Tree; +using System.Linq; +using Assets.Scripts.AI.Behavior_Logger; +using UniRx.Diagnostics; +using Assets.Visual_Behavior_Tree.Scripts; + +namespace Assets.Scripts.AI +{ + public class BehaviorManager : MonoBehaviour, IDisposable + { + private BehaviorLogger behaviorLogger; + public BehaviorLogger BehaviorLogger + { + get + { + if(behaviorLogger == null) + { + behaviorLogger = new BehaviorLogger(gameObject.name + ": " + BehaviorTreeFiles.Count + " Trees"); + } + return behaviorLogger; + } + + private set + { + behaviorLogger = value; + } + } + + public List> Debuggers; + + /// + /// The file to actually save/load to/from. + /// + [JsonIgnore] + [Description("The currently loaded tree assets that will be run concurrently.")] + public List BehaviorTreeFiles; + + public BehaviorTreeElement Runner { get; set; } + + /// + /// Seconds between every tick. At "0" this will tick every frame (basically an update loop) + /// + [SerializeField] + [Description("Milliseconds between every tick. At 0 this will tick every frame")] + public double MilliSecondsBetweenTicks = 100; + + /// + /// Number of times to tick the full tree. Set to a negative number to make an infinitely running behavior tree. + /// + [SerializeField] + [Description("Times to tick this tree before stopping. Negative values indicate infinitely running behavior.")] + public int TimesToTick = 10; + + private bool initialized = false; + + public void InitIfNeeded() + { + if (initialized == false) + { + Reinitialize(); + } + } + + public Subject TreeSubject { get; private set; } + List treeList = new List(); + public void Reinitialize() + { + //TODO: Change to runner extension + + if (BehaviorTreeFiles.Count > 1) + { + Runner = ScriptableObject.CreateInstance(); + Runner.Depth = -1; + Runner.ID = -1; + foreach (var asset in BehaviorTreeFiles) + { + var childRoot = asset.LoadRoot(); + Debug.Log("child root: " + childRoot); + ((Merge)Runner).AddChild(childRoot); + } + } + else Runner = BehaviorTreeFiles.First().LoadRoot(); + + var logStream = ObservableBehaviorLogger.Listener.Subscribe(log => Debug.Log("Manager: " + log)); + + Runner.Manager = this; + Runner.Initialize(); + + initialized = true; + } + + /// + /// Ticks on the aggregate ParallelRunner then continues ticking for as long as the runner is in running state + /// + /// + //TODO: CHANGE TO Zip() instead of loop + void Start() + { + InitIfNeeded(); + + var timeStep = Observable.Interval(TimeSpan.FromMilliseconds(MilliSecondsBetweenTicks)) + .TakeWhile((_) => TimesToTick != 0) + .Do(cx => + { + if (TimesToTick > 0) --TimesToTick; + Runner.Start().Subscribe(); + }) + .Subscribe() + .AddTo(this); + } + + public void Dispose() + { + Runner.Dispose(); + } + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs.meta b/Assets/Scripts/AI/BehaviorManager.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs.meta rename to Assets/Scripts/AI/BehaviorManager.cs.meta index c2891a2..b7fffa3 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorManager.cs.meta +++ b/Assets/Scripts/AI/BehaviorManager.cs.meta @@ -1,12 +1,12 @@ -fileFormatVersion: 2 -guid: 73bc91841bad4424992751c051af5030 -timeCreated: 1510630398 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 73bc91841bad4424992751c051af5030 +timeCreated: 1510630398 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorState.cs b/Assets/Scripts/AI/BehaviorState.cs similarity index 96% rename from Assets/Visual Behavior Tree/Scripts/AI/BehaviorState.cs rename to Assets/Scripts/AI/BehaviorState.cs index c2723ea..0dc5649 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorState.cs +++ b/Assets/Scripts/AI/BehaviorState.cs @@ -1,15 +1,15 @@ -namespace Assets.Scripts.AI -{ - //TODO: Error state? Needed? Useful? - /// - /// Null usually means this behavior has not started or is in an error state. - /// Fail, Success, and Running are for checking the current state from the parent object. - /// - public enum BehaviorState - { - Null = 0, - Fail, - Success, - Running - } +namespace Assets.Scripts.AI +{ + //TODO: Error state? Needed? Useful? + /// + /// Null usually means this behavior has not started or is in an error state. + /// Fail, Success, and Running are for checking the current state from the parent object. + /// + public enum BehaviorState + { + Null = 0, + Fail, + Success, + Running + } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorState.cs.meta b/Assets/Scripts/AI/BehaviorState.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/BehaviorState.cs.meta rename to Assets/Scripts/AI/BehaviorState.cs.meta index 6f3598f..6aef72c 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorState.cs.meta +++ b/Assets/Scripts/AI/BehaviorState.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: a0f8f6209976b6e44b7475b5706d2509 -timeCreated: 1510007420 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: a0f8f6209976b6e44b7475b5706d2509 +timeCreated: 1510007420 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs b/Assets/Scripts/AI/BehaviorTreeElement.cs similarity index 63% rename from Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs rename to Assets/Scripts/AI/BehaviorTreeElement.cs index d467136..3c4d918 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs +++ b/Assets/Scripts/AI/BehaviorTreeElement.cs @@ -1,113 +1,145 @@ -using Assets.Scripts.AI.Tree; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using UniRx; -using UnityEngine; - -namespace Assets.Scripts.AI -{ - [Serializable] - public abstract class BehaviorTreeElement : TreeElement, IDisposable - { - //used for reflection upon JSON loading - public string ElementType { get; set; } - - public BehaviorTreeElement(string name,int depth, int id) - : base(name, depth, id) - { - ElementType = this.GetType().ToString(); - CurrentState = (BehaviorState.Null); - Children = new List(); - } - - [Newtonsoft.Json.JsonIgnore] - private BehaviorState _currentState; - [Newtonsoft.Json.JsonIgnore] - public BehaviorState CurrentState { get => _currentState; set => _currentState = value; } - - - private bool Initialized = false; - - /// - /// The primary method of action - /// - /// observable stream of states from this behavior - public abstract IObservable Start(); - - public virtual void Initialize() - { - if (Initialized) return; - var allChildrenToRun = from x in Children - select x as BehaviorTreeElement; - - foreach(var ch in allChildrenToRun) - { - ch.ObserveEveryValueChanged(x => x.CurrentState) - .Subscribe() - .AddTo(Disposables); - } - - Initialized = true; - } - - public override string ToString() - { - var depthPad = ""; - for (int d = 0; d < this.Depth +1; ++d) - { - depthPad += " "; - } - var retString = depthPad + "ID: " + ID + "\n" + - depthPad + "Name: " + this.Name + "\n" + - depthPad + "Depth: " + Depth + "\n" + - depthPad + "Type: " + ElementType.ToString() + "\n" + - depthPad + "NumChildren: " + (HasChildren ? Children.Count : 0) + "\n"; - - if (Children != null) - { - retString += depthPad + "Children: \n"; - foreach (var child in Children) - { - retString += child.ToString(); - } - } - return retString; - - } - - #region IDisposable Support - - // CompositeDisposable is similar with List, manage multiple IDisposable - [NonSerialized] - protected CompositeDisposable Disposables = new CompositeDisposable(); // field - private bool disposedValue = false; // To detect redundant calls - - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) - { - if (disposing) - { - Disposables.Clear(); - } - - // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. - // TODO: set large fields to null. - Children.Clear(); - Children = null; - - disposedValue = true; - } - } - - // This code added to correctly implement the disposable pattern. - public void Dispose() - { - // Do not change this code. Put cleanup code in Dispose(bool disposing) above. - Dispose(true); - } - #endregion - } +using Assets.Scripts.AI.Behavior_Logger; +using Assets.Scripts.AI.Tree; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UniRx; +using UnityEngine; + +namespace Assets.Scripts.AI +{ + [Serializable] + public abstract class BehaviorTreeElement : TreeElement, IDisposable + { + //used for JSON saving/loading + public string ElementType { get; set; } + + [Newtonsoft.Json.JsonIgnore] + public virtual bool CanHaveChildren { get => true; } + + [Newtonsoft.Json.JsonIgnore] + public MonoBehaviour Manager { get; set; } + + [Newtonsoft.Json.JsonIgnore] + public BehaviorLogger DebugLogger { get; protected set; } + + [Newtonsoft.Json.JsonIgnore] + private BehaviorState _currentState; + [Newtonsoft.Json.JsonIgnore] + public BehaviorState CurrentState { get => _currentState; set => _currentState = value; } + + [Newtonsoft.Json.JsonIgnore] + protected bool Initialized = false; + + public BehaviorTreeElement(string name,int depth, int id) + : base(name, depth, id) + { + ElementType = this.GetType().ToString(); + CurrentState = BehaviorState.Null; + if(CanHaveChildren) + Children = new List(); + } + + protected Action DebugLogAction; + + /// + /// The primary method of action + /// + /// observable stream of states from this behavior + public abstract IObservable Start(); + + public virtual void Initialize() + { + Debug.Log("Initializing " + this.ElementType); + + DebugLogger = new BehaviorLogger(Manager.name + " | " + Name); + + if (Initialized) return; + if(CanHaveChildren) + { + var allChildrenToRun = from x in Children + select x as BehaviorTreeElement; + + foreach (var ch in allChildrenToRun) + { + ch.Manager = this.Manager; + ch.Initialize(); + } + } + + DebugLogAction = (debugState) => + { + var logEntry = new BehaviorLogEntry( + loggerName: DebugLogger.Name, + logType: LogType.Log, + timestamp: DateTime.Now, + message: "Ticked!", + behaviorID: this.ID, + newState: debugState, + context: this); + DebugLogger.Raw(logEntry); + }; + + Initialized = true; + } + + public override string ToString() + { + var depthPad = ""; + for (int d = 0; d < this.Depth +1; ++d) + { + depthPad += " "; + } + var retString = depthPad + "ID: " + ID + "\n" + + depthPad + "Name: " + this.Name + "\n" + + depthPad + "Depth: " + Depth + "\n" + + depthPad + "Type: " + ElementType.ToString() + "\n" + + depthPad + "NumChildren: " + (HasChildren ? Children.Count : 0) + "\n"; + + if (Children != null) + { + retString += depthPad + "Children: \n"; + foreach (var child in Children) + { + retString += child.ToString(); + } + } + return retString; + + } + + #region IDisposable Support + + // CompositeDisposable is similar with List, manage multiple IDisposable + [NonSerialized] + protected CompositeDisposable Disposables = new CompositeDisposable(); // field + private bool disposedValue = false; // To detect redundant calls + + protected virtual void Dispose(bool disposing) + { + if (!disposedValue) + { + if (disposing) + { + Disposables.Clear(); + } + + // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. + // TODO: set large fields to null. + Children.Clear(); + Children = null; + + disposedValue = true; + } + } + + // This code added to correctly implement the disposable pattern. + public void Dispose() + { + // Do not change this code. Put cleanup code in Dispose(bool disposing) above. + Dispose(true); + } + #endregion + } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs.meta b/Assets/Scripts/AI/BehaviorTreeElement.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs.meta rename to Assets/Scripts/AI/BehaviorTreeElement.cs.meta index a0c602b..ecdf494 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/BehaviorTreeElement.cs.meta +++ b/Assets/Scripts/AI/BehaviorTreeElement.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: decd6968705c12e4e85cdfe07281ce9a -timeCreated: 1510006706 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: decd6968705c12e4e85cdfe07281ce9a +timeCreated: 1510006706 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components.meta b/Assets/Scripts/AI/Components.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Components.meta rename to Assets/Scripts/AI/Components.meta index 3fc47f1..71d36a8 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components.meta +++ b/Assets/Scripts/AI/Components.meta @@ -1,10 +1,10 @@ -fileFormatVersion: 2 -guid: cfbfc64efdfd2eb4e9a91b969190497a -folderAsset: yes -timeCreated: 1510203379 -licenseType: Free -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: cfbfc64efdfd2eb4e9a91b969190497a +folderAsset: yes +timeCreated: 1510203379 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/BehaviorComponent.cs b/Assets/Scripts/AI/Components/BehaviorComponent.cs similarity index 88% rename from Assets/Visual Behavior Tree/Scripts/AI/Components/BehaviorComponent.cs rename to Assets/Scripts/AI/Components/BehaviorComponent.cs index 7626fe5..109633a 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/BehaviorComponent.cs +++ b/Assets/Scripts/AI/Components/BehaviorComponent.cs @@ -1,29 +1,31 @@ -using System.Collections; -using System.Collections.Generic; -using UniRx; -using UnityEngine; - -namespace Assets.Scripts.AI.Components -{ - [System.Serializable] - public abstract class BehaviorComponent : BehaviorTreeElement - { - public BehaviorComponent(string name, int depth, int id) - : base(name, depth, id) - { - Children = new List(); - } - - public virtual void AddChild(BehaviorTreeElement element) - { - element.Parent = this; - Children.Add(element); - } - - public override System.IObservable Start() - { - return Observable.Empty(); - } - - } -} +using System.Collections; +using System.Collections.Generic; +using UniRx; +using UnityEngine; + +namespace Assets.Scripts.AI.Components +{ + [System.Serializable] + public abstract class BehaviorComponent : BehaviorTreeElement + { + public override bool CanHaveChildren { get => true; } + + public BehaviorComponent(string name, int depth, int id) + : base(name, depth, id) + { + Children = new List(); + } + + public virtual void AddChild(BehaviorTreeElement element) + { + element.Parent = this; + Children.Add(element); + } + + public override System.IObservable Start() + { + return Observable.Empty(); + } + + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/BehaviorComponent.cs.meta b/Assets/Scripts/AI/Components/BehaviorComponent.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Components/BehaviorComponent.cs.meta rename to Assets/Scripts/AI/Components/BehaviorComponent.cs.meta index 91fdbab..9668eae 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/BehaviorComponent.cs.meta +++ b/Assets/Scripts/AI/Components/BehaviorComponent.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: be0a6d932da64f24c98048a4061faf8b -timeCreated: 1510001735 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: be0a6d932da64f24c98048a4061faf8b +timeCreated: 1510001735 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs b/Assets/Scripts/AI/Components/Merge.cs similarity index 92% rename from Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs rename to Assets/Scripts/AI/Components/Merge.cs index 1fff71b..cdeae3e 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs +++ b/Assets/Scripts/AI/Components/Merge.cs @@ -1,54 +1,56 @@ -using System; -using System.Collections; -using System.ComponentModel; -using System.Linq; -using UniRx; -using UnityEngine; -using Assets.Visual_Behavior_Tree.Scripts; - -namespace Assets.Scripts.AI.Components -{ - [Serializable] - [Description("Runs all children at same time. Fails early if NumFailures are >0 and total children failed reach that number. Succeeds otherwise.")] - public class Merge : BehaviorComponent - { - [Range(0, 100)] - [SerializeField] - public float SucceedPercent = 51; - - public Merge(string name, int depth, int id) - : base(name, depth, id) { } - - public override IObservable Start() - { - if (Children == null || Children.Count == 0) - { - Debug.LogWarning("Children Null in merge component"); - return Observable.Return(BehaviorState.Fail); - } - - var source = Children.ToObservable() - .SelectMany(child => - ((BehaviorTreeElement)child).Start() - .Where(st => st != BehaviorState.Running)); - - - //takes all children streams and publishes running until last stream finishes. - //once last stream finishes, emits "success" or "fail" based on set success ratio. - return source.Publish(src => - src.Aggregate(new { total = 0, succeeded = 0 }, (acc, childResult) => - { - return childResult == BehaviorState.Success ? - new { total = acc.total + 1, succeeded = acc.succeeded + 1 } : - new { total = acc.total + 1, acc.succeeded }; - }) - .Select(a => 100 * ((float)a.succeeded / a.total)) - .Select(ratio => ratio >= SucceedPercent ? - BehaviorState.Success : BehaviorState.Fail) - .Publish(srcLast => - src.Select(s => BehaviorState.Running) - .TakeUntil(srcLast).Merge(srcLast))); - } - - } -} +using System; +using System.Collections; +using System.ComponentModel; +using System.Linq; +using UniRx; +using UnityEngine; +using Assets.Visual_Behavior_Tree.Scripts; +using Assets.Scripts.AI.Behavior_Logger; + +namespace Assets.Scripts.AI.Components +{ + [Serializable] + [Description("Runs all children at same time. Fails early if NumFailures are >0 and total children failed reach that number. Succeeds otherwise.")] + public class Merge : BehaviorComponent + { + [Range(0, 100)] + [SerializeField] + public float SucceedPercent = 51; + + public Merge(string name, int depth, int id) + : base(name, depth, id) { } + + public override IObservable Start() + { + if (Children == null || Children.Count == 0) + { + Debug.LogWarning("Children Null in merge component"); + return Observable.Return(BehaviorState.Fail); + } + + var source = Children.ToObservable() + .SelectMany(child => + ((BehaviorTreeElement)child).Start() + .Where(st => st != BehaviorState.Running)); + + + //takes all children streams and publishes running until last stream finishes. + //once last stream finishes, emits "success" or "fail" based on set success ratio. + return source.Publish(src => + src.Aggregate(new { total = 0, succeeded = 0 }, (acc, childResult) => + { + return childResult == BehaviorState.Success ? + new { total = acc.total + 1, succeeded = acc.succeeded + 1 } : + new { total = acc.total + 1, acc.succeeded }; + }) + .Select(a => 100 * ((float)a.succeeded / a.total)) + .Select(ratio => ratio >= SucceedPercent ? + BehaviorState.Success : BehaviorState.Fail) + + .Publish(srcLast => + src.Select(s => BehaviorState.Running) + .TakeUntil(srcLast).Merge(srcLast))) + .Do(state => DebugLogAction(state)); + } + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs.meta b/Assets/Scripts/AI/Components/Merge.cs.meta similarity index 100% rename from Assets/Visual Behavior Tree/Scripts/AI/Components/Merge.cs.meta rename to Assets/Scripts/AI/Components/Merge.cs.meta diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs b/Assets/Scripts/AI/Components/Selector.cs similarity index 97% rename from Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs rename to Assets/Scripts/AI/Components/Selector.cs index 5746ba4..9a1284c 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs +++ b/Assets/Scripts/AI/Components/Selector.cs @@ -1,45 +1,45 @@ -using Assets.Visual_Behavior_Tree.Scripts; -using System; -using System.Collections; -using System.ComponentModel; -using System.Linq; -using UniRx; -using UnityEngine; - -namespace Assets.Scripts.AI.Components -{ - /// - /// runs all sub behaviors until a behavior returns success. - /// Returns success if a child was successful, otherwise returns fail - /// - [Serializable] - [Description("Runs children in order. Succeeds on first child that succeeds. Fails if no children succeed.")] - public class Selector : BehaviorComponent - { - public Selector(string name, int depth, int id) - : base(name, depth, id) - { } - - public override IObservable Start() - { - if (Children == null || Children.Count == 0) - { - Debug.LogWarning("Children Null in " + this.Name); - return Observable.Return(BehaviorState.Fail); - } - var sourceConcat = Children.ToObservable() - .Select(child => - ((BehaviorTreeElement)child).Start() - .Where(st => st != BehaviorState.Running)) - .Concat(); //Sequentially run children and select the final value (should be fail/succeed/error) - - return sourceConcat.Publish(src => - src.Any(e => e == BehaviorState.Success) //true if any succeed, false if none succeed - .Select(e => e ? BehaviorState.Success : BehaviorState.Fail) //Success if any succeed, fail if all fail - .Publish(srcLast => - src.Where(e => e == BehaviorState.Fail) - .Select(e => BehaviorState.Running) - .TakeUntil(srcLast).Merge(srcLast))); - } - } +using Assets.Visual_Behavior_Tree.Scripts; +using System; +using System.Collections; +using System.ComponentModel; +using System.Linq; +using UniRx; +using UnityEngine; + +namespace Assets.Scripts.AI.Components +{ + /// + /// runs all sub behaviors until a behavior returns success. + /// Returns success if a child was successful, otherwise returns fail + /// + [Serializable] + [Description("Runs children in order. Succeeds on first child that succeeds. Fails if no children succeed.")] + public class Selector : BehaviorComponent + { + public Selector(string name, int depth, int id) + : base(name, depth, id) + { } + + public override IObservable Start() + { + if (Children == null || Children.Count == 0) + { + Debug.LogWarning("Children Null in " + this.Name); + return Observable.Return(BehaviorState.Fail); + } + var sourceConcat = Children.ToObservable() + .Select(child => + ((BehaviorTreeElement)child).Start() + .Where(st => st != BehaviorState.Running)) + .Concat(); //Sequentially run children and select the final value (should be fail/succeed/error) + + return sourceConcat.Publish(src => + src.Any(e => e == BehaviorState.Success) //true if any succeed, false if none succeed + .Select(e => e ? BehaviorState.Success : BehaviorState.Fail) //Success if any succeed, fail if all fail + .Publish(srcLast => + src.Where(e => e == BehaviorState.Fail) + .Select(e => BehaviorState.Running) + .TakeUntil(srcLast).Merge(srcLast))); + } + } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs.meta b/Assets/Scripts/AI/Components/Selector.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs.meta rename to Assets/Scripts/AI/Components/Selector.cs.meta index 94d5d3f..71ded6c 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Selector.cs.meta +++ b/Assets/Scripts/AI/Components/Selector.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: 0722c5f25b262a34c993139ca5a5d29c -timeCreated: 1510204858 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 0722c5f25b262a34c993139ca5a5d29c +timeCreated: 1510204858 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs b/Assets/Scripts/AI/Components/Sequencer.cs similarity index 97% rename from Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs rename to Assets/Scripts/AI/Components/Sequencer.cs index a534dbf..3db61ea 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs +++ b/Assets/Scripts/AI/Components/Sequencer.cs @@ -1,44 +1,44 @@ - using Assets.Visual_Behavior_Tree.Scripts; -using System; -using System.Collections; -using System.ComponentModel; -using UniRx; -using UnityEngine; - -namespace Assets.Scripts.AI.Components -{ - /// - /// Runs until a child returns in a fail state - /// - [System.Serializable] - [Description("runs children in sequence until a child fails. Succeeds if no children fail. Fails if any child fails.")] - public class Sequencer : BehaviorComponent - { - public Sequencer(string name, int depth, int id) - : base(name, depth, id) - {} - - public override IObservable Start() - { - if (Children == null || Children.Count == 0) - { - Debug.LogWarning("Children Null in " + this.Name); - return Observable.Return(BehaviorState.Fail); - } - - var sourceConcat = Children.ToObservable() - .Select(child => - ((BehaviorTreeElement)child).Start() - .Where(st => st != BehaviorState.Running)) - .Concat(); //Sequentially run children and select the final value (should be fail/succeed/error) - - return sourceConcat.Publish(src => - src.Any(e => e == BehaviorState.Fail) //true if any fail, false if none fail - .Select(e => e ? BehaviorState.Fail : BehaviorState.Success) //fail if any fail, succeed if all succeed - .Publish(srcLast => - src.Where(e => e == BehaviorState.Success) //success should keep running - .Select(e => BehaviorState.Running) //so return running to show this - .TakeUntil(srcLast).Merge(srcLast))); - } - } + using Assets.Visual_Behavior_Tree.Scripts; +using System; +using System.Collections; +using System.ComponentModel; +using UniRx; +using UnityEngine; + +namespace Assets.Scripts.AI.Components +{ + /// + /// Runs until a child returns in a fail state + /// + [System.Serializable] + [Description("runs children in sequence until a child fails. Succeeds if no children fail. Fails if any child fails.")] + public class Sequencer : BehaviorComponent + { + public Sequencer(string name, int depth, int id) + : base(name, depth, id) + {} + + public override IObservable Start() + { + if (Children == null || Children.Count == 0) + { + Debug.LogWarning("Children Null in " + this.Name); + return Observable.Return(BehaviorState.Fail); + } + + var sourceConcat = Children.ToObservable() + .Select(child => + ((BehaviorTreeElement)child).Start() + .Where(st => st != BehaviorState.Running)) + .Concat(); //Sequentially run children and select the final value (should be fail/succeed/error) + + return sourceConcat.Publish(src => + src.Any(e => e == BehaviorState.Fail) //true if any fail, false if none fail + .Select(e => e ? BehaviorState.Fail : BehaviorState.Success) //fail if any fail, succeed if all succeed + .Publish(srcLast => + src.Where(e => e == BehaviorState.Success) //success should keep running + .Select(e => BehaviorState.Running) //so return running to show this + .TakeUntil(srcLast).Merge(srcLast))); + } + } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs.meta b/Assets/Scripts/AI/Components/Sequencer.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs.meta rename to Assets/Scripts/AI/Components/Sequencer.cs.meta index 2406e5d..dd430ef 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Components/Sequencer.cs.meta +++ b/Assets/Scripts/AI/Components/Sequencer.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: 09119a885ebfa4c4cbb06415188c4c13 -timeCreated: 1510204010 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 09119a885ebfa4c4cbb06415188c4c13 +timeCreated: 1510204010 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Decorators.meta b/Assets/Scripts/AI/Decorators.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Decorators.meta rename to Assets/Scripts/AI/Decorators.meta index cc3b49d..8eaa31a 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Decorators.meta +++ b/Assets/Scripts/AI/Decorators.meta @@ -1,10 +1,10 @@ -fileFormatVersion: 2 -guid: 340608a4cbadc724a8d7d6fb6a26711a -folderAsset: yes -timeCreated: 1510203379 -licenseType: Free -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 340608a4cbadc724a8d7d6fb6a26711a +folderAsset: yes +timeCreated: 1510203379 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/BehaviorDecorator.cs b/Assets/Scripts/AI/Decorators/BehaviorDecorator.cs similarity index 83% rename from Assets/Visual Behavior Tree/Scripts/AI/Decorators/BehaviorDecorator.cs rename to Assets/Scripts/AI/Decorators/BehaviorDecorator.cs index c9169b6..690bf97 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/BehaviorDecorator.cs +++ b/Assets/Scripts/AI/Decorators/BehaviorDecorator.cs @@ -1,15 +1,17 @@ -using System; -using System.Collections; -using System.Collections.Generic; - -namespace Assets.Scripts.AI.Decorators -{ - public abstract class BehaviorDecorator : BehaviorTreeElement - { - public BehaviorDecorator(string name, int depth, int id) - : base(name, depth, id) - { - Children = new List(); - } - } -} +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Assets.Scripts.AI.Decorators +{ + public abstract class BehaviorDecorator : BehaviorTreeElement + { + public BehaviorDecorator(string name, int depth, int id) + : base(name, depth, id) + { + Children = new List(); + } + + public override bool CanHaveChildren => true; + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/BehaviorDecorator.cs.meta b/Assets/Scripts/AI/Decorators/BehaviorDecorator.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Decorators/BehaviorDecorator.cs.meta rename to Assets/Scripts/AI/Decorators/BehaviorDecorator.cs.meta index 8664596..a94bf43 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/BehaviorDecorator.cs.meta +++ b/Assets/Scripts/AI/Decorators/BehaviorDecorator.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: 4c1fcae49d4a83548bf07dafe517cc6c -timeCreated: 1510203379 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 4c1fcae49d4a83548bf07dafe517cc6c +timeCreated: 1510203379 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs b/Assets/Scripts/AI/Decorators/Inverter.cs similarity index 91% rename from Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs rename to Assets/Scripts/AI/Decorators/Inverter.cs index 41abcc7..0133404 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs +++ b/Assets/Scripts/AI/Decorators/Inverter.cs @@ -1,30 +1,32 @@ -using System; -using System.Collections; -using UniRx; -using UnityEngine; - -namespace Assets.Scripts.AI.Decorators -{ - [System.Serializable] - public class Inverter : BehaviorDecorator - { - public Inverter(string name, int depth, int id) - : base(name, depth, id) - { } - - public override IObservable Start() - { - if (Children == null || Children.Count == 0) - { - Debug.LogWarning("Children Null in " + this.Name); - return Observable.Return(BehaviorState.Fail); - } - - var sourceConcat = - Children.ToObservable().Select(child => ((BehaviorTreeElement)child).Start().Where(state => state != BehaviorState.Running)) - .Concat(); - - return sourceConcat.Select(state => state == BehaviorState.Fail ? BehaviorState.Success : BehaviorState.Fail); - } - } +using System; +using System.Collections; +using UniRx; +using UnityEngine; + +namespace Assets.Scripts.AI.Decorators +{ + [System.Serializable] + public class Inverter : BehaviorDecorator + { + public Inverter(string name, int depth, int id) + : base(name, depth, id) + { } + + public override bool CanHaveChildren { get => true; } + + public override IObservable Start() + { + if (Children == null || Children.Count == 0) + { + Debug.LogWarning("Children Null in " + this.Name); + return Observable.Return(BehaviorState.Fail); + } + + var sourceConcat = + Children.ToObservable().Select(child => ((BehaviorTreeElement)child).Start().Where(state => state != BehaviorState.Running)) + .Concat(); + + return sourceConcat.Select(state => state == BehaviorState.Fail ? BehaviorState.Success : BehaviorState.Fail); + } + } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs.meta b/Assets/Scripts/AI/Decorators/Inverter.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs.meta rename to Assets/Scripts/AI/Decorators/Inverter.cs.meta index 5708c80..01094f1 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Decorators/Inverter.cs.meta +++ b/Assets/Scripts/AI/Decorators/Inverter.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: 7f9e397ff49da7840978a9776a23e6bd -timeCreated: 1510335218 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 7f9e397ff49da7840978a9776a23e6bd +timeCreated: 1510335218 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes.meta b/Assets/Scripts/AI/Nodes.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Nodes.meta rename to Assets/Scripts/AI/Nodes.meta index 5a2092f..6dda69d 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes.meta +++ b/Assets/Scripts/AI/Nodes.meta @@ -1,10 +1,10 @@ -fileFormatVersion: 2 -guid: 649445d98a7c4054eb1a2fd1e9b84423 -folderAsset: yes -timeCreated: 1510203379 -licenseType: Free -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 649445d98a7c4054eb1a2fd1e9b84423 +folderAsset: yes +timeCreated: 1510203379 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/BehaviorNode.cs b/Assets/Scripts/AI/Nodes/BehaviorNode.cs similarity index 76% rename from Assets/Visual Behavior Tree/Scripts/AI/Nodes/BehaviorNode.cs rename to Assets/Scripts/AI/Nodes/BehaviorNode.cs index 4684ee4..b33b075 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/BehaviorNode.cs +++ b/Assets/Scripts/AI/Nodes/BehaviorNode.cs @@ -1,11 +1,13 @@ -using System.Collections; -using UnityEngine; - -namespace Assets.Scripts.AI.Nodes -{ - public abstract class BehaviorNode : BehaviorTreeElement - { - public BehaviorNode(string name, int depth, int id) : base(name, depth, id) - {} - } +using System.Collections; +using UnityEngine; + +namespace Assets.Scripts.AI.Nodes +{ + public abstract class BehaviorNode : BehaviorTreeElement + { + public BehaviorNode(string name, int depth, int id) : base(name, depth, id) + {} + + public override bool CanHaveChildren { get => false; } + } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/BehaviorNode.cs.meta b/Assets/Scripts/AI/Nodes/BehaviorNode.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Nodes/BehaviorNode.cs.meta rename to Assets/Scripts/AI/Nodes/BehaviorNode.cs.meta index c5da3bd..83a027b 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/BehaviorNode.cs.meta +++ b/Assets/Scripts/AI/Nodes/BehaviorNode.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: bac4dc3c25eb67e4a8d433e466c15feb -timeCreated: 1510203462 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: bac4dc3c25eb67e4a8d433e466c15feb +timeCreated: 1510203462 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs b/Assets/Scripts/AI/Nodes/DebugOutNode.cs similarity index 86% rename from Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs rename to Assets/Scripts/AI/Nodes/DebugOutNode.cs index 050e238..c180fdb 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs +++ b/Assets/Scripts/AI/Nodes/DebugOutNode.cs @@ -1,30 +1,29 @@ -using System; -using System.Collections; -using UniRx; -using UnityEngine; - -namespace Assets.Scripts.AI.Nodes -{ - [Serializable] - public class DebugOutNode : BehaviorNode - { - public string debugOutText; - - public DebugOutNode(string name, int depth, int id) - : base(name, depth, id) - { } - - - public override IObservable Start() - { - //base.Initialize(); - - CurrentState = BehaviorState.Null; //Forces an update on the state between succeeds. - //DO STUFF HERE - Debug.Log(debugOutText); - //DO MORE STUFF?! - - return Observable.Return(BehaviorState.Success); - } - } -} +using System; +using System.Collections; +using UniRx; +using UnityEngine; + +namespace Assets.Scripts.AI.Nodes +{ + [Serializable] + public class DebugOutNode : BehaviorNode + { + public string logMessage; + + public DebugOutNode(string name, int depth, int id) + : base(name, depth, id) + { } + + public override IObservable Start() + { + //base.Initialize(); + + CurrentState = BehaviorState.Null; //Forces an update on the state between succeeds. + //DO STUFF HERE + Debug.Log(logMessage); + //DO MORE STUFF?! + + return Observable.Return(BehaviorState.Success); + } + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs.meta b/Assets/Scripts/AI/Nodes/DebugOutNode.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs.meta rename to Assets/Scripts/AI/Nodes/DebugOutNode.cs.meta index 5e8c086..a6b062e 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Nodes/DebugOutNode.cs.meta +++ b/Assets/Scripts/AI/Nodes/DebugOutNode.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: 67a24dd4e390091488917da92d44c3b8 -timeCreated: 1518461313 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 67a24dd4e390091488917da92d44c3b8 +timeCreated: 1518461313 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/AI/Nodes/MoveToNode.cs b/Assets/Scripts/AI/Nodes/MoveToNode.cs new file mode 100644 index 0000000..599e728 --- /dev/null +++ b/Assets/Scripts/AI/Nodes/MoveToNode.cs @@ -0,0 +1,69 @@ +using Assets.Scripts.AI; +using Assets.Scripts.AI.Nodes; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UniRx; +using UnityEngine; +using UnityEngine.AI; + +namespace Assets.Visual_Behavior_Tree.Scripts.AI.Nodes +{ + public class MoveToNode : BehaviorNode + { + public int TimeBetweenChecks; + + [Newtonsoft.Json.JsonIgnore] + private Transform moveToPoint; + + [Newtonsoft.Json.JsonIgnore] + private NavMeshAgent agent; + + private Vector3 lastDestination; + + public float destReachedThreshold; + + public MoveToNode(string name, int depth, int id) : base(name, depth, id) + {} + + public override void Initialize() + { + base.Initialize(); + agent = this.Manager.GetComponent(); + moveToPoint = GameObject.FindGameObjectWithTag("Player").transform; + } + + public override IObservable Start() + { + agent.SetDestination(moveToPoint.position); + return Observable + .Interval(TimeSpan.FromMilliseconds(TimeBetweenChecks)) + .TakeWhile(_ => !IsDestinationReached()) + .Select(x => + { + Debug.Log("Selected"); + if (agent == null) + { + Debug.LogWarning("Unable to find agent in " + Name); + return Observable.Return(BehaviorState.Fail); + } + if (moveToPoint.position != lastDestination) + { + agent.SetDestination(moveToPoint.position); + lastDestination = moveToPoint.position; + } + return Observable.Return(BehaviorState.Running); + }) + .TakeLast(1) + .Select(x => BehaviorState.Success) + .Do(state => DebugLogAction(state)); + } + + bool IsDestinationReached() + { + return agent.remainingDistance <= destReachedThreshold; + } + } +} diff --git a/Assets/Scripts/AI/Nodes/MoveToNode.cs.meta b/Assets/Scripts/AI/Nodes/MoveToNode.cs.meta new file mode 100644 index 0000000..ce6c485 --- /dev/null +++ b/Assets/Scripts/AI/Nodes/MoveToNode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3039216464fbca94c862a91613378198 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Tree.meta b/Assets/Scripts/AI/Tree.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Tree.meta rename to Assets/Scripts/AI/Tree.meta index 4d10a58..4dcc80a 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Tree.meta +++ b/Assets/Scripts/AI/Tree.meta @@ -1,10 +1,10 @@ -fileFormatVersion: 2 -guid: f7b347696765a604987c3d6043bc5fd4 -folderAsset: yes -timeCreated: 1511756114 -licenseType: Free -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: f7b347696765a604987c3d6043bc5fd4 +folderAsset: yes +timeCreated: 1511756114 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElement.cs b/Assets/Scripts/AI/Tree/TreeElement.cs similarity index 94% rename from Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElement.cs rename to Assets/Scripts/AI/Tree/TreeElement.cs index 8cc2642..5a0e088 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElement.cs +++ b/Assets/Scripts/AI/Tree/TreeElement.cs @@ -1,59 +1,59 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace Assets.Scripts.AI.Tree -{ - [Serializable] - public class TreeElement : ScriptableObject - { - [SerializeField] int _ID; - [SerializeField] string _Name; - [SerializeField] int _Depth; - [NonSerialized] TreeElement _Parent; - [NonSerialized] List _Children; - - [JsonIgnore] - public TreeElement Parent - { - get { return _Parent; } - set { _Parent = value; } - } - - [JsonIgnore] - public List Children - { - get { return _Children; } - set { _Children = value; } - } - - public bool HasChildren - { - get { return Children != null && Children.Count > 0; } - } - - public string Name - { - get { return _Name; } set { _Name = value; } - } - - public int ID - { - get { return _ID; } set { _ID = value; } - } - - public int Depth { get => _Depth; set => _Depth = value; } - - public TreeElement () - { - } - - public TreeElement (string name, int depth, int id) - { - _Name = name; - _ID = id; - _Depth = depth; - } - } -} +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Assets.Scripts.AI.Tree +{ + [Serializable] + public class TreeElement : ScriptableObject + { + [SerializeField] int _ID; + [SerializeField] string _Name; + [SerializeField] int _Depth; + [NonSerialized] TreeElement _Parent; + [NonSerialized] List _Children; + + [JsonIgnore] + public TreeElement Parent + { + get { return _Parent; } + set { _Parent = value; } + } + + [JsonIgnore] + public List Children + { + get { return _Children; } + set { _Children = value; } + } + + public bool HasChildren + { + get { return Children != null && Children.Count > 0; } + } + + public string Name + { + get { return _Name; } set { _Name = value; } + } + + public int ID + { + get { return _ID; } set { _ID = value; } + } + + public int Depth { get => _Depth; set => _Depth = value; } + + public TreeElement () + { + } + + public TreeElement (string name, int depth, int id) + { + _Name = name; + _ID = id; + _Depth = depth; + } + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElement.cs.meta b/Assets/Scripts/AI/Tree/TreeElement.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElement.cs.meta rename to Assets/Scripts/AI/Tree/TreeElement.cs.meta index 05b01d6..fef8d17 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElement.cs.meta +++ b/Assets/Scripts/AI/Tree/TreeElement.cs.meta @@ -1,12 +1,12 @@ -fileFormatVersion: 2 -guid: 69be32fe4d27dde489209c5885c1e5dc -timeCreated: 1472024155 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 69be32fe4d27dde489209c5885c1e5dc +timeCreated: 1472024155 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElementUtility.cs b/Assets/Scripts/AI/Tree/TreeElementUtility.cs similarity index 96% rename from Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElementUtility.cs rename to Assets/Scripts/AI/Tree/TreeElementUtility.cs index 91901bc..9e24c11 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElementUtility.cs +++ b/Assets/Scripts/AI/Tree/TreeElementUtility.cs @@ -1,167 +1,167 @@ -using System; -using System.Collections.Generic; - -namespace Assets.Scripts.AI.Tree -{ - // TreeElementUtility and TreeElement are useful helper classes for backend tree data structures. - // See tests at the bottom for examples of how to use. - - public static class TreeElementUtility - { - public static void TreeToList(T root, IList result) where T : TreeElement - { - if (result == null) - throw new NullReferenceException("The input 'IList result' list is null"); - result.Clear(); - - Stack stack = new Stack(); - stack.Push(root); - - while (stack.Count > 0) - { - T current = stack.Pop(); - result.Add(current); - - if (current.Children != null) - { - for (int i = current.Children.Count - 1; i >= 0; i--) - { - stack.Push((T)current.Children[i]); - } - } - } - } - - // Returns the root of the tree parsed from the list (always the first element). - // Important: the first item is required to have a depth value of -1. - // The rest of the items should have depth >= 0. - public static T ListToTree(IList list) where T : TreeElement - { - // Validate input - ValidateDepthValues (list); - - // Clear old states - foreach (var element in list) - { - element.Parent = null; - element.Children = null; - } - - // Set child and parent references using depth info - for (int parentIndex = 0; parentIndex < list.Count; parentIndex++) - { - var parent = list[parentIndex]; - bool alreadyHasValidChildren = parent.Children != null; - if (alreadyHasValidChildren) - continue; - - int parentDepth = parent.Depth; - int childCount = 0; - - // Count children based depth value, we are looking at children until it's the same depth as this object - for (int i = parentIndex + 1; i < list.Count; i++) - { - if (list[i].Depth == parentDepth + 1) - childCount++; - if (list[i].Depth <= parentDepth) - break; - } - - // Fill child array - List childList = null; - if (childCount != 0) - { - childList = new List(childCount); // Allocate once - childCount = 0; - for (int i = parentIndex + 1; i < list.Count; i++) - { - if (list[i].Depth == parentDepth + 1) - { - list[i].Parent = parent; - childList.Add(list[i]); - childCount++; - } - - if (list[i].Depth <= parentDepth) - break; - } - } - parent.Children = childList; - } - return list[0]; - } - - // Check state of input list - public static void ValidateDepthValues(IList list) where T : TreeElement - { - if (list.Count == 0) - throw new ArgumentException("list should have items, count is 0, check before calling ValidateDepthValues", "list"); - - if (list[0].Depth != -1) - throw new ArgumentException("list item at index 0 should have a depth of -1 (since this should be the hidden root of the tree). Depth is: " + list[0].Depth, "list"); - - for (int i = 0; i < list.Count - 1; i++) - { - int depth = list[i].Depth; - int nextDepth = list[i + 1].Depth; - if (nextDepth > depth && nextDepth - depth > 1) - throw new ArgumentException(string.Format("Invalid depth info in input list. Depth cannot increase more than 1 per row. Index {0} has depth {1} while index {2} has depth {3}", i, depth, i + 1, nextDepth)); - } - - for (int i = 1; i < list.Count; ++i) - if (list[i].Depth < 0) - throw new ArgumentException("Invalid depth value for item at index " + i + ". Only the first item (the root) should have depth below 0."); - - if (list.Count > 1 && list[1].Depth != 0) - throw new ArgumentException("Input list item at index 1 is assumed to have a depth of 0", "list"); - } - - - // For updating depth values below any given element e.g after reparenting elements - public static void UpdateDepthValues(T root) where T : TreeElement - { - if (root == null) - throw new ArgumentNullException("root", "The root is null"); - - if (!root.HasChildren) - return; - - Stack stack = new Stack(); - stack.Push(root); - while (stack.Count > 0) - { - TreeElement current = stack.Pop(); - if (current.Children != null) - { - foreach (var child in current.Children) - { - child.Depth = current.Depth + 1; - stack.Push(child); - } - } - } - } - - // Returns true if there is an ancestor of child in the elements list - static bool IsChildOf(T child, IList elements) where T : TreeElement - { - while (child != null) - { - child = (T)child.Parent; - if (elements.Contains(child)) - return true; - } - return false; - } - - public static IList FindCommonAncestorsWithinList(IList elements) where T : TreeElement - { - if (elements.Count == 1) - return new List(elements); - - List result = new List(elements); - result.RemoveAll(g => IsChildOf(g, elements)); - return result; - } - } -} +using System; +using System.Collections.Generic; + +namespace Assets.Scripts.AI.Tree +{ + // TreeElementUtility and TreeElement are useful helper classes for backend tree data structures. + // See tests at the bottom for examples of how to use. + + public static class TreeElementUtility + { + public static void TreeToList(T root, IList result) where T : TreeElement + { + if (result == null) + throw new NullReferenceException("The input 'IList result' list is null"); + result.Clear(); + + Stack stack = new Stack(); + stack.Push(root); + + while (stack.Count > 0) + { + T current = stack.Pop(); + result.Add(current); + + if (current.Children != null) + { + for (int i = current.Children.Count - 1; i >= 0; i--) + { + stack.Push((T)current.Children[i]); + } + } + } + } + + // Returns the root of the tree parsed from the list (always the first element). + // Important: the first item is required to have a depth value of -1. + // The rest of the items should have depth >= 0. + public static T ListToTree(IList list) where T : TreeElement + { + // Validate input + ValidateDepthValues (list); + + // Clear old states + foreach (var element in list) + { + element.Parent = null; + element.Children = null; + } + + // Set child and parent references using depth info + for (int parentIndex = 0; parentIndex < list.Count; parentIndex++) + { + var parent = list[parentIndex]; + bool alreadyHasValidChildren = parent.Children != null; + if (alreadyHasValidChildren) + continue; + + int parentDepth = parent.Depth; + int childCount = 0; + + // Count children based depth value, we are looking at children until it's the same depth as this object + for (int i = parentIndex + 1; i < list.Count; i++) + { + if (list[i].Depth == parentDepth + 1) + childCount++; + if (list[i].Depth <= parentDepth) + break; + } + + // Fill child array + List childList = null; + if (childCount != 0) + { + childList = new List(childCount); // Allocate once + childCount = 0; + for (int i = parentIndex + 1; i < list.Count; i++) + { + if (list[i].Depth == parentDepth + 1) + { + list[i].Parent = parent; + childList.Add(list[i]); + childCount++; + } + + if (list[i].Depth <= parentDepth) + break; + } + } + parent.Children = childList; + } + return list[0]; + } + + // Check state of input list + public static void ValidateDepthValues(IList list) where T : TreeElement + { + if (list.Count == 0) + throw new ArgumentException("list should have items, count is 0, check before calling ValidateDepthValues", "list"); + + if (list[0].Depth != -1) + throw new ArgumentException("list item at index 0 should have a depth of -1 (since this should be the hidden root of the tree). Depth is: " + list[0].Depth, "list"); + + for (int i = 0; i < list.Count - 1; i++) + { + int depth = list[i].Depth; + int nextDepth = list[i + 1].Depth; + if (nextDepth > depth && nextDepth - depth > 1) + throw new ArgumentException(string.Format("Invalid depth info in input list. Depth cannot increase more than 1 per row. Index {0} has depth {1} while index {2} has depth {3}", i, depth, i + 1, nextDepth)); + } + + for (int i = 1; i < list.Count; ++i) + if (list[i].Depth < 0) + throw new ArgumentException("Invalid depth value for item at index " + i + ". Only the first item (the root) should have depth below 0."); + + if (list.Count > 1 && list[1].Depth != 0) + throw new ArgumentException("Input list item at index 1 is assumed to have a depth of 0", "list"); + } + + + // For updating depth values below any given element e.g after reparenting elements + public static void UpdateDepthValues(T root) where T : TreeElement + { + if (root == null) + throw new ArgumentNullException("root", "The root is null"); + + if (!root.HasChildren) + return; + + Stack stack = new Stack(); + stack.Push(root); + while (stack.Count > 0) + { + TreeElement current = stack.Pop(); + if (current.Children != null) + { + foreach (var child in current.Children) + { + child.Depth = current.Depth + 1; + stack.Push(child); + } + } + } + } + + // Returns true if there is an ancestor of child in the elements list + static bool IsChildOf(T child, IList elements) where T : TreeElement + { + while (child != null) + { + child = (T)child.Parent; + if (elements.Contains(child)) + return true; + } + return false; + } + + public static IList FindCommonAncestorsWithinList(IList elements) where T : TreeElement + { + if (elements.Count == 1) + return new List(elements); + + List result = new List(elements); + result.RemoveAll(g => IsChildOf(g, elements)); + return result; + } + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElementUtility.cs.meta b/Assets/Scripts/AI/Tree/TreeElementUtility.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElementUtility.cs.meta rename to Assets/Scripts/AI/Tree/TreeElementUtility.cs.meta index 12d8902..7ecc88f 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeElementUtility.cs.meta +++ b/Assets/Scripts/AI/Tree/TreeElementUtility.cs.meta @@ -1,12 +1,12 @@ -fileFormatVersion: 2 -guid: fd65e8f324e17a344a97ddcf5a8d89d2 -timeCreated: 1471616285 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: fd65e8f324e17a344a97ddcf5a8d89d2 +timeCreated: 1471616285 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeModel.cs b/Assets/Scripts/AI/Tree/TreeModel.cs similarity index 96% rename from Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeModel.cs rename to Assets/Scripts/AI/Tree/TreeModel.cs index 906685a..2ad32b5 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeModel.cs +++ b/Assets/Scripts/AI/Tree/TreeModel.cs @@ -1,294 +1,294 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Assets.Scripts.AI.Tree -{ - // The TreeModel is a utility class working on a list of serializable TreeElements where the order and the depth of each TreeElement define - // the tree structure. Note that the TreeModel itself is not serializable (in Unity we are currently limited to serializing lists/arrays) but the - // input list is. - // The tree representation (parent and children references) are then build internally using TreeElementUtility.ListToTree (using depth - // values of the elements). - // The first element of the input list is required to have depth == -1 (the hiddenroot) and the rest to have - // depth >= 0 (otherwise an exception will be thrown) - - public class TreeModel where T : TreeElement - { - IList m_Data; - T m_Root; - int m_MaxID; - - public T Root { get { return m_Root; } set { m_Root = value; } } - public event Action ModelChanged; - public int NumberOfDataElements - { - get { return m_Data.Count; } - } - - public TreeModel (IList data) - { - SetData (data); - } - - public T Find (int id) - { - return m_Data.FirstOrDefault (element => element.ID == id); - } - - public void SetData (IList data) - { - Init (data); - } - - void Init (IList data) - { - if (data == null) - throw new ArgumentNullException("data", "Input data is null. Ensure input is a non-null list."); - - m_Data = data; - if (m_Data.Count > 0) - { - m_Root = TreeElementUtility.ListToTree(data); - m_MaxID = m_Data.Max(e => e.ID); - } - else - { - m_MaxID = -1; - } - - } - - public int GenerateUniqueID () - { - return ++m_MaxID; - } - - public IList GetAncestors (int id) - { - var parents = new List(); - TreeElement T = Find(id); - if (T != null) - { - while (T.Parent != null) - { - parents.Add(T.Parent.ID); - T = T.Parent; - } - } - return parents; - } - - public IList GetDescendantsThatHaveChildren (int id) - { - T searchFromThis = Find(id); - if (searchFromThis != null) - { - return GetParentsBelowStackBased(searchFromThis); - } - return new List(); - } - - IList GetParentsBelowStackBased(TreeElement searchFromThis) - { - Stack stack = new Stack(); - stack.Push(searchFromThis); - - var parentsBelow = new List(); - while (stack.Count > 0) - { - TreeElement current = stack.Pop(); - if (current.HasChildren) - { - parentsBelow.Add(current.ID); - foreach (var T in current.Children) - { - stack.Push(T); - } - } - } - - return parentsBelow; - } - - public void RemoveElements (IList elementIDs) - { - IList elements = m_Data.Where (element => elementIDs.Contains (element.ID)).ToArray (); - RemoveElements (elements); - } - - public void RemoveElements (IList elements) - { - foreach (var element in elements) - if (element == m_Root) - throw new ArgumentException("It is not allowed to remove the root element"); - - var commonAncestors = TreeElementUtility.FindCommonAncestorsWithinList (elements); - - foreach (var element in commonAncestors) - { - element.Parent.Children.Remove (element); - element.Parent = null; - } - - TreeElementUtility.TreeToList(m_Root, m_Data); - - Changed(); - } - - public void AddElements (IList elements, TreeElement parent, int insertPosition) - { - if (elements == null) - throw new ArgumentNullException("elements", "elements is null"); - if (elements.Count == 0) - throw new ArgumentNullException("elements", "elements Count is 0: nothing to add"); - if (parent == null) - throw new ArgumentNullException("parent", "parent is null"); - - if (parent.Children == null) - parent.Children = new List(); - - parent.Children.InsertRange(insertPosition, elements.Cast ()); - foreach (var element in elements) - { - element.Parent = parent; - element.Depth = parent.Depth + 1; - TreeElementUtility.UpdateDepthValues(element); - } - - TreeElementUtility.TreeToList(m_Root, m_Data); - - Changed(); - } - - public void AddRoot (T root) - { - if (root == null) - throw new ArgumentNullException("root", "root is null"); - - if (m_Data == null) - throw new InvalidOperationException("Internal Error: data list is null"); - - if (m_Data.Count != 0) - throw new InvalidOperationException("AddRoot is only allowed on empty data list"); - - root.ID = GenerateUniqueID (); - root.Depth = -1; - m_Data.Add (root); - } - - public void AddElement (T element, TreeElement parent, int insertPosition) - { - if (element == null) - throw new ArgumentNullException("element", "element is null"); - if (parent == null) - throw new ArgumentNullException("parent", "parent is null"); - - if (parent.Children == null) - parent.Children = new List (); - - parent.Children.Insert (insertPosition, element); - element.Parent = parent; - - TreeElementUtility.UpdateDepthValues(parent); - TreeElementUtility.TreeToList(m_Root, m_Data); - - Changed (); - } - - public void MoveElements(TreeElement parentElement, int insertionIndex, List elements) - { - if (insertionIndex < 0) - throw new ArgumentException("Invalid input: insertionIndex is -1, client needs to decide what index elements should be reparented at"); - - // Invalid reparenting input - if (parentElement == null) - return; - - // We are moving items so we adjust the insertion index to accomodate that any items above the insertion index is removed before inserting - if (insertionIndex > 0) - insertionIndex -= parentElement.Children.GetRange(0, insertionIndex).Count(elements.Contains); - - // Remove draggedItems from their parents - foreach (var draggedItem in elements) - { - draggedItem.Parent.Children.Remove(draggedItem); // remove from old parent - draggedItem.Parent = parentElement; // set new parent - } - - if (parentElement.Children == null) - parentElement.Children = new List(); - - // Insert dragged items under new parent - parentElement.Children.InsertRange(insertionIndex, elements); - - TreeElementUtility.UpdateDepthValues (Root); - TreeElementUtility.TreeToList (m_Root, m_Data); - - Changed (); - } - - void Changed () - { - if(ModelChanged != null) - { - ModelChanged.Invoke(); - } - } - } - - - //#region Tests - //class TreeModelTests - //{ - // [Test] - // public static void TestTreeModelCanAddElements() - // { - // var root = new TreeElement {Name = "Root", Depth = -1}; - // var listOfElements = new List(); - // listOfElements.Add(root); - - // var model = new TreeModel(listOfElements); - // model.AddElement(new TreeElement { Name = "Element" }, root, 0); - // model.AddElement(new TreeElement { Name = "Element " + root.Children.Count }, root, 0); - // model.AddElement(new TreeElement { Name = "Element " + root.Children.Count }, root, 0); - // model.AddElement(new TreeElement { Name = "Sub Element" }, root.Children[1], 0); - - // // Assert order is correct - // string[] namesInCorrectOrder = { "Root", "Element 2", "Element 1", "Sub Element", "Element" }; - // Assert.AreEqual(namesInCorrectOrder.Length, listOfElements.Count, "Result count does not match"); - // for (int i = 0; i < namesInCorrectOrder.Length; ++i) - // Assert.AreEqual(namesInCorrectOrder[i], listOfElements[i].Name); - - // // Assert depths are valid - // TreeElementUtility.ValidateDepthValues(listOfElements); - // } - - // [Test] - // public static void TestTreeModelCanRemoveElements() - // { - // var root = new TreeElement { Name = "Root", Depth = -1 }; - // var listOfElements = new List(); - // listOfElements.Add(root); - - // var model = new TreeModel(listOfElements); - // model.AddElement(new TreeElement { Name = "Element" }, root, 0); - // model.AddElement(new TreeElement { Name = "Element " + root.Children.Count }, root, 0); - // model.AddElement(new TreeElement { Name = "Element " + root.Children.Count }, root, 0); - // model.AddElement(new TreeElement { Name = "Sub Element" }, root.Children[1], 0); - - // model.RemoveElements(new[] { root.Children[1].Children[0], root.Children[1] }); - - // // Assert order is correct - // string[] namesInCorrectOrder = { "Root", "Element 2", "Element" }; - // Assert.AreEqual(namesInCorrectOrder.Length, listOfElements.Count, "Result count does not match"); - // for (int i = 0; i < namesInCorrectOrder.Length; ++i) - // Assert.AreEqual(namesInCorrectOrder[i], listOfElements[i].Name); - - // // Assert depths are valid - // TreeElementUtility.ValidateDepthValues(listOfElements); - // } - //} - - //#endregion - -} +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Assets.Scripts.AI.Tree +{ + // The TreeModel is a utility class working on a list of serializable TreeElements where the order and the depth of each TreeElement define + // the tree structure. Note that the TreeModel itself is not serializable (in Unity we are currently limited to serializing lists/arrays) but the + // input list is. + // The tree representation (parent and children references) are then build internally using TreeElementUtility.ListToTree (using depth + // values of the elements). + // The first element of the input list is required to have depth == -1 (the hiddenroot) and the rest to have + // depth >= 0 (otherwise an exception will be thrown) + + public class TreeModel where T : TreeElement + { + IList m_Data; + T m_Root; + int m_MaxID; + + public T Root { get { return m_Root; } set { m_Root = value; } } + public event Action ModelChanged; + public int NumberOfDataElements + { + get { return m_Data.Count; } + } + + public TreeModel (IList data) + { + SetData (data); + } + + public T Find (int id) + { + return m_Data.FirstOrDefault (element => element.ID == id); + } + + public void SetData (IList data) + { + Init (data); + } + + void Init (IList data) + { + if (data == null) + throw new ArgumentNullException("data", "Input data is null. Ensure input is a non-null list."); + + m_Data = data; + if (m_Data.Count > 0) + { + m_Root = TreeElementUtility.ListToTree(data); + m_MaxID = m_Data.Max(e => e.ID); + } + else + { + m_MaxID = -1; + } + + } + + public int GenerateUniqueID () + { + return ++m_MaxID; + } + + public IList GetAncestors (int id) + { + var parents = new List(); + TreeElement T = Find(id); + if (T != null) + { + while (T.Parent != null) + { + parents.Add(T.Parent.ID); + T = T.Parent; + } + } + return parents; + } + + public IList GetDescendantsThatHaveChildren (int id) + { + T searchFromThis = Find(id); + if (searchFromThis != null) + { + return GetParentsBelowStackBased(searchFromThis); + } + return new List(); + } + + IList GetParentsBelowStackBased(TreeElement searchFromThis) + { + Stack stack = new Stack(); + stack.Push(searchFromThis); + + var parentsBelow = new List(); + while (stack.Count > 0) + { + TreeElement current = stack.Pop(); + if (current.HasChildren) + { + parentsBelow.Add(current.ID); + foreach (var T in current.Children) + { + stack.Push(T); + } + } + } + + return parentsBelow; + } + + public void RemoveElements (IList elementIDs) + { + IList elements = m_Data.Where (element => elementIDs.Contains (element.ID)).ToArray (); + RemoveElements (elements); + } + + public void RemoveElements (IList elements) + { + foreach (var element in elements) + if (element == m_Root) + throw new ArgumentException("It is not allowed to remove the root element"); + + var commonAncestors = TreeElementUtility.FindCommonAncestorsWithinList (elements); + + foreach (var element in commonAncestors) + { + element.Parent.Children.Remove (element); + element.Parent = null; + } + + TreeElementUtility.TreeToList(m_Root, m_Data); + + Changed(); + } + + public void AddElements (IList elements, TreeElement parent, int insertPosition) + { + if (elements == null) + throw new ArgumentNullException("elements", "elements is null"); + if (elements.Count == 0) + throw new ArgumentNullException("elements", "elements Count is 0: nothing to add"); + if (parent == null) + throw new ArgumentNullException("parent", "parent is null"); + + if (parent.Children == null) + parent.Children = new List(); + + parent.Children.InsertRange(insertPosition, elements.Cast ()); + foreach (var element in elements) + { + element.Parent = parent; + element.Depth = parent.Depth + 1; + TreeElementUtility.UpdateDepthValues(element); + } + + TreeElementUtility.TreeToList(m_Root, m_Data); + + Changed(); + } + + public void AddRoot (T root) + { + if (root == null) + throw new ArgumentNullException("root", "root is null"); + + if (m_Data == null) + throw new InvalidOperationException("Internal Error: data list is null"); + + if (m_Data.Count != 0) + throw new InvalidOperationException("AddRoot is only allowed on empty data list"); + + root.ID = GenerateUniqueID (); + root.Depth = -1; + m_Data.Add (root); + } + + public void AddElement (T element, TreeElement parent, int insertPosition) + { + if (element == null) + throw new ArgumentNullException("element", "element is null"); + if (parent == null) + throw new ArgumentNullException("parent", "parent is null"); + + if (parent.Children == null) + parent.Children = new List (); + + parent.Children.Insert (insertPosition, element); + element.Parent = parent; + + TreeElementUtility.UpdateDepthValues(parent); + TreeElementUtility.TreeToList(m_Root, m_Data); + + Changed (); + } + + public void MoveElements(TreeElement parentElement, int insertionIndex, List elements) + { + if (insertionIndex < 0) + throw new ArgumentException("Invalid input: insertionIndex is -1, client needs to decide what index elements should be reparented at"); + + // Invalid reparenting input + if (parentElement == null) + return; + + // We are moving items so we adjust the insertion index to accomodate that any items above the insertion index is removed before inserting + if (insertionIndex > 0) + insertionIndex -= parentElement.Children.GetRange(0, insertionIndex).Count(elements.Contains); + + // Remove draggedItems from their parents + foreach (var draggedItem in elements) + { + draggedItem.Parent.Children.Remove(draggedItem); // remove from old parent + draggedItem.Parent = parentElement; // set new parent + } + + if (parentElement.Children == null) + parentElement.Children = new List(); + + // Insert dragged items under new parent + parentElement.Children.InsertRange(insertionIndex, elements); + + TreeElementUtility.UpdateDepthValues (Root); + TreeElementUtility.TreeToList (m_Root, m_Data); + + Changed (); + } + + void Changed () + { + if(ModelChanged != null) + { + ModelChanged.Invoke(); + } + } + } + + + //#region Tests + //class TreeModelTests + //{ + // [Test] + // public static void TestTreeModelCanAddElements() + // { + // var root = new TreeElement {Name = "Root", Depth = -1}; + // var listOfElements = new List(); + // listOfElements.Add(root); + + // var model = new TreeModel(listOfElements); + // model.AddElement(new TreeElement { Name = "Element" }, root, 0); + // model.AddElement(new TreeElement { Name = "Element " + root.Children.Count }, root, 0); + // model.AddElement(new TreeElement { Name = "Element " + root.Children.Count }, root, 0); + // model.AddElement(new TreeElement { Name = "Sub Element" }, root.Children[1], 0); + + // // Assert order is correct + // string[] namesInCorrectOrder = { "Root", "Element 2", "Element 1", "Sub Element", "Element" }; + // Assert.AreEqual(namesInCorrectOrder.Length, listOfElements.Count, "Result count does not match"); + // for (int i = 0; i < namesInCorrectOrder.Length; ++i) + // Assert.AreEqual(namesInCorrectOrder[i], listOfElements[i].Name); + + // // Assert depths are valid + // TreeElementUtility.ValidateDepthValues(listOfElements); + // } + + // [Test] + // public static void TestTreeModelCanRemoveElements() + // { + // var root = new TreeElement { Name = "Root", Depth = -1 }; + // var listOfElements = new List(); + // listOfElements.Add(root); + + // var model = new TreeModel(listOfElements); + // model.AddElement(new TreeElement { Name = "Element" }, root, 0); + // model.AddElement(new TreeElement { Name = "Element " + root.Children.Count }, root, 0); + // model.AddElement(new TreeElement { Name = "Element " + root.Children.Count }, root, 0); + // model.AddElement(new TreeElement { Name = "Sub Element" }, root.Children[1], 0); + + // model.RemoveElements(new[] { root.Children[1].Children[0], root.Children[1] }); + + // // Assert order is correct + // string[] namesInCorrectOrder = { "Root", "Element 2", "Element" }; + // Assert.AreEqual(namesInCorrectOrder.Length, listOfElements.Count, "Result count does not match"); + // for (int i = 0; i < namesInCorrectOrder.Length; ++i) + // Assert.AreEqual(namesInCorrectOrder[i], listOfElements[i].Name); + + // // Assert depths are valid + // TreeElementUtility.ValidateDepthValues(listOfElements); + // } + //} + + //#endregion + +} diff --git a/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeModel.cs.meta b/Assets/Scripts/AI/Tree/TreeModel.cs.meta similarity index 95% rename from Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeModel.cs.meta rename to Assets/Scripts/AI/Tree/TreeModel.cs.meta index 0ee779c..966a8ac 100644 --- a/Assets/Visual Behavior Tree/Scripts/AI/Tree/TreeModel.cs.meta +++ b/Assets/Scripts/AI/Tree/TreeModel.cs.meta @@ -1,12 +1,12 @@ -fileFormatVersion: 2 -guid: 6f9fab1cf2636a6439c644bf08108abb -timeCreated: 1472122507 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 6f9fab1cf2636a6439c644bf08108abb +timeCreated: 1472122507 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Scripts/BehaviorReactiveExtensions.cs b/Assets/Scripts/BehaviorReactiveExtensions.cs similarity index 97% rename from Assets/Visual Behavior Tree/Scripts/BehaviorReactiveExtensions.cs rename to Assets/Scripts/BehaviorReactiveExtensions.cs index 4f82cde..6855692 100644 --- a/Assets/Visual Behavior Tree/Scripts/BehaviorReactiveExtensions.cs +++ b/Assets/Scripts/BehaviorReactiveExtensions.cs @@ -1,37 +1,37 @@ -using Assets.Scripts.AI; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UniRx; - -namespace Assets.Visual_Behavior_Tree.Scripts -{ - public static class BehaviorReactiveExtensions - { - public static IObservable Publish( - this IObservable source, Func, IObservable> selector) - { - return Observable.CreateSafe((IObserver observer) => - { - var s = source.Publish(); - var p = selector(s).Subscribe(observer); - return new CompositeDisposable(p, s.Connect()); - }); - } - - public static IObservable TakeWhileInclusive( - this IObservable source, Func predicate) - { - return source.Publish(co => co.TakeWhile(predicate) - .Merge(co.SkipWhile(predicate) - .Take(1))); - } - - public static IObservable Any(this IObservable source, Func predicate) - { - return source.Where(predicate).Select(e => true).Concat(Observable.Return(false)).Take(1); - } - } -} +using Assets.Scripts.AI; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UniRx; + +namespace Assets.Visual_Behavior_Tree.Scripts +{ + public static class BehaviorReactiveExtensions + { + public static IObservable Publish( + this IObservable source, Func, IObservable> selector) + { + return Observable.CreateSafe((IObserver observer) => + { + var s = source.Publish(); + var p = selector(s).Subscribe(observer); + return new CompositeDisposable(p, s.Connect()); + }); + } + + public static IObservable TakeWhileInclusive( + this IObservable source, Func predicate) + { + return source.Publish(co => co.TakeWhile(predicate) + .Merge(co.SkipWhile(predicate) + .Take(1))); + } + + public static IObservable Any(this IObservable source, Func predicate) + { + return source.Where(predicate).Select(e => true).Concat(Observable.Return(false)).Take(1); + } + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/BehaviorReactiveExtensions.cs.meta b/Assets/Scripts/BehaviorReactiveExtensions.cs.meta similarity index 100% rename from Assets/Visual Behavior Tree/Scripts/BehaviorReactiveExtensions.cs.meta rename to Assets/Scripts/BehaviorReactiveExtensions.cs.meta diff --git a/Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs b/Assets/Scripts/TreeNodeAsset.cs similarity index 97% rename from Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs rename to Assets/Scripts/TreeNodeAsset.cs index 441eb11..375dd96 100644 --- a/Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs +++ b/Assets/Scripts/TreeNodeAsset.cs @@ -1,39 +1,39 @@ -using Assets.Scripts.AI; -using Assets.Scripts.AI.Tree; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using UnityEngine; - -namespace Assets.Visual_Behavior_Tree.Scripts -{ - public class TreeNodeAsset : ScriptableObject - { - public List positions; - - public string treeElements; - } - - public static class AssetExtensions - { - public static BehaviorTreeElement LoadRoot(this TreeNodeAsset asset) - { - var elements = JsonConvert.DeserializeObject>(asset.treeElements); - - var behaviorElements = new List(); - foreach (dynamic el in elements) - { - string typeName = el.ElementType; - Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(typeName); - dynamic newBehavior = Activator.CreateInstance(type, (string)el.Name, (int)el.Depth, (int)el.ID); - JsonConvert.PopulateObject(JsonConvert.SerializeObject(el), newBehavior); - behaviorElements.Add(newBehavior); - } - return TreeElementUtility.ListToTree(behaviorElements); - } - } -} +using Assets.Scripts.AI; +using Assets.Scripts.AI.Tree; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Scripts +{ + public class TreeNodeAsset : ScriptableObject + { + public List positions; + + public string treeElements; + } + + public static class AssetExtensions + { + public static BehaviorTreeElement LoadRoot(this TreeNodeAsset asset) + { + var elements = JsonConvert.DeserializeObject>(asset.treeElements); + + var behaviorElements = new List(); + foreach (dynamic el in elements) + { + string typeName = el.ElementType; + Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(typeName); + dynamic newBehavior = Activator.CreateInstance(type, (string)el.Name, (int)el.Depth, (int)el.ID); + JsonConvert.PopulateObject(JsonConvert.SerializeObject(el), newBehavior); + behaviorElements.Add(newBehavior); + } + return TreeElementUtility.ListToTree(behaviorElements); + } + } +} diff --git a/Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs.meta b/Assets/Scripts/TreeNodeAsset.cs.meta similarity index 100% rename from Assets/Visual Behavior Tree/Scripts/TreeNodeAsset.cs.meta rename to Assets/Scripts/TreeNodeAsset.cs.meta diff --git a/Assets/TestScene.meta b/Assets/TestScene.meta new file mode 100644 index 0000000..fec7342 --- /dev/null +++ b/Assets/TestScene.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5697b8d8d1200ce4a90f1a4dd9370305 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TestScene.unity b/Assets/TestScene.unity index 7b859ee..04ae904 100644 --- a/Assets/TestScene.unity +++ b/Assets/TestScene.unity @@ -119,9 +119,11 @@ NavMeshSettings: manualTileSize: 0 tileSize: 256 accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 debug: m_Flags: 0 - m_NavMeshData: {fileID: 0} + m_NavMeshData: {fileID: 23800000, guid: 2b940fadc4be91f4abaa36dd9487eacd, type: 2} --- !u!1 &132278577 GameObject: m_ObjectHideFlags: 0 @@ -135,6 +137,7 @@ GameObject: - component: {fileID: 132278580} - component: {fileID: 132278579} - component: {fileID: 132278578} + - component: {fileID: 132278583} m_Layer: 0 m_Name: Enemy 2 m_TagString: Untagged @@ -154,9 +157,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 73bc91841bad4424992751c051af5030, type: 3} m_Name: m_EditorClassIdentifier: - BehaviorTreeFiles: [] - MilliSecondsBetweenTicks: 10000 - TimesToTick: -1 + BehaviorTreeFiles: + - {fileID: 11400000, guid: 47aa65c014fca5c4b84622b79234ac8b, type: 2} + MilliSecondsBetweenTicks: 100 + TimesToTick: 1 --- !u!23 &132278579 MeshRenderer: m_ObjectHideFlags: 0 @@ -233,6 +237,28 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!195 &132278583 +NavMeshAgent: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 132278577} + m_Enabled: 1 + m_AgentTypeID: 0 + m_Radius: 0.5 + m_Speed: 3.5 + m_Acceleration: 8 + avoidancePriority: 50 + m_AngularSpeed: 120 + m_StoppingDistance: 0 + m_AutoTraverseOffMeshLink: 1 + m_AutoBraking: 1 + m_AutoRepath: 1 + m_Height: 1 + m_BaseOffset: 0.5 + m_WalkableMask: 4294967295 + m_ObstacleAvoidanceType: 4 --- !u!1 &271199282 GameObject: m_ObjectHideFlags: 0 @@ -352,6 +378,7 @@ GameObject: - component: {fileID: 374731284} - component: {fileID: 374731283} - component: {fileID: 374731287} + - component: {fileID: 374731288} m_Layer: 0 m_Name: Enemy m_TagString: Untagged @@ -448,9 +475,31 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: BehaviorTreeFiles: - - {fileID: 11400000, guid: b98c8b4c9f285114db64fe1fbab3f31a, type: 2} - MilliSecondsBetweenTicks: 100 - TimesToTick: 10 + - {fileID: 11400000, guid: 47aa65c014fca5c4b84622b79234ac8b, type: 2} + MilliSecondsBetweenTicks: 1000 + TimesToTick: 1 +--- !u!195 &374731288 +NavMeshAgent: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 374731282} + m_Enabled: 1 + m_AgentTypeID: 0 + m_Radius: 0.5 + m_Speed: 3.5 + m_Acceleration: 8 + avoidancePriority: 50 + m_AngularSpeed: 120 + m_StoppingDistance: 0 + m_AutoTraverseOffMeshLink: 1 + m_AutoBraking: 1 + m_AutoRepath: 1 + m_Height: 1 + m_BaseOffset: 0.5 + m_WalkableMask: 4294967295 + m_ObstacleAvoidanceType: 4 --- !u!1 &761835721 GameObject: m_ObjectHideFlags: 0 @@ -546,7 +595,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 761835721} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 8, y: 1, z: 10} + m_LocalPosition: {x: 8, y: 1.5, z: 10} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 271199288} diff --git a/Assets/TestScene/NavMesh.asset b/Assets/TestScene/NavMesh.asset new file mode 100644 index 0000000000000000000000000000000000000000..6dbef7d19addcd08f8031f43b3af31ca8a032f31 GIT binary patch literal 7876 zcmbuDU2I%O6~|}owcVCbVj!iZG+j!8P-yTvX_A&UU4Ml*q=^$JZcAF6>)mU6>-})< z-c92anoCIM58z3`X$n} zt}-g4UhY-VPctgYqK7K^NFm>Zmx-*3*iv7T_ozQZ_igCse3%4}P@9s$jP20>dAweO z$JmGrL{0rW(Rx;YpYCg6(4_u;&7;Av}R1{eKT*F%Hzcw{Lxqjv$>0d_e zhkvi4lkxokc| zKjq->Sbn>M|HtxAJ9rk!WBxwl;MZIJ*$&==SvP{+iRV7BZFn|EsBDq*WgMKpzt7>} zK9WLy0egSS@;d;!@kcD@IoFLZTK)wGZ&-e(gFk8cb_aja@-I60OO_9H;XJ=_{%im9 zUHAp?OO_9J;hg`veKtP3{L;=$Fo`G3`8w_$?^jFy78*zBPpI$ zE4V-F*8ZsGsBEEr#{V|F)BYHqK^37kg*<-$kE1)uO?;n#e#UnKe69HIBfp5smd^X@ z%ji$WuU9<}-Hb2w?p(mq94OP_xG_B@6+-5IXL5UT=N`iQ>gy}=F9$`L3c7fhD&@Nba08!Ln&_T zU$pigPVuDuuR6HcKjGkF|B)0o`T3R2&!glKDqA}9^ELFZm7iI1nT(e4`yF&MKRLXg z#FOL$I{t53|2@rfs7>LwXgvON=uXDpaPhzB;NpKN#f|;9t$jbmllJEwT~p7%4^{Fu z#{6FO9&}6oYAJ5+hrwR+`>AW5YiZ#58_(aegG>BQIk?0xNO5ETCTpMH;>q|X?S~F7 z_L~ka_D`pHR{M7=>@$ClYmUkmp6@T<{@ezRFsd_nlJU*z`+o;`25iN_@3H)BigT8V z4uJD~-g;`5|~OMK3yxUnziTa@BS``>hMvHz5V zi~XllJfq&i_rt@8599t!ikt6iIp4qK;9~#0gNyxdJ9r89xj&vwajXydnFr_n^IVE2 z*Y~`G%li0tq*6Iuvy#6bWPRV!B&Tau{J!M*a>}mnyDegbL*D5J{Kn$A7kX-HDh%$O zD3!x{FmWdIYmIWfwpUeW_mwODCU&5 z=UdwIE%kZmx9cBmmMf)cKMc#Yg+|-QWVg5A*TQ2f%M6m1k9wtYvti`@etBUrH1c$% zzU&)utWvJdsfu4(@W+GtvK>|R&Kzh~mq&_0z0nvio7k#qxpvfFKr%)G-&0ku*7Pc4 zex)*9KI^NZ2&SLW*ZrXgUa{B=ywIPjctyX8l|sXr1NFHF>%o#AG}Ln7H~iqVuk&`e z88*r#f3)7Lm0C&E-j4fo&4pGZN_;~+_EkI`7qkAVx7<)IQRjWR-YADyIu6DabykIb z5P0R9-4bRfHwJc0`^C~3KM2c3km~GYtz;#;vg+&@Jn;iCy;b4V?4f!op=NZ3J&Ybb z#?6a%_VD~X?Hw%FmKtiL8P;PR*6wuZ1=KfDE1|Zztj=-@lZ-x-2i-GX4*a5ausS(sbc0a3YA-{oVX5`Q~ z&r5z&ut3B~Va_mF2=6mKI9V_K=JLVU*z)c29c2Jw{Z)8}he?ZOu)|4LuK#Qo&x_5D;z{CxG5J4WMv za=!RR)+rm`%$V+eW+Upj8b3J>cS+{`_(}ci`N{Q*pGt)ZKjXg596#0aQ)K!kW4ids zl}D&H;OArSE1%+H+!lRjN$*?J&wO(2@qKIFP2S=%XV5>%Gd(gp((K#*$mqP9eDb?M z>3yriVkWLpckWvmDz?&o%Dz>KKE(axT>8L%KAp1YcKex)I7Vz!HYNT0v;g~d<9>=y z)FHN{Px8t2n|;esX5X@p`HcG}dzF16bB2te+>uY!A7vwSwro>2#pNgW?Z*A&z7@Y* ze#&`ke3SDw)P8bJ%oY6-nd4-y#$_|6y>C_2A8`(g*fwvh(|)%1E&nQAzjW@~_5C#a zmTTr?&fBz~Wa6{PY`G%Y&+&Ys8=ht(v{&UP$Dv@~Zro4$xSpR}EBCEgvz)iaPw|Jj zlD!(2$z_b0AIm3fZ`@Dr+pF`FK|$fad<#nLgb$bZvcr}FTdc|SNf0bdH@_V*eQY-| R9{6V1q;uFF8_`yx{0{-DI2ix{ literal 0 HcmV?d00001 diff --git a/Assets/TestScene/NavMesh.asset.meta b/Assets/TestScene/NavMesh.asset.meta new file mode 100644 index 0000000..04298ba --- /dev/null +++ b/Assets/TestScene/NavMesh.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2b940fadc4be91f4abaa36dd9487eacd +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorDebuggerWindow.cs b/Assets/Visual Behavior Tree/Editor/BehaviorDebuggerWindow.cs new file mode 100644 index 0000000..d1be555 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/BehaviorDebuggerWindow.cs @@ -0,0 +1,39 @@ +using Assets.Visual_Behavior_Tree.Editor.NodeEditor; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEditor; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Editor +{ + class BehaviorDebuggerWindow : BehaviorNodeEditorWindow + { + [MenuItem("Window/uVBT/Node Debugger")] + private static void OpenWindow() + { + BehaviorDebuggerWindow window = GetWindow(); + window.titleContent = new GUIContent("Behavior Debugger"); + } + + protected override void OnGUI() + { + DrawToolbar(); + + DrawGrid(20, 0.2f, Color.gray); + DrawGrid(100, 0.4f, Color.gray); + + DrawNodes(); + DrawConnections(); + + DrawConnectionLine(Event.current); + + ProcessNodeEvents(Event.current); + ProcessEvents(Event.current); + + if (GUI.changed) Repaint(); + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorDebuggerWindow.cs.meta b/Assets/Visual Behavior Tree/Editor/BehaviorDebuggerWindow.cs.meta new file mode 100644 index 0000000..7bd9934 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/BehaviorDebuggerWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1191ae4cc15422f4a93ccf2aea5e67b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs index f872337..694bd37 100644 --- a/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorEditorNode.cs @@ -1,207 +1,188 @@ -using Assets.Editor; -using Assets.Scripts.AI; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEditor; -using UnityEngine; -using System.Reflection; - -namespace Assets.Visual_Behavior_Tree.Editor.NodeEditor -{ - public class BehaviorEditorNode - { - public Rect fullRect; - public Rect subInspectorRect; - - public string title; - public int titleSize = 10; - - public bool isDragged; - public bool isSelected; - - [SerializeField] - public BehaviorTreeElement treeElement; - - public SerializedObject elementObject; - - public ConnectionPoint inPoint; - public ConnectionPoint outPoint; - - private GUIStyle inPointStyle; - private GUIStyle outPointStyle; - - public GUIStyle style; - public GUIStyle defaultNodeStyle; - public GUIStyle selectedNodeStyle; - - public Action OnRemoveNode; - - public BehaviorEditorNode(Vector2 position, float width, float height, BehaviorTreeElement element, Action OnClickInPoint, Action OnClickOutPoint, Action OnClickRemoveNode) - { - fullRect = new Rect(position.x, position.y, width, height); - - style = new GUIStyle(); - style.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/node1.png") as Texture2D; - style.border = new RectOffset(12, 12, 12, 12); - - defaultNodeStyle = style; - - selectedNodeStyle = new GUIStyle(); - selectedNodeStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/node1 on.png") as Texture2D; - selectedNodeStyle.border = new RectOffset(12, 12, 12, 12); - - inPointStyle = new GUIStyle(); - inPointStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn left.png") as Texture2D; - inPointStyle.active.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn left on.png") as Texture2D; - inPointStyle.border = new RectOffset(4, 4, 12, 12); - - outPointStyle = new GUIStyle(); - outPointStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn right.png") as Texture2D; - outPointStyle.active.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn right on.png") as Texture2D; - outPointStyle.border = new RectOffset(4, 4, 12, 12); - - inPoint = new ConnectionPoint(this, ConnectionPointType.In, inPointStyle, OnClickInPoint); - outPoint = new ConnectionPoint(this, ConnectionPointType.Out, outPointStyle, OnClickOutPoint); - - Vector2 inPointSize = inPoint.rect.size; - Vector2 outPointSize = outPoint.rect.size; - - subInspectorRect = new Rect(position.x + inPointSize.x, position.y + titleSize, width - inPointSize.x - outPointSize.x, height - (titleSize * 2)); - - treeElement = element; - elementObject = new SerializedObject(treeElement); - - title = treeElement.Name; - - OnRemoveNode = OnClickRemoveNode; - } - - public void AddInConnection(Connection connection) - { - inPoint.connections.Add(connection); - } - - public void RemoveInConnection(Connection connection) - { - inPoint.connections.Remove(connection); - } - - public void AddOutConnection(Connection connection) - { - outPoint.connections.Add(connection); - } - - public void RemoveOutConnection(Connection connection) - { - outPoint.connections.Remove(connection); - } - - public void Drag(Vector2 delta) - { - fullRect.position += delta; - subInspectorRect.position += delta; - } - - public void Draw() - { - inPoint.Draw(); - outPoint.Draw(); - - GUI.Box(fullRect, title, style); - GUI.Box(subInspectorRect, "", selectedNodeStyle); - - Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(treeElement.ElementType); - FieldInfo[] fields = type.GetFields(); - - var items = new List(); - foreach (FieldInfo field in fields) - { - items.Add(field.Name); - } - - var objStyle = EditorStyles.objectField; - var boxes = EditorGUIUtility.GetFlowLayoutedRects(subInspectorRect, objStyle, 2, 0, items); - for (int i = 0; i < items.Count; ++i) - { - var box = boxes[i]; - box.x = box.x + 7; - box.y = box.y + 9; - box.xMax = subInspectorRect.xMax - 10; - using (new GUILayout.AreaScope(box, "")) - { - var prop = elementObject.FindProperty(items[i]); - - GUILayout.BeginHorizontal(); - var label = new GUIContent(prop.displayName,prop.displayName); - EditorGUILayout.LabelField(label, EditorStyles.whiteLabel, GUILayout.MinWidth(45), GUILayout.ExpandWidth(true)); - EditorGUILayout.PropertyField(prop, GUIContent.none, true, GUILayout.MinWidth(95), GUILayout.ExpandWidth(true)); - GUILayout.EndHorizontal(); - } - } - elementObject.ApplyModifiedProperties(); - } - - public bool ProcessEvents(Event e) - { - switch (e.type) - { - case EventType.MouseDown: - if (e.button == 0) - { - if (fullRect.Contains(e.mousePosition)) - { - isDragged = true; - GUI.changed = true; - isSelected = true; - style = selectedNodeStyle; - } - else - { - GUI.changed = true; - isSelected = false; - style = defaultNodeStyle; - } - } - - if (e.button == 1 && isSelected && fullRect.Contains(e.mousePosition)) - { - ProcessContextMenu(); - e.Use(); - } - break; - - case EventType.MouseUp: - isDragged = false; - break; - - case EventType.MouseDrag: - if (e.button == 0 && isDragged) - { - Drag(e.delta); - e.Use(); - return true; - } - break; - } - - return false; - } - - private void ProcessContextMenu() - { - GenericMenu genericMenu = new GenericMenu(); - genericMenu.AddItem(new GUIContent("Remove node"), false, OnClickRemoveNode); - genericMenu.ShowAsContext(); - } - - private void OnClickRemoveNode() - { - OnRemoveNode?.Invoke(this); - } - } - - -} +using Assets.Editor; +using Assets.Scripts.AI; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEditor; +using UnityEngine; +using System.Reflection; + +namespace Assets.Visual_Behavior_Tree.Editor.NodeEditor +{ + public class BehaviorEditorNode + { + public Rect fullRect; + public Rect subInspectorRect; + + public string title; + public int titleSize = 10; + + public bool isDragged; + public bool isSelected; + + [SerializeField] + public BehaviorTreeElement treeElement; + + public SerializedObject elementObject; + + public ConnectionPoint inPoint; + public ConnectionPoint outPoint; + + private GUIStyle inPointStyle; + private GUIStyle outPointStyle; + + public GUIStyle style; + public GUIStyle defaultNodeStyle; + public GUIStyle selectedNodeStyle; + + public Action OnRemoveNode; + + public BehaviorEditorNode(Vector2 position, float width, float height, BehaviorTreeElement element, Action OnClickInPoint, Action OnClickOutPoint, Action OnClickRemoveNode) + { + fullRect = new Rect(position.x, position.y, width, height); + + style = new GUIStyle(); + style.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/node1.png") as Texture2D; + style.border = new RectOffset(12, 12, 12, 12); + + defaultNodeStyle = style; + + selectedNodeStyle = new GUIStyle(); + selectedNodeStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/node1 on.png") as Texture2D; + selectedNodeStyle.border = new RectOffset(12, 12, 12, 12); + + inPointStyle = new GUIStyle(); + inPointStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn left.png") as Texture2D; + inPointStyle.active.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn left on.png") as Texture2D; + inPointStyle.border = new RectOffset(4, 4, 12, 12); + + outPointStyle = new GUIStyle(); + outPointStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn right.png") as Texture2D; + outPointStyle.active.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn right on.png") as Texture2D; + outPointStyle.border = new RectOffset(4, 4, 12, 12); + + inPoint = new ConnectionPoint(this, ConnectionPointType.In, inPointStyle, OnClickInPoint); + outPoint = new ConnectionPoint(this, ConnectionPointType.Out, outPointStyle, OnClickOutPoint); + + Vector2 inPointSize = inPoint.rect.size; + Vector2 outPointSize = outPoint.rect.size; + + subInspectorRect = new Rect(position.x + inPointSize.x, position.y + titleSize, width - inPointSize.x - outPointSize.x, height - (titleSize * 2)); + + treeElement = element; + elementObject = new SerializedObject(treeElement); + + title = treeElement.Name; + + OnRemoveNode = OnClickRemoveNode; + } + + public void Drag(Vector2 delta) + { + fullRect.position += delta; + subInspectorRect.position += delta; + } + + public void Draw() + { + inPoint.Draw(); + if(treeElement.CanHaveChildren) + outPoint.Draw(); + + GUI.Box(fullRect, title, style); + GUI.Box(subInspectorRect, "", selectedNodeStyle); + + Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(treeElement.ElementType); + FieldInfo[] fields = type.GetFields(); + + var items = new List(); + foreach (FieldInfo field in fields) + { + items.Add(field.Name); + } + + var objStyle = EditorStyles.objectField; + var boxes = EditorGUIUtility.GetFlowLayoutedRects(subInspectorRect, objStyle, 2, 0, items); + for (int i = 0; i < items.Count; ++i) + { + var box = boxes[i]; + box.x = box.x + 7; + box.y = box.y + 9; + box.xMax = subInspectorRect.xMax - 10; + using (new GUILayout.AreaScope(box, "")) + { + var prop = elementObject.FindProperty(items[i]); + + GUILayout.BeginHorizontal(); + var label = new GUIContent(prop.displayName,prop.displayName); + EditorGUILayout.LabelField(label, EditorStyles.whiteLabel, GUILayout.MinWidth(45), GUILayout.ExpandWidth(true)); + EditorGUILayout.PropertyField(prop, GUIContent.none, true, GUILayout.MinWidth(95), GUILayout.ExpandWidth(true)); + GUILayout.EndHorizontal(); + } + } + elementObject.ApplyModifiedProperties(); + } + + public bool ProcessEvents(Event e) + { + switch (e.type) + { + case EventType.MouseDown: + if (e.button == 0) + { + if (fullRect.Contains(e.mousePosition)) + { + isDragged = true; + GUI.changed = true; + isSelected = true; + style = selectedNodeStyle; + } + else + { + GUI.changed = true; + isSelected = false; + style = defaultNodeStyle; + } + } + + if (e.button == 1 && isSelected && fullRect.Contains(e.mousePosition)) + { + ProcessContextMenu(); + e.Use(); + } + break; + + case EventType.MouseUp: + isDragged = false; + break; + + case EventType.MouseDrag: + if (e.button == 0 && isDragged) + { + Drag(e.delta); + e.Use(); + return true; + } + break; + } + + return false; + } + + private void ProcessContextMenu() + { + GenericMenu genericMenu = new GenericMenu(); + genericMenu.AddItem(new GUIContent("Remove node"), false, OnClickRemoveNode); + genericMenu.ShowAsContext(); + } + + private void OnClickRemoveNode() + { + OnRemoveNode?.Invoke(this); + } + } + + +} diff --git a/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs index 0977a65..0f6a17f 100644 --- a/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor/BehaviorNodeEditorWindow.cs @@ -1,360 +1,343 @@ -using Assets.Editor; -using Assets.Scripts.AI; -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEngine; - -namespace Assets.Visual_Behavior_Tree.Editor.NodeEditor -{ - public class BehaviorNodeEditorWindow : EditorWindow - { - private List nodes; - private List connections; - - private GUIStyle nodeStyle; - private GUIStyle selectedNodeStyle; - - private ConnectionPoint selectedInPoint; - private ConnectionPoint selectedOutPoint; - - private Vector2 offset; - private Vector2 drag; - - private int nodeID = -1; - - [MenuItem("Window/uVBT/Node Editor")] - private static void OpenWindow() - { - BehaviorNodeEditorWindow window = GetWindow(); - window.titleContent = new GUIContent("Behavior Node Editor"); - } - - private void OnEnable() - { - selectedNodeStyle = new GUIStyle(); - selectedNodeStyle.normal.background = EditorGUIUtility.Load("builtin skins/lightskin/images/node6 on.png") as Texture2D; - selectedNodeStyle.border = new RectOffset(10, 10, 10, 10); - } - - private void OnGUI() - { - DrawToolbar(); - - DrawGrid(20, 0.2f, Color.gray); - DrawGrid(100, 0.4f, Color.gray); - - DrawNodes(); - DrawConnections(); - - DrawConnectionLine(Event.current); - - ProcessNodeEvents(Event.current); - ProcessEvents(Event.current); - - if (GUI.changed) Repaint(); - } - - private void DrawToolbar() - { - if(GUILayout.Button("Save")) { - SaveAllNodesToFile(); - } - if (GUILayout.Button("Load")) - { - LoadNodesFromFile(); - } - } - - private void DrawGrid(float gridSpacing, float gridOpacity, Color gridColor) - { - int widthDivs = Mathf.CeilToInt(position.width / gridSpacing); - int heightDivs = Mathf.CeilToInt(position.height / gridSpacing); - - Handles.BeginGUI(); - Handles.color = new Color(gridColor.r, gridColor.g, gridColor.b, gridOpacity); - - offset += drag * 0.5f; - Vector3 newOffset = new Vector3(offset.x % gridSpacing, offset.y % gridSpacing, 0); - - for (int i = 0; i < widthDivs; i++) - { - Handles.DrawLine(new Vector3(gridSpacing * i, -gridSpacing, 0) + newOffset, new Vector3(gridSpacing * i, position.height, 0f) + newOffset); - } - - for (int j = 0; j < heightDivs; j++) - { - Handles.DrawLine(new Vector3(-gridSpacing, gridSpacing * j, 0) + newOffset, new Vector3(position.width, gridSpacing * j, 0f) + newOffset); - } - - Handles.color = Color.white; - Handles.EndGUI(); - } - - private void DrawNodes() - { - if(nodes != null) - { - for (int i = 0; i < nodes.Count; i++) - { - nodes[i].Draw(); - } - } - } - - private void DrawConnections() - { - if (connections != null) - { - for (int i = 0; i < connections.Count; i++) - { - connections[i].Draw(); - } - } - } - - private void DrawConnectionLine(Event e) - { - if (selectedInPoint != null && selectedOutPoint == null) - { - Handles.DrawBezier( - selectedInPoint.rect.center, - e.mousePosition, - selectedInPoint.rect.center + Vector2.left * 50f, - e.mousePosition - Vector2.left * 50f, - Color.white, - null, - 2f - ); - - GUI.changed = true; - } - - if (selectedOutPoint != null && selectedInPoint == null) - { - Handles.DrawBezier( - selectedOutPoint.rect.center, - e.mousePosition, - selectedOutPoint.rect.center - Vector2.left * 50f, - e.mousePosition + Vector2.left * 50f, - Color.white, - null, - 2f - ); - - GUI.changed = true; - } - } - - private void ProcessEvents(Event e) - { - drag = Vector2.zero; - - switch (e.type) - { - case EventType.MouseDown: - if (e.button == 1) - { - ProcessContextMenu(e.mousePosition); - } - break; - - case EventType.MouseDrag: - if (e.button == 0) - { - OnDrag(e.delta); - } - break; - } - } - - private void ProcessNodeEvents(Event e) - { - if (nodes != null) - { - for (int i = nodes.Count - 1; i >= 0; i--) - { - bool guiChanged = nodes[i].ProcessEvents(e); - - if (guiChanged) - { - GUI.changed = true; - } - } - } - } - - private void ProcessContextMenu(Vector2 mousePosition) - { - GenericMenu genericMenu = new GenericMenu(); - genericMenu.CreateTypeMenu((typeName) => OnClickAddNode(mousePosition, typeName)); - genericMenu.ShowAsContext(); - } - - private void OnClickAddNode(Vector2 mousePosition, object itemTypeSelected) - { - if (nodes == null) - { - nodes = new List(); - } - - Type type = typeof(BehaviorTreeElement).Assembly.GetType((string)itemTypeSelected, true); - - var treeElement = (BehaviorTreeElement)CreateInstance(type); - treeElement.ID = 0; - treeElement.Name = type.ToString().Split('.').Last(); - treeElement.Depth = -1; - treeElement.ElementType = type.ToString(); - - nodes.Add(new BehaviorEditorNode(mousePosition, 200, 150, treeElement, OnClickInPoint, OnClickOutPoint, OnClickRemoveNode)); - } - - private void OnClickRemoveNode(BehaviorEditorNode node) - { - if (connections != null) - { - List connectionsToRemove = new List(); - - for (int i = 0; i < connections.Count; i++) - { - if (connections[i].inPoint == node.inPoint || connections[i].outPoint == node.outPoint) - { - connectionsToRemove.Add(connections[i]); - } - } - - for (int i = 0; i < connectionsToRemove.Count; i++) - { - var connection = connectionsToRemove[i]; - connections.Remove(connection); - if(connection.inPoint.connections.Contains(connection)) - { - connection.inPoint.connections.Remove(connection); - } - - if (connection.outPoint.connections.Contains(connection)) - { - connection.outPoint.connections.Remove(connection); - } - } - - connectionsToRemove = null; - } - - nodes.Remove(node); - } - - private void OnDrag(Vector2 delta) - { - drag = delta; - - if (nodes != null) - { - for (int i = 0; i < nodes.Count; i++) - { - nodes[i].Drag(delta); - } - } - - GUI.changed = true; - } - - private void OnClickInPoint(ConnectionPoint inPoint) - { - selectedInPoint = inPoint; - - if (selectedOutPoint != null) - { - if (selectedOutPoint.node != selectedInPoint.node) - { - CreateConnection(); - } - ClearConnectionSelection(); - } - } - - private void OnClickOutPoint(ConnectionPoint outPoint) - { - selectedOutPoint = outPoint; - - if (selectedInPoint != null) - { - if (selectedOutPoint.node != selectedInPoint.node) - { - CreateConnection(); - } - ClearConnectionSelection(); - } - } - - private void OnClickRemoveConnection(Connection connection) - { - connection.inPoint.connections.Remove(connection); - connection.outPoint.connections.Remove(connection); - connections.Remove(connection); - } - - private void CreateConnection() - { - if (connections == null) - { - connections = new List(); - } - - var connection = new Connection(selectedInPoint, selectedOutPoint, OnClickRemoveConnection); - - selectedInPoint.connections.Add(connection); - selectedOutPoint.connections.Add(connection); - connections.Add(connection); - } - - private void ClearConnectionSelection() - { - selectedInPoint = null; - selectedOutPoint = null; - } - - private void SaveAllNodesToFile() - { - if (IsValidTree()) - { - var path = EditorUtility.SaveFilePanelInProject( - "Save behavior tree", - "New Behavior Tree.asset", - "asset", - "Save behavior tree asset"); - - TreeSaver saver = new TreeSaver(); - saver.SaveTree(nodes, path); - } - } - - private void LoadNodesFromFile() - { - var path = EditorUtility.OpenFilePanel( - "Save behavior tree", - "", - "asset"); - - TreeLoader loader = new TreeLoader(); - var root = loader.LoadFromAsset(path); - nodes = loader.GetNodes(OnClickInPoint, OnClickOutPoint, OnClickRemoveNode); - connections = loader.GetConnectionsFromRoot(root, OnClickRemoveConnection); - } - - private bool IsValidTree() - { - DeselectAllNodes(); - return new TreeValidator(selectedNodeStyle).IsValidTreeByNodes(nodes); - } - - private void DeselectAllNodes() - { - foreach(var node in nodes) - { - node.style = node.defaultNodeStyle; - } - } - } -} +using Assets.Editor; +using Assets.Scripts.AI; +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Editor.NodeEditor +{ + public class BehaviorNodeEditorWindow : EditorWindow + { + private List nodes; + private List connections; + + private GUIStyle nodeStyle; + private GUIStyle selectedNodeStyle; + + private ConnectionPoint selectedInPoint; + private ConnectionPoint selectedOutPoint; + + private Vector2 offset; + private Vector2 drag; + + [MenuItem("Window/uVBT/Node Editor")] + private static void OpenWindow() + { + BehaviorNodeEditorWindow window = GetWindow(); + window.titleContent = new GUIContent("Behavior Node Editor"); + } + + private void OnEnable() + { + selectedNodeStyle = new GUIStyle(); + selectedNodeStyle.normal.background = EditorGUIUtility.Load("builtin skins/lightskin/images/node6 on.png") as Texture2D; + selectedNodeStyle.border = new RectOffset(10, 10, 10, 10); + } + + protected virtual void OnGUI() + { + DrawToolbar(); + + DrawGrid(20, 0.2f, Color.gray); + DrawGrid(100, 0.4f, Color.gray); + + DrawNodes(); + DrawConnections(); + + DrawConnectionLine(Event.current); + + ProcessNodeEvents(Event.current); + ProcessEvents(Event.current); + + if (GUI.changed) Repaint(); + } + + protected void DrawToolbar() + { + if(GUILayout.Button("Save")) { + SaveAllNodesToFile(); + } + if (GUILayout.Button("Load")) + { + LoadNodesFromFile(); + } + } + + protected void DrawGrid(float gridSpacing, float gridOpacity, Color gridColor) + { + int widthDivs = Mathf.CeilToInt(position.width / gridSpacing); + int heightDivs = Mathf.CeilToInt(position.height / gridSpacing); + + Handles.BeginGUI(); + Handles.color = new Color(gridColor.r, gridColor.g, gridColor.b, gridOpacity); + + offset += drag * 0.5f; + Vector3 newOffset = new Vector3(offset.x % gridSpacing, offset.y % gridSpacing, 0); + + for (int i = 0; i < widthDivs; i++) + { + Handles.DrawLine(new Vector3(gridSpacing * i, -gridSpacing, 0) + newOffset, new Vector3(gridSpacing * i, position.height, 0f) + newOffset); + } + + for (int j = 0; j < heightDivs; j++) + { + Handles.DrawLine(new Vector3(-gridSpacing, gridSpacing * j, 0) + newOffset, new Vector3(position.width, gridSpacing * j, 0f) + newOffset); + } + + Handles.color = Color.white; + Handles.EndGUI(); + } + + protected void DrawNodes() + { + if(nodes != null) + { + for (int i = 0; i < nodes.Count; i++) + { + nodes[i].Draw(); + } + } + } + + protected void DrawConnections() + { + if (connections != null) + { + for (int i = 0; i < connections.Count; i++) + { + connections[i].Draw(); + } + } + } + + protected void DrawConnectionLine(Event e) + { + if (selectedInPoint != null) + { + Handles.DrawLine(selectedInPoint.rect.center, + e.mousePosition); + GUI.changed = true; + } + + if (selectedOutPoint != null) + { + Handles.DrawLine(selectedOutPoint.rect.center, + e.mousePosition); + + GUI.changed = true; + } + } + + protected void ProcessEvents(Event e) + { + drag = Vector2.zero; + + switch (e.type) + { + case EventType.MouseDown: + if (e.button == 1) + { + ProcessContextMenu(e.mousePosition); + } + break; + + case EventType.MouseDrag: + if (e.button == 0) + { + OnDrag(e.delta); + } + break; + } + } + + protected void ProcessNodeEvents(Event e) + { + if (nodes != null) + { + for (int i = nodes.Count - 1; i >= 0; i--) + { + bool guiChanged = nodes[i].ProcessEvents(e); + + if (guiChanged) + { + GUI.changed = true; + } + } + } + } + + protected void ProcessContextMenu(Vector2 mousePosition) + { + GenericMenu genericMenu = new GenericMenu(); + genericMenu.CreateTypeMenu((typeName) => OnClickAddNode(mousePosition, typeName)); + genericMenu.ShowAsContext(); + } + + protected void OnClickAddNode(Vector2 mousePosition, object itemTypeSelected) + { + if (nodes == null) + { + nodes = new List(); + } + Debug.Log((string)itemTypeSelected); + Type type = typeof(BehaviorTreeElement).Assembly.GetType((string)itemTypeSelected, true); + + var treeElement = (BehaviorTreeElement)CreateInstance(type); + treeElement.ID = 0; + treeElement.Name = type.ToString().Split('.').Last(); + treeElement.Depth = -1; + treeElement.ElementType = type.ToString(); + + nodes.Add(new BehaviorEditorNode(mousePosition, 200, 150, treeElement, OnClickInPoint, OnClickOutPoint, OnClickRemoveNode)); + } + + private void OnClickRemoveNode(BehaviorEditorNode node) + { + if (connections != null) + { + List connectionsToRemove = new List(); + + for (int i = 0; i < connections.Count; i++) + { + if (connections[i].inPoint == node.inPoint || connections[i].outPoint == node.outPoint) + { + connectionsToRemove.Add(connections[i]); + } + } + + for (int i = 0; i < connectionsToRemove.Count; i++) + { + var connection = connectionsToRemove[i]; + connections.Remove(connection); + if(connection.inPoint.connections.Contains(connection)) + { + connection.inPoint.connections.Remove(connection); + } + + if (connection.outPoint.connections.Contains(connection)) + { + connection.outPoint.connections.Remove(connection); + } + } + + connectionsToRemove = null; + } + + nodes.Remove(node); + } + + private void OnDrag(Vector2 delta) + { + drag = delta; + + if (nodes != null) + { + for (int i = 0; i < nodes.Count; i++) + { + nodes[i].Drag(delta); + } + } + + GUI.changed = true; + } + + protected void OnClickInPoint(ConnectionPoint inPoint) + { + selectedInPoint = inPoint; + + if (selectedOutPoint != null) + { + if (selectedOutPoint.node != selectedInPoint.node) + { + CreateConnection(); + } + ClearConnectionSelection(); + } + } + + private void OnClickOutPoint(ConnectionPoint outPoint) + { + selectedOutPoint = outPoint; + + if (selectedInPoint != null) + { + if (selectedOutPoint.node != selectedInPoint.node) + { + CreateConnection(); + } + ClearConnectionSelection(); + } + } + + private void OnClickRemoveConnection(Connection connection) + { + connection.inPoint.connections.Remove(connection); + connection.outPoint.connections.Remove(connection); + connections.Remove(connection); + } + + private void CreateConnection() + { + if (connections == null) + { + connections = new List(); + } + + var connection = new Connection(selectedInPoint, selectedOutPoint, OnClickRemoveConnection); + + selectedInPoint.connections.Add(connection); + selectedOutPoint.connections.Add(connection); + connections.Add(connection); + } + + private void ClearConnectionSelection() + { + selectedInPoint = null; + selectedOutPoint = null; + } + + private void SaveAllNodesToFile() + { + if (IsValidTree()) + { + var path = EditorUtility.SaveFilePanelInProject( + "Save behavior tree", + "New Behavior Tree.asset", + "asset", + "Save behavior tree asset"); + + TreeSaver saver = new TreeSaver(); + saver.SaveTree(nodes, path); + } + } + + protected void LoadNodesFromFile() + { + var path = EditorUtility.OpenFilePanel( + "Save behavior tree", + "", + "asset"); + + TreeLoader loader = new TreeLoader(); + var root = loader.LoadFromAsset(path); + nodes = loader.GetNodes(OnClickInPoint, OnClickOutPoint, OnClickRemoveNode); + connections = loader.GetConnectionsFromRoot(root, OnClickRemoveConnection); + } + + private bool IsValidTree() + { + DeselectAllNodes(); + return new TreeValidator(selectedNodeStyle).IsValidTreeByNodes(nodes); + } + + private void DeselectAllNodes() + { + foreach(var node in nodes) + { + node.style = node.defaultNodeStyle; + } + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/NodeEditor/Connection.cs b/Assets/Visual Behavior Tree/Editor/NodeEditor/Connection.cs index ada0298..94bdd5e 100644 --- a/Assets/Visual Behavior Tree/Editor/NodeEditor/Connection.cs +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor/Connection.cs @@ -1,42 +1,31 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEditor; -using UnityEngine; - -namespace Assets.Visual_Behavior_Tree.Editor.NodeEditor -{ - public class Connection - { - public ConnectionPoint inPoint; - public ConnectionPoint outPoint; - public Action OnClickRemoveConnection; - - public Connection(ConnectionPoint inPoint, ConnectionPoint outPoint, Action OnClickRemoveConnection) - { - this.inPoint = inPoint; - this.outPoint = outPoint; - this.OnClickRemoveConnection = OnClickRemoveConnection; - } - - public void Draw() - { - Handles.DrawBezier( - inPoint.rect.center, - outPoint.rect.center, - inPoint.rect.center + Vector2.left * 50f, - outPoint.rect.center - Vector2.left * 50f, - Color.white, - null, - 2f - ); - - if (Handles.Button((inPoint.rect.center + outPoint.rect.center) * 0.5f, Quaternion.identity, 4, 8, Handles.RectangleHandleCap)) - { - OnClickRemoveConnection?.Invoke(this); - } - } - } -} +using System; +using UnityEditor; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Editor.NodeEditor +{ + public class Connection + { + public ConnectionPoint inPoint; + public ConnectionPoint outPoint; + public Action OnClickRemoveConnection; + + public Connection(ConnectionPoint inPoint, ConnectionPoint outPoint, Action OnClickRemoveConnection) + { + this.inPoint = inPoint; + this.outPoint = outPoint; + this.OnClickRemoveConnection = OnClickRemoveConnection; + } + + public void Draw() + { + Handles.DrawLine(inPoint.rect.center, + outPoint.rect.center); + + if (Handles.Button((inPoint.rect.center + outPoint.rect.center) * 0.5f, Quaternion.identity, 4, 8, Handles.RectangleHandleCap)) + { + OnClickRemoveConnection?.Invoke(this); + } + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/NodeEditor/ConnectionPoint.cs b/Assets/Visual Behavior Tree/Editor/NodeEditor/ConnectionPoint.cs index a6c4cd5..ec803b3 100644 --- a/Assets/Visual Behavior Tree/Editor/NodeEditor/ConnectionPoint.cs +++ b/Assets/Visual Behavior Tree/Editor/NodeEditor/ConnectionPoint.cs @@ -1,53 +1,53 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace Assets.Visual_Behavior_Tree.Editor.NodeEditor -{ - public enum ConnectionPointType { In, Out } - - public class ConnectionPoint - { - public Rect rect; - - public ConnectionPointType type; - - public BehaviorEditorNode node; - - public GUIStyle style; - - public Action OnClickConnectionPoint; - - public List connections = new List(); - - public ConnectionPoint(BehaviorEditorNode node, ConnectionPointType type, GUIStyle style, Action OnClickConnectionPoint) - { - this.node = node; - this.type = type; - this.style = style; - this.OnClickConnectionPoint = OnClickConnectionPoint; - rect = new Rect(0, 0, 10f, 20f); - } - - public void Draw() - { - rect.y = node.fullRect.y + (node.fullRect.height * 0.5f) - rect.height * 0.5f; - - switch (type) - { - case ConnectionPointType.In: - rect.x = node.fullRect.x - rect.width + 8f; - break; - - case ConnectionPointType.Out: - rect.x = node.fullRect.x + node.fullRect.width - 8f; - break; - } - - if (GUI.Button(rect, "", style)) - { - OnClickConnectionPoint?.Invoke(this); - } - } - } +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Editor.NodeEditor +{ + public enum ConnectionPointType { In, Out } + + public class ConnectionPoint + { + public Rect rect; + + public ConnectionPointType type; + + public BehaviorEditorNode node; + + public GUIStyle style; + + public Action OnClickConnectionPoint; + + public List connections = new List(); + + public ConnectionPoint(BehaviorEditorNode node, ConnectionPointType type, GUIStyle style, Action OnClickConnectionPoint) + { + this.node = node; + this.type = type; + this.style = style; + this.OnClickConnectionPoint = OnClickConnectionPoint; + rect = new Rect(0, 0, 20f, 10f); + } + + public void Draw() + { + rect.x = node.fullRect.x + (node.fullRect.width * 0.5f) - rect.width * 0.5f; + + switch (type) + { + case ConnectionPointType.In: + rect.y = node.fullRect.y - rect.height + 4f; + break; + + case ConnectionPointType.Out: + rect.y = node.fullRect.y + node.fullRect.height - 5f; + break; + } + + if (GUI.Button(rect, "", style)) + { + OnClickConnectionPoint?.Invoke(this); + } + } + } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/TreeSaver.cs b/Assets/Visual Behavior Tree/Editor/TreeSaver.cs index 84c23a8..2b962bb 100644 --- a/Assets/Visual Behavior Tree/Editor/TreeSaver.cs +++ b/Assets/Visual Behavior Tree/Editor/TreeSaver.cs @@ -1,74 +1,117 @@ -using Assets.Scripts.AI; -using Assets.Scripts.AI.Tree; -using Assets.Visual_Behavior_Tree.Editor.NodeEditor; -using Assets.Visual_Behavior_Tree.Scripts; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using UnityEditor; -using UnityEngine; - -namespace Assets.Visual_Behavior_Tree.Editor -{ - public class TreeSaver - { - private List positions; - - public void SaveTree(List nodes, string path) - { - BehaviorEditorNode rootNode = nodes.Find(node => node.inPoint.connections.Count == 0); - - rootNode.treeElement.Depth = -1; - - positions = new List(); - positions.Add(rootNode.fullRect); - - RecursiveAddChildren(rootNode); - - var json = GetJsonSaveDataFromRoot(rootNode.treeElement); - - Debug.Log(json); - - SaveAssetToDatabase(path, positions, json); - } - - private void RecursiveAddChildren(BehaviorEditorNode rootNode) - { - rootNode.treeElement.Children = new List(); - var rootNodeConnections = rootNode.outPoint.connections; - rootNodeConnections.ForEach(outNode => - { - var outInpointNode = outNode.inPoint.node; - if (outInpointNode != rootNode) - { - var treeElement = outInpointNode.treeElement; - treeElement.Parent = rootNode.treeElement; - treeElement.Depth = rootNode.treeElement.Depth + 1; - rootNode.treeElement.Children.Add(treeElement); - var pos = outInpointNode.fullRect; - positions.Add(pos); - RecursiveAddChildren(outInpointNode); - } - }); - } - - private string GetJsonSaveDataFromRoot(BehaviorTreeElement root) - { - var elementList = new List(); - TreeElementUtility.TreeToList(root, elementList); - - return JsonConvert.SerializeObject(elementList, Formatting.Indented); - } - - private void SaveAssetToDatabase(string path, List positions, string json) - { - TreeNodeAsset asset = ScriptableObject.CreateInstance(); - asset.positions = positions; - asset.treeElements = json; - - AssetDatabase.CreateAsset(asset, path); - } - } -} +using Assets.Scripts.AI; +using Assets.Scripts.AI.Tree; +using Assets.Visual_Behavior_Tree.Editor.NodeEditor; +using Assets.Visual_Behavior_Tree.Editor.UIENodeEditor; +using Assets.Visual_Behavior_Tree.Scripts; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Editor +{ + public class TreeSaver + { + private List positions; + + public void SaveTree(List nodes, string path) + { + BehaviorEditorNode rootNode = nodes.Find(node => node.inPoint.connections.Count == 0); + + rootNode.treeElement.Depth = -1; + + positions = new List(); + positions.Add(rootNode.fullRect); + + RecursiveAddChildren(rootNode); + + var json = GetJsonSaveDataFromRoot(rootNode.treeElement); + + Debug.Log(json); + + SaveAssetToDatabase(path, positions, json); + } + + private void RecursiveAddChildren(BehaviorEditorNode rootNode) + { + rootNode.treeElement.Children = new List(); + var rootNodeConnections = rootNode.outPoint.connections; + rootNodeConnections.ForEach(outNode => + { + var outInpointNode = outNode.inPoint.node; + if (outInpointNode != rootNode) + { + var treeElement = outInpointNode.treeElement; + treeElement.Parent = rootNode.treeElement; + treeElement.Depth = rootNode.treeElement.Depth + 1; + rootNode.treeElement.Children.Add(treeElement); + var pos = outInpointNode.fullRect; + positions.Add(pos); + RecursiveAddChildren(outInpointNode); + } + }); + } + + public void SaveTree(List nodes, string path) + { + EditorNode rootNode = nodes.Find(node => node.inPoint.connections.Count == 0); + + Debug.Log(rootNode.TreeElement.Name); + + rootNode.TreeElement.Depth = -1; + + positions = new List(); + positions.Add(rootNode.layout); + + RecursiveAddChildren(rootNode); + + var json = GetJsonSaveDataFromRoot(rootNode.TreeElement); + + Debug.Log(json); + + SaveAssetToDatabase(path, positions, json); + } + + private void RecursiveAddChildren(EditorNode rootNode) + { + rootNode.TreeElement.Children = new List(); + var rootOutNode = rootNode.outPoint; + if (rootOutNode == null) return; + var rootNodeConnections = rootOutNode.connections; + rootNodeConnections.ForEach(outNode => + { + var outInpointNode = outNode.inPoint.node; + if (outInpointNode != rootNode) + { + var treeElement = outInpointNode.TreeElement; + treeElement.Parent = rootNode.TreeElement; + treeElement.Depth = rootNode.TreeElement.Depth + 1; + rootNode.TreeElement.Children.Add(treeElement); + var pos = outInpointNode.layout; + positions.Add(pos); + RecursiveAddChildren(outInpointNode); + } + }); + } + + private string GetJsonSaveDataFromRoot(BehaviorTreeElement root) + { + var elementList = new List(); + TreeElementUtility.TreeToList(root, elementList); + + return JsonConvert.SerializeObject(elementList, Formatting.Indented); + } + + private void SaveAssetToDatabase(string path, List positions, string json) + { + TreeNodeAsset asset = ScriptableObject.CreateInstance(); + asset.positions = positions; + asset.treeElements = json; + + AssetDatabase.CreateAsset(asset, path); + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor.meta new file mode 100644 index 0000000..a18f4f7 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0faed3662ae17fd4b86faff984d970f1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection.meta new file mode 100644 index 0000000..de04682 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 00ee8b101a97cd84a9e9dd9925bd31f5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs new file mode 100644 index 0000000..b3adb73 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEditor; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor +{ + public class Connection : VisualElement + { + public ConnectionPoint inPoint; + public ConnectionPoint outPoint; + public Action OnClickRemoveConnection; + + Button removeButton; + + public float lineWidth = 3; + + public Connection(ConnectionPoint inPoint, ConnectionPoint outPoint, Action OnClickRemoveConnection) + { + this.inPoint = inPoint; + this.outPoint = outPoint; + this.OnClickRemoveConnection = OnClickRemoveConnection; + + this.AddToClassList("Connection"); + + var styleSheet = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.uss"); + this.styleSheets.Add(styleSheet); + + + removeButton = new Button(); + removeButton.AddToClassList("ConnectionButton"); + removeButton.clicked += OnClicked; + + this.Add(removeButton); + + this.generateVisualContent += OnGenerateVisualContent; + } + + void OnClicked() + { + OnClickRemoveConnection?.Invoke(this); + } + + void OnGenerateVisualContent(MeshGenerationContext cxt) + { + MeshWriteData mesh = cxt.Allocate(4, 6); + Vertex[] vertices = new Vertex[4]; + + float inX = inPoint.worldBound.center.x; + float leftIn = inX - lineWidth; + float rightIn = inX + lineWidth; + + float outX = outPoint.worldBound.center.x; + float leftOut = outX - lineWidth; + float rightOut = outX + lineWidth; + float top = inPoint.worldBound.center.y - 59; + float bottom = outPoint.worldBound.center.y - 59; + + removeButton.style.top = ((top + bottom) / 2) - removeButton.layout.height/2; + removeButton.style.left = ((inX + outX) / 2) - (removeButton.layout.width / 2) - 2; + + vertices[0].position = new Vector3(leftIn, top, Vertex.nearZ); + vertices[1].position = new Vector3(rightIn, top, Vertex.nearZ); + vertices[2].position = new Vector3(leftOut, bottom, Vertex.nearZ); + vertices[3].position = new Vector3(rightOut, bottom, Vertex.nearZ); + + var color = this.resolvedStyle.color; + + vertices[0].tint = color; + vertices[1].tint = color; + vertices[2].tint = color; + vertices[3].tint = color; + mesh.SetAllVertices(vertices); + if(top > bottom) + mesh.SetAllIndices(new ushort[] { 0, 2, 1, 2, 3, 1}); + else + mesh.SetAllIndices(new ushort[] { 2, 0, 3, 0, 1, 3 }); + + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs.meta new file mode 100644 index 0000000..d85007a --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2718362afbceb9b42a23d9bbe4007881 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.uss b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.uss new file mode 100644 index 0000000..9f25011 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.uss @@ -0,0 +1,4 @@ +.Connection { + color: green; + position: absolute; +} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.uss.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.uss.meta new file mode 100644 index 0000000..b75f250 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.uss.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e82b6090bd4c66543a46bb994a2843f7 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} + disableValidation: 0 diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint.meta new file mode 100644 index 0000000..d31d280 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 60427dc6d8bd0a947a9ce519271163d3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.cs new file mode 100644 index 0000000..86b9a1e --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.cs @@ -0,0 +1,74 @@ +using UnityEditor; +using UnityEngine; +using UnityEngine.UIElements; +using UnityEditor.UIElements; +using System; +using System.Collections.Generic; + +namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor +{ + public enum ConnectionPointType { In, Out } + + public class ConnectionPoint : Button, IEquatable + { + public ConnectionPointType Type; + + public Action OnClickConnectionPoint; + internal List connections = new List(); + internal EditorNode node; + + public ConnectionPoint() + { + VisualElement root = this; + + var styleSheet = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uss"); + root.styleSheets.Add(styleSheet); + } + + public ConnectionPoint(EditorNode node, ConnectionPointType type, Action onClickConnectionPoint) + { + this.node = node; + + VisualElement root = this; + + var styleSheet = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uss"); + root.styleSheets.Add(styleSheet); + + OnClickConnectionPoint = onClickConnectionPoint; + this.clicked += OnClicked; + + connections = new List(); + } + + private void OnClicked() + { + OnClickConnectionPoint?.Invoke(this); + } + + public override bool Equals(object obj) + { + return Equals(obj as ConnectionPoint); + } + + public bool Equals(ConnectionPoint other) + { + return other != null && + Type == other.Type && + EqualityComparer>.Default.Equals(OnClickConnectionPoint, other.OnClickConnectionPoint) && + EqualityComparer>.Default.Equals(connections, other.connections) && + EqualityComparer.Default.Equals(node, other.node); + } + + public override int GetHashCode() + { + int hashCode = 97315638; + hashCode = hashCode * -1521134295 + Type.GetHashCode(); + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(OnClickConnectionPoint); + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(connections); + hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(node); + return hashCode; + } + + + } +} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.cs.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.cs.meta new file mode 100644 index 0000000..5e8c374 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f0c10ff80b46ee343a4226fbbfc5eda3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uss b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uss new file mode 100644 index 0000000..d637471 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uss @@ -0,0 +1,5 @@ +Label { + font-size: 20px; + -unity-font-style: bold; + color: rgb(68, 138, 255); +} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uss.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uss.meta new file mode 100644 index 0000000..abb8ea3 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uss.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 295231c78eb84284f915ae5a74d479e5 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} + disableValidation: 0 diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uxml b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uxml new file mode 100644 index 0000000..7e2121d --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uxml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uxml.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uxml.meta new file mode 100644 index 0000000..3013886 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/ConnectionPoint/ConnectionPoint.uxml.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 86e9177be92736d4894a1ef97d7c34e1 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0} diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window.meta new file mode 100644 index 0000000..ad6e9c6 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7d1ce5b06cce02541a1911a19d14e9b1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs new file mode 100644 index 0000000..b61bad6 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs @@ -0,0 +1,271 @@ +using Assets.Scripts.AI; +using Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Manipulators; +using Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Util; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEditor.UIElements; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor +{ + public class BehaviorEditorWindow : EditorWindow + { + public List nodes = new List(); + public List connections = new List(); + + private ConnectionPoint selectedInPoint; + private ConnectionPoint selectedOutPoint; + + [MenuItem("Testies/Behavior Editor Window")] + public static void ShowExample() + { + BehaviorEditorWindow wnd = GetWindow(); + wnd.titleContent = new GUIContent("Behavior Node Editor"); + } + + public void OnEnable() + { + VisualElement root = rootVisualElement; + + // Import UXML + var visualTree = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uxml"); + VisualElement uxmlRoot = visualTree.CloneTree(); + + root.Add(uxmlRoot); + + var container = rootVisualElement.Q("GridContainer"); + + container.AddManipulator(new ContextualMenuManipulator(ContextMenu)); + container.AddManipulator(new BehaviorEditorDragger(this)); + + var saveButton = (Button)rootVisualElement.Q("SaveButton"); + saveButton.clicked += SaveAllNodesToFile; + + var loadButton = (Button)rootVisualElement.Q("LoadButton"); + loadButton.clicked += LoadNodesFromFile; + + // A stylesheet can be added to a VisualElement. + // The style will be applied to the VisualElement and all of its children. + var styleSheet = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss"); + root.styleSheets.Add(styleSheet); + + this.SetAntiAliasing(4); + } + + private void ContextMenu(ContextualMenuPopulateEvent evt) + { + foreach (Type type in + Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetTypes() + .Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(BehaviorTreeElement)))) + { + var menuStrings = type.ToString().Split('.'); + evt.menu.AppendAction(menuStrings[menuStrings.Length - 2] + + "/" + menuStrings.Last(), OnMenuAction); + } + } + + void OnMenuAction(DropdownMenuAction action) + { + if (nodes == null) + { + nodes = new List(); + } + + DeselectAllNodes(); + + string selectedName = action.name.Split('/').Last(); + var typeName = from type in typeof(BehaviorTreeElement).Assembly.GetTypes() + where type.Name.Contains(selectedName) + select type; + + var treeElement = (BehaviorTreeElement)CreateInstance(typeName.First()); + treeElement.ID = 0; + treeElement.Name = selectedName; + treeElement.ElementType = typeName.First().ToString(); + + EditorNode item = new EditorNode(treeElement, action.eventInfo.localMousePosition, OnClickInPoint, OnClickOutPoint, OnClickRemoveNode); + OnClickAddNode(item); + } + + void OnClickAddNode(EditorNode node) + { + nodes.Add(node); + rootVisualElement.Q("GridContainer").Add(node); + } + + private void OnGUI() + { + rootVisualElement.Q("GridContainer").style.height = new StyleLength(position.height); + } + + protected void OnClickInPoint(ConnectionPoint inPoint) + { + selectedInPoint = inPoint; + + if (selectedOutPoint != null) + { + if (!selectedOutPoint.node.Equals(selectedInPoint.node)) + { + CreateConnection(); + } + ClearConnectionSelection(); + } + } + + private void OnClickOutPoint(ConnectionPoint outPoint) + { + selectedOutPoint = outPoint; + + if (selectedInPoint != null) + { + if (!selectedOutPoint.node.Equals(selectedInPoint.node)) + { + CreateConnection(); + } + ClearConnectionSelection(); + } + } + + private void OnClickRemoveConnection(Connection connection) + { + connection.inPoint.connections.Remove(connection); + connection.outPoint.connections.Remove(connection); + rootVisualElement.Q("GridContainer").Remove(connection); + connections.Remove(connection); + } + + private void CreateConnection() + { + if (connections == null) + { + connections = new List(); + } + + var connection = new Connection(selectedInPoint, selectedOutPoint, OnClickRemoveConnection); + var container = rootVisualElement.Q("GridContainer"); + connection.MarkDirtyRepaint(); + container.Add(connection); + + selectedInPoint.connections.Add(connection); + selectedOutPoint.connections.Add(connection); + connections.Add(connection); + } + + private void ClearConnectionSelection() + { + selectedInPoint = null; + selectedOutPoint = null; + } + + private void SaveAllNodesToFile() + { + DeselectAllNodes(); + + if (IsValidTree()) + { + var path = EditorUtility.SaveFilePanelInProject( + "Save behavior tree", + "New Behavior Tree.asset", + "asset", + "Save behavior tree asset"); + + TreeSaver saver = new TreeSaver(); + saver.SaveTree(nodes, path); + } + } + + protected void LoadNodesFromFile() + { + var container = rootVisualElement.Q("GridContainer"); + if(nodes != null) + foreach (var node in nodes) + { + container.Remove(node); + } + + if(connections != null) + foreach (var connection in connections) + { + container.Remove(connection); + connection.MarkDirtyRepaint(); + } + + var path = EditorUtility.OpenFilePanel( + "Load behavior tree", + "", + "asset"); + + UIETreeLoader loader = new UIETreeLoader(); + var root = loader.LoadFromAsset(path); + nodes = loader.GetNodes(OnClickInPoint, OnClickOutPoint, OnClickRemoveNode); + connections = loader.GetConnectionsFromRoot(root, OnClickRemoveConnection); + + foreach(var node in nodes) + { + container.Add(node); + } + + foreach(var connection in connections) + { + container.Add(connection); + connection.MarkDirtyRepaint(); + } + } + + private bool IsValidTree() + { + return new UIETreeValidator().IsValidTreeByNodes(nodes); + } + + private void OnClickRemoveNode(EditorNode node) + { + if (connections != null) + { + List connectionsToRemove = new List(); + + for (int i = 0; i < connections.Count; i++) + { + if (connections[i].inPoint.Equals(node.inPoint) || connections[i].outPoint.Equals(node.outPoint)) + { + connectionsToRemove.Add(connections[i]); + } + } + + for (int i = 0; i < connectionsToRemove.Count; i++) + { + var connection = connectionsToRemove[i]; + connections.Remove(connection); + if (connection.inPoint.connections.Contains(connection)) + { + connection.inPoint.connections.Remove(connection); + rootVisualElement.Q("GridContainer").Remove(connection); + + } + + if (connection.outPoint.connections.Contains(connection)) + { + connection.outPoint.connections.Remove(connection); + rootVisualElement.Q("GridContainer").Remove(connection); + } + } + + connectionsToRemove = null; + } + + nodes.Remove(node); + } + + private void DeselectAllNodes() + { + foreach(var node in nodes) + { + node.RemoveFromClassList("Selected"); + node.RemoveFromClassList("Error"); + } + } + } +} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs.meta new file mode 100644 index 0000000..ac96a89 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d1cfbc453e905db49b76a5e5c4a93cd5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss new file mode 100644 index 0000000..48bf493 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss @@ -0,0 +1,26 @@ +.EditorNode { + width: 200px; + height: 100px; + position: absolute; +} + +.Connection { + position: absolute; +} + +#Toolbar +{ + height: 40px; + width: auto; + background-color: rgb(21, 132, 67); + + display: flex; + flex-direction: row; +} + +#GridContainer +{ + background-color: rgba(242, 246, 250,1); + width: auto; + height: auto; +} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss.meta new file mode 100644 index 0000000..9968747 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 83d0f06b8f9cba74ab7e17f359d0fd75 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} + disableValidation: 0 diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uxml b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uxml new file mode 100644 index 0000000..4bfc5fd --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uxml @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uxml.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uxml.meta new file mode 100644 index 0000000..2ff6241 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uxml.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 83a634a8f233c3848aac4f37df6f998b +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0} diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators.meta new file mode 100644 index 0000000..3e734d6 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3b8a981e9552f1141b0abf4c01c5763e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/BehaviorEditorDragger.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/BehaviorEditorDragger.cs new file mode 100644 index 0000000..19db81e --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/BehaviorEditorDragger.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Manipulators +{ + public class BehaviorEditorDragger : MouseManipulator + { + private Vector2 last; + protected bool isActive; + + private BehaviorEditorWindow Window; + + public BehaviorEditorDragger(BehaviorEditorWindow window) + { + Window = window; + } + + protected override void RegisterCallbacksOnTarget() + { + target.RegisterCallback(OnMouseDown); + target.RegisterCallback(OnMouseMove); + target.RegisterCallback(OnMouseUp); + } + + protected override void UnregisterCallbacksFromTarget() + { + target.UnregisterCallback(OnMouseDown); + target.UnregisterCallback(OnMouseMove); + target.UnregisterCallback(OnMouseUp); + } + + private void OnMouseDown(MouseDownEvent evt) + { + if (isActive) + { + isActive = false; + evt.StopImmediatePropagation(); + return; + } + + last = evt.localMousePosition; + + isActive = true; + target.CaptureMouse(); + evt.StopPropagation(); + } + + private void OnMouseMove(MouseMoveEvent evt) + { + if (!isActive || !target.HasMouseCapture()) + return; + + Vector2 diff = evt.localMousePosition - last; + + foreach(var node in Window.nodes) + { + node.style.left = node.layout.x + diff.x; + node.style.top = node.layout.y + diff.y; + } + + foreach(var connection in Window.connections) + { + connection.MarkDirtyRepaint(); + } + + last = evt.localMousePosition; + evt.StopPropagation(); + + + } + + private void OnMouseUp(MouseUpEvent evt) + { + if (!isActive || !target.HasMouseCapture() || !CanStopManipulation(evt)) + return; + + isActive = false; + target.ReleaseMouse(); + evt.StopPropagation(); + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/BehaviorEditorDragger.cs.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/BehaviorEditorDragger.cs.meta new file mode 100644 index 0000000..f168af5 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/BehaviorEditorDragger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fe5d2c5cb85e55744969da6f4251812a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeSelector.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeSelector.cs new file mode 100644 index 0000000..020225c --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeSelector.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Manipulators +{ + public class EditorNodeSelector : MouseManipulator + { + protected bool isSelected; + + private EditorNode Node; + + public EditorNodeSelector(EditorNode node) + { + Node = node; + } + + protected override void RegisterCallbacksOnTarget() + { + target.RegisterCallback(OnMouseDown); + } + + protected override void UnregisterCallbacksFromTarget() + { + target.UnregisterCallback(OnMouseDown); + } + + private void OnMouseDown(MouseDownEvent evt) + { + if (isSelected) + { + Node.RemoveFromClassList("Selected"); + isSelected = false; + evt.StopImmediatePropagation(); + return; + } + + Node.AddToClassList("Selected"); + + isSelected = true; + evt.StopPropagation(); + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeSelector.cs.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeSelector.cs.meta new file mode 100644 index 0000000..4572fd4 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeSelector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd55a3ac7d8767e43aaedddf06d91ca6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/NodeDragger.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/NodeDragger.cs new file mode 100644 index 0000000..ae76f8d --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/NodeDragger.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Manipulators +{ + public class NodeDragger : MouseManipulator + { + private Vector2 start; + protected bool isActive; + + protected override void RegisterCallbacksOnTarget() + { + target.RegisterCallback(OnMouseDown); + target.RegisterCallback(OnMouseMove); + target.RegisterCallback(OnMouseUp); + } + + protected override void UnregisterCallbacksFromTarget() + { + target.UnregisterCallback(OnMouseDown); + target.UnregisterCallback(OnMouseMove); + target.UnregisterCallback(OnMouseUp); + } + + private void OnMouseDown(MouseDownEvent evt) + { + if (isActive) + { + isActive = false; + evt.StopImmediatePropagation(); + return; + } + + start = evt.localMousePosition; + + isActive = true; + target.CaptureMouse(); + evt.StopPropagation(); + } + + private void OnMouseMove(MouseMoveEvent evt) + { + if (!isActive || !target.HasMouseCapture()) + return; + + Vector2 diff = evt.localMousePosition - start; + + target.style.left = target.layout.x + diff.x; + target.style.top = target.layout.y + diff.y; + var node = target as EditorNode; + var inConnections = node.inPoint.connections; + + foreach(var connection in inConnections) + { + connection.MarkDirtyRepaint(); + } + + if(node.TreeElement.CanHaveChildren) + { + var outConnections = node.outPoint.connections; + + foreach (var connection in outConnections) + { + connection.MarkDirtyRepaint(); + } + } + + evt.StopPropagation(); + } + + private void OnMouseUp(MouseUpEvent evt) + { + if (!isActive || !target.HasMouseCapture() || !CanStopManipulation(evt)) + return; + + isActive = false; + target.ReleaseMouse(); + evt.StopPropagation(); + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/NodeDragger.cs.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/NodeDragger.cs.meta new file mode 100644 index 0000000..72b51e2 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/NodeDragger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 61803fcbe811d0b4dbbb10eff627d39e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node.meta new file mode 100644 index 0000000..31b1bc0 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2bf1808656155414e863f450eebba4aa +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs new file mode 100644 index 0000000..74e76c7 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs @@ -0,0 +1,160 @@ +using UnityEditor; +using UnityEngine; +using UnityEngine.UIElements; +using UnityEditor.UIElements; +using Assets.Scripts.AI; +using Assets.Scripts.AI.Components; +using UnityEditor.Experimental.GraphView; +using System; +using System.Collections.Generic; +using System.Reflection; +using UnityEngine.Analytics; +using Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Manipulators; +using System.Linq; + +namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor +{ + public class EditorNode : Box + { + public BehaviorTreeElement TreeElement; + + public SerializedObject ElementObject; + + public ConnectionPoint inPoint; + public ConnectionPoint outPoint; + + public EditorNode(BehaviorTreeElement wrappedElement, Vector2 position, Action OnClickInPoint, Action OnClickOutPoint, Action OnClickRemoveNode) + { + var styleSheet = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uss"); + this.styleSheets.Add(styleSheet); + + var visualTree = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uxml"); + VisualElement uxmlRoot = visualTree.Instantiate(); + this.Add(uxmlRoot); + + var parentContainer = uxmlRoot.Q("ParentConnectorContainer"); + inPoint = new ConnectionPoint(this, ConnectionPointType.In, OnClickInPoint); + inPoint.AddToClassList("NodeButton"); + parentContainer.Insert(1,inPoint); + + outPoint = new ConnectionPoint(this, ConnectionPointType.Out, OnClickOutPoint); + + this.AddToClassList("EditorNode"); + + this.style.left = position.x; + this.style.top = position.y; + + this.AddManipulator(new NodeDragger()); + this.AddManipulator(new EditorNodeSelector(this)); + this.AddManipulator(new ContextualMenuManipulator(ContextMenu)); + + TreeElement = wrappedElement; + ElementObject = new SerializedObject(wrappedElement); + + ReBindAllProperties(); + } + + private void ContextMenu(ContextualMenuPopulateEvent evt) + { + foreach (Type type in + Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetTypes() + .Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(BehaviorTreeElement)))) + { + var menuStrings = type.ToString().Split('.'); + evt.menu.AppendAction("Change/" + menuStrings[menuStrings.Length - 2] + + "/" + menuStrings.Last(), OnMenuAction); + } + } + + void OnMenuAction(DropdownMenuAction action) + { + string selectedName = action.name.Split('/').Last(); + var typeName = from type in typeof(BehaviorTreeElement).Assembly.GetTypes() + where type.Name.Contains(selectedName) + select type; + + var treeElement = (BehaviorTreeElement)ScriptableObject.CreateInstance(typeName.First()); + treeElement.ID = 0; + treeElement.Name = selectedName; + treeElement.ElementType = typeName.First().ToString(); + this.TreeElement = treeElement; + ElementObject = new SerializedObject(TreeElement); + ReBindAllProperties(); + } + + internal void ReBindAllProperties() + { + this.Bind(ElementObject); + + var nodeContainer = this.Q("NodeContainer"); + foreach(var child in nodeContainer.Children()) + { + Debug.Log("Removing 1 element"); + nodeContainer.Remove(child); + } + + foreach (var element in GetAllPropertyFields()) + { + Debug.Log("Adding one"); + nodeContainer.Add(element); + element.Bind(ElementObject); + } + + var childContainer = this.Q("ChildrenConnectorContainer"); + if (this.TreeElement.CanHaveChildren) + { + outPoint.AddToClassList("NodeButton"); + childContainer.Add(outPoint); + } + else if(childContainer.Contains(outPoint)) + { + Debug.Log("Removing connections"); + var connections = outPoint.connections; + List connectionsToRemove = new List(); + + for (int i = 0; i < connections.Count; i++) + { + if (connections[i].inPoint.Equals(this.inPoint) || connections[i].outPoint.Equals(this.outPoint)) + { + connectionsToRemove.Add(connections[i]); + } + } + + for (int i = 0; i < connectionsToRemove.Count; i++) + { + var connection = connectionsToRemove[i]; + connections.Remove(connection); + if (connection.inPoint.connections.Contains(connection)) + { + connection.inPoint.connections.Remove(connection); + } + + if (connection.outPoint.connections.Contains(connection)) + { + connection.outPoint.connections.Remove(connection); + } + } + childContainer.Remove(outPoint); + } + } + + public List GetAllPropertyFields() + { + var elements = new List(); + + Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(TreeElement.ElementType); + FieldInfo[] fields = type.GetFields(); + + foreach(var field in fields) + { + var prop = ElementObject.FindProperty(field.Name); + var propField = new PropertyField(prop, field.Name); + propField.AddToClassList("Property"); + + elements.Add(propField); + } + + return elements; + } + } +} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs.meta new file mode 100644 index 0000000..ae89d8f --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b3788352c8f5a0741a473270c38e06da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uss b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uss new file mode 100644 index 0000000..58659f6 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uss @@ -0,0 +1,63 @@ +#RootContainer { + background-color: rgba(242, 246, 250,1); + flex-direction: column; + width: auto; +} + +#ParentConnectorContainer { + height: 20px; + width: auto; + background-color: rgb(150, 25, 150); + + justify-content: space-between; + align-items: center; + flex-direction: row; +} + +#NameLabel { + width: auto; + flex: 0 1 auto; + +} + +.NodeButton { + flex: 1 1 auto; +} + +#TypeLabel { + width: auto; + flex: 0 1 auto; +} + +#NodeContainer { + height: 60px; + background-color: rgba(242, 246, 250,1); + display: flex; + flex-direction: column; + width: auto; +} + +#ChildrenConnectorContainer { + height: 20px; + width: auto; + background-color: rgb(150, 25, 150); + + align-items: center; +} + +.Property { + width: auto; + height: auto; + flex: 0 1 auto; +} + +.Selected { + border-color: green; + border-width: 5; +} + +.Error { + border-color: red; + border-width: 5; +} + diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uss.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uss.meta new file mode 100644 index 0000000..296fd37 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uss.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a5c2b85fc6d27146aaf57249ab616e5 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} + disableValidation: 0 diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uxml b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uxml new file mode 100644 index 0000000..7d672c0 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uxml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uxml.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uxml.meta new file mode 100644 index 0000000..f0d71e3 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uxml.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 6176dc2ba2683d0418a132224c937c3a +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0} diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/UIETreeLoader.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/UIETreeLoader.cs new file mode 100644 index 0000000..23279f4 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/UIETreeLoader.cs @@ -0,0 +1,85 @@ +using Assets.Scripts.AI; +using Assets.Scripts.AI.Tree; +using Assets.Visual_Behavior_Tree.Scripts; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Reflection; +using UnityEditor; + +namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor +{ + public class UIETreeLoader + { + private TreeNodeAsset asset; + + private List behaviorElements = new List(); + + private BehaviorTreeElement root; + + private List nodes; + private List connections = new List(); + + public BehaviorTreeElement LoadFromAsset(string path) + { + var filename = path.Substring(path.LastIndexOf("Assets/")); + asset = AssetDatabase.LoadAssetAtPath(filename); + + var elements = JsonConvert.DeserializeObject>(asset.treeElements); + + behaviorElements = new List(); + foreach (dynamic el in elements) + { + string typeName = el.ElementType; + Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(typeName); + dynamic newBehavior = Activator.CreateInstance(type, (string)el.Name, (int)el.Depth, (int)el.ID); + JsonConvert.PopulateObject(JsonConvert.SerializeObject(el), newBehavior); + behaviorElements.Add(newBehavior); + } + root = TreeElementUtility.ListToTree(behaviorElements); + return root; + } + + public List GetNodes(Action OnClickInPoint, Action OnClickOutPoint, Action OnClickRemoveNode) + { + nodes = new List(); + + for(int i = 0; i < behaviorElements.Count; ++i) + { + var nodeRect = asset.positions[i]; + var newNode = new EditorNode(behaviorElements[i], nodeRect.position, OnClickInPoint, OnClickOutPoint, OnClickRemoveNode); + + nodes.Add(newNode); + } + + return nodes; + } + + internal List GetConnectionsFromRoot(BehaviorTreeElement root, Action onClickRemoveConnection) + { + for (int parentIndex = 0; parentIndex < behaviorElements.Count; parentIndex++) + { + var parent = behaviorElements[parentIndex]; + + int parentDepth = parent.Depth; + + // Count children based depth value, we are looking at children until it's the same depth as this object + for (int i = parentIndex + 1; i < behaviorElements.Count; i++) + { + if (behaviorElements[i].Depth == parentDepth + 1) + { + var inPoint = nodes[i].inPoint; + var connection = new Connection(inPoint, nodes[parentIndex].outPoint, onClickRemoveConnection); + inPoint.connections.Add(connection); + nodes[parentIndex].outPoint.connections.Add(connection); + connections.Add(connection); + } + + if (behaviorElements[i].Depth <= parentDepth) + break; + } + } + return connections; + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/UIETreeLoader.cs.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/UIETreeLoader.cs.meta new file mode 100644 index 0000000..3f5d4c3 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/UIETreeLoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e0c6c40390621ce4e8a890266d819ef2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Util.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Util.meta new file mode 100644 index 0000000..b90cfa2 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Util.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 729c4c770682b1f4e994fdb8db1fd891 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Util/UIETreeValidator.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Util/UIETreeValidator.cs new file mode 100644 index 0000000..5aec971 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Util/UIETreeValidator.cs @@ -0,0 +1,61 @@ +using Assets.Visual_Behavior_Tree.Editor.NodeEditor; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Util +{ + public class UIETreeValidator + { + private List checkNodes; + + public UIETreeValidator() + {} + + public bool IsValidTreeByNodes(List nodes) + { + checkNodes = nodes; + return HasExactlyOneRootNode() && NoChildHasTwoParents(); + } + + private bool HasExactlyOneRootNode() + { + var rootNodes = checkNodes.FindAll(node => node.inPoint.connections.Count() == 0); + + if(rootNodes.Count > 1) + { + Debug.LogError("Behavior Tree Is INVALID! You cannot have more than one root node (node with no parent connections)! Check highlighted nodes."); + HighlightErrorNodes(rootNodes); + return false; + } + + return true; + } + + private bool NoChildHasTwoParents() + { + var errorChildNodes = checkNodes.FindAll(node => node.inPoint.connections.Count() > 1); + + if(errorChildNodes.Count > 0) + { + Debug.LogError("Behavior Tree Is INVALID! You cannot have more than one parent node for a child! Check Highlighted nodes."); + + HighlightErrorNodes(errorChildNodes); + return false; + } + + return true; + } + + private void HighlightErrorNodes(List errorNodes) + { + foreach(var node in errorNodes) + { + node.AddToClassList("Error"); + } + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Util/UIETreeValidator.cs.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Util/UIETreeValidator.cs.meta new file mode 100644 index 0000000..6352c9e --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Util/UIETreeValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ef808d8f0180bc84880d5948a96c987d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Examples/New Behavior Tree2.asset b/Assets/Visual Behavior Tree/Examples/New Behavior Tree2.asset index 2c5b718..73109d2 100644 --- a/Assets/Visual Behavior Tree/Examples/New Behavior Tree2.asset +++ b/Assets/Visual Behavior Tree/Examples/New Behavior Tree2.asset @@ -14,11 +14,19 @@ MonoBehaviour: m_EditorClassIdentifier: positions: - serializedVersion: 2 - x: 355 - y: 158 + x: 175 + y: 92 width: 200 height: 150 - treeElements: "[\r\n {\r\n \"debugOutText\": \"AWOO\",\r\n \"ElementType\": - \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n \"HasChildren\": false,\r\n - \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n \"Depth\": -1,\r\n \"name\": - \"\",\r\n \"hideFlags\": 0\r\n }\r\n]" + - serializedVersion: 2 + x: 160 + y: 277 + width: 200 + height: 150 + treeElements: "[\r\n {\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Sequencer\",\r\n + \"HasChildren\": true,\r\n \"Name\": \"Sequencer\",\r\n \"ID\": 0,\r\n + \"Depth\": -1,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"TimeBetweenChecks\": 100,\r\n \"destReachedThreshold\": 1.0,\r\n \"ElementType\": + \"Assets.Visual_Behavior_Tree.Scripts.AI.Nodes.MoveToNode\",\r\n \"HasChildren\": + false,\r\n \"Name\": \"MoveToNode\",\r\n \"ID\": 0,\r\n \"Depth\": 0,\r\n + \"name\": \"\",\r\n \"hideFlags\": 0\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/New Behavior Tree3.asset b/Assets/Visual Behavior Tree/Examples/New Behavior Tree3.asset index 788c050..1a439bf 100644 --- a/Assets/Visual Behavior Tree/Examples/New Behavior Tree3.asset +++ b/Assets/Visual Behavior Tree/Examples/New Behavior Tree3.asset @@ -14,39 +14,39 @@ MonoBehaviour: m_EditorClassIdentifier: positions: - serializedVersion: 2 - x: -156 - y: 88 + x: 142 + y: 97 width: 200 height: 150 - serializedVersion: 2 - x: 85 - y: 190 + x: 141 + y: 286 width: 200 height: 150 - serializedVersion: 2 - x: 325 - y: 192 + x: 138 + y: 457 width: 200 height: 150 - serializedVersion: 2 - x: 83 - y: 38 + x: -79 + y: 292 width: 200 height: 150 - serializedVersion: 2 - x: 86 - y: 348 + x: 352 + y: 277 width: 200 height: 150 - serializedVersion: 2 - x: 311 - y: 346 + x: 353 + y: 446 width: 200 height: 150 - serializedVersion: 2 - x: 539 - y: 350 - width: 200 + x: 352 + y: 614 + width: 250 height: 150 treeElements: "[\r\n {\r\n \"SucceedPercent\": 100.0,\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Merge\",\r\n \"HasChildren\": true,\r\n @@ -54,10 +54,10 @@ MonoBehaviour: \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Selector\",\r\n \"HasChildren\": true,\r\n \"Name\": \"Selector\",\r\n \"ID\": 0,\r\n \"Depth\": 0,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n - \"debugOutText\": \"SELECT AWOO\",\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n + \"logMessage\": \"MEOW\",\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n \"Depth\": 1,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n - \"debugOutText\": \"AWOO\",\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n + \"logMessage\": \"AWOO\",\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n \"Depth\": 0,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"ElementType\": \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"HasChildren\": @@ -65,7 +65,7 @@ MonoBehaviour: \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"ElementType\": \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"HasChildren\": true,\r\n \"Name\": \"Inverter\",\r\n \"ID\": 0,\r\n \"Depth\": 1,\r\n \"name\": - \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"debugOutText\": \"ALSO - AWOO\",\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n - \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n - \"Depth\": 2,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n }\r\n]" + \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"logMessage\": \"WOOF\",\r\n + \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n \"HasChildren\": + false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n \"Depth\": + 2,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/New Behavior Tree4.asset b/Assets/Visual Behavior Tree/Examples/New Behavior Tree4.asset new file mode 100644 index 0000000..43368e7 --- /dev/null +++ b/Assets/Visual Behavior Tree/Examples/New Behavior Tree4.asset @@ -0,0 +1,87 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7130206f8e2d7e4b94035cb63f37007, type: 3} + m_Name: New Behavior Tree4 + m_EditorClassIdentifier: + positions: + - serializedVersion: 2 + x: 424 + y: 38 + width: 200 + height: 100 + - serializedVersion: 2 + x: 439 + y: 218 + width: 200 + height: 100 + - serializedVersion: 2 + x: 339 + y: 389 + width: 200 + height: 100 + - serializedVersion: 2 + x: 547 + y: 390 + width: 200 + height: 100 + - serializedVersion: 2 + x: 215 + y: 219 + width: 200 + height: 100 + - serializedVersion: 2 + x: 783 + y: 211 + width: 200 + height: 100 + - serializedVersion: 2 + x: 787 + y: 394 + width: 200 + height: 100 + - serializedVersion: 2 + x: 882 + y: 560 + width: 200 + height: 100 + - serializedVersion: 2 + x: 658 + y: 557 + width: 200 + height: 100 + treeElements: "[\r\n {\r\n \"SucceedPercent\": 100.0,\r\n \"ElementType\": + \"Assets.Scripts.AI.Components.Merge\",\r\n \"HasChildren\": true,\r\n + \"Name\": \"Merge\",\r\n \"ID\": 0,\r\n \"Depth\": -1,\r\n \"name\": + \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"ElementType\": \"Assets.Scripts.AI.Components.Selector\",\r\n + \"HasChildren\": true,\r\n \"Name\": \"Selector\",\r\n \"ID\": 0,\r\n + \"Depth\": 0,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"logMessage\": \"MEOW\",\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n + \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n + \"Depth\": 1,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"logMessage\": null,\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n + \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n + \"Depth\": 1,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"logMessage\": \"AWOO\",\r\n \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n + \"HasChildren\": false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n + \"Depth\": 0,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n + \"ElementType\": \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"HasChildren\": + true,\r\n \"Name\": \"Inverter\",\r\n \"ID\": 0,\r\n \"Depth\": 0,\r\n + \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"ElementType\": + \"Assets.Scripts.AI.Decorators.Inverter\",\r\n \"HasChildren\": true,\r\n + \"Name\": \"Inverter\",\r\n \"ID\": 0,\r\n \"Depth\": 1,\r\n \"name\": + \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"logMessage\": \"WOOF\",\r\n + \"ElementType\": \"Assets.Scripts.AI.Nodes.DebugOutNode\",\r\n \"HasChildren\": + false,\r\n \"Name\": \"DebugOutNode\",\r\n \"ID\": 0,\r\n \"Depth\": + 2,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n },\r\n {\r\n \"TimeBetweenChecks\": + 1,\r\n \"destReachedThreshold\": 0.9,\r\n \"ElementType\": \"Assets.Visual_Behavior_Tree.Scripts.AI.Nodes.MoveToNode\",\r\n + \"HasChildren\": false,\r\n \"Name\": \"MoveToNode\",\r\n \"ID\": 0,\r\n + \"Depth\": 2,\r\n \"name\": \"\",\r\n \"hideFlags\": 0\r\n }\r\n]" diff --git a/Assets/Visual Behavior Tree/Examples/New Behavior Tree4.asset.meta b/Assets/Visual Behavior Tree/Examples/New Behavior Tree4.asset.meta new file mode 100644 index 0000000..e6308e4 --- /dev/null +++ b/Assets/Visual Behavior Tree/Examples/New Behavior Tree4.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 929d34fef6e917149a62ff1ce542f139 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Examples/New TreeNodeAsset.asset b/Assets/Visual Behavior Tree/Examples/New TreeNodeAsset.asset new file mode 100644 index 0000000..ce7f006 --- /dev/null +++ b/Assets/Visual Behavior Tree/Examples/New TreeNodeAsset.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7130206f8e2d7e4b94035cb63f37007, type: 3} + m_Name: New TreeNodeAsset + m_EditorClassIdentifier: + positions: [] + treeElements: diff --git a/Assets/Visual Behavior Tree/Examples/New TreeNodeAsset.asset.meta b/Assets/Visual Behavior Tree/Examples/New TreeNodeAsset.asset.meta new file mode 100644 index 0000000..c632618 --- /dev/null +++ b/Assets/Visual Behavior Tree/Examples/New TreeNodeAsset.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7083560d1ec540b41bd7c836a68af18d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Logs/Packages-Update.log b/Logs/Packages-Update.log index 3107af9..d3c7dcc 100644 --- a/Logs/Packages-Update.log +++ b/Logs/Packages-Update.log @@ -1,81 +1,102 @@ - -=== Wed Nov 28 00:11:43 2018 - -Packages were changed. -Update Mode: updateDependencies - -The following packages were added: - com.unity.collab-proxy@1.2.9 - com.unity.xr.legacyinputhelpers@1.0.0 -The following packages were updated: - com.unity.analytics from version 2.0.16 to 3.2.2 - com.unity.package-manager-ui from version 1.9.11 to 2.1.0-preview.1 - com.unity.textmeshpro from version 1.2.4 to 1.3.0 - -=== Wed Dec 19 22:16:38 2018 - -Packages were changed. -Update Mode: updateDependencies - -The following packages were added: - com.unity.collab-proxy@1.2.15 -The following packages were updated: - com.unity.analytics from version 2.0.16 to 3.2.2 - com.unity.package-manager-ui from version 1.9.11 to 2.0.3 - -=== Thu Mar 21 17:20:29 2019 - -Packages were changed. -Update Mode: updateDependencies - -The following packages were updated: - com.unity.package-manager-ui from version 2.0.3 to 2.0.7 - -=== Thu Jun 20 19:43:55 2019 - -Packages were changed. -Update Mode: updateDependencies - -The following packages were added: - com.unity.2d.tilemap@1.0.0 - com.unity.ext.nunit@1.0.0 - com.unity.test-framework@1.0.13 - com.unity.timeline@1.1.0 - com.unity.2d.sprite@1.0.0 - com.unity.ide.vscode@1.0.7 - com.unity.ide.visualstudio@1.0.11 - com.unity.ide.rider@1.0.8 - com.unity.ugui@1.0.0 - com.unity.modules.androidjni@1.0.0 - com.unity.multiplayer-hlapi@1.0.2 - com.unity.xr.legacyinputhelpers@2.0.2 -The following packages were updated: - com.unity.analytics from version 3.2.2 to 3.3.2 - com.unity.collab-proxy from version 1.2.15 to 1.2.16 - com.unity.textmeshpro from version 1.3.0 to 2.0.1 -The following packages were removed: - com.unity.package-manager-ui@2.0.7 - -=== Tue Jan 21 18:39:11 2020 - -Packages were changed. -Update Mode: updateDependencies - -The following packages were updated: - com.unity.analytics from version 3.3.2 to 3.3.4 - com.unity.ide.rider from version 1.0.8 to 1.1.4 - com.unity.ide.vscode from version 1.0.7 to 1.1.3 - com.unity.test-framework from version 1.0.14 to 1.1.9 - com.unity.timeline from version 1.1.0 to 1.2.9 - -=== Sun Jan 26 20:20:22 2020 - -Packages were changed. -Update Mode: updateDependencies - -The following packages were updated: - com.unity.collab-proxy from version 1.2.16 to 1.3.5 - com.unity.ide.rider from version 1.1.4 to 1.2.1 - com.unity.ide.visualstudio from version 1.0.11 to 2.0.0 - com.unity.ide.vscode from version 1.1.3 to 1.1.4 - com.unity.textmeshpro from version 2.0.1 to 3.0.0-preview.1 + +=== Wed Nov 28 00:11:43 2018 + +Packages were changed. +Update Mode: updateDependencies + +The following packages were added: + com.unity.collab-proxy@1.2.9 + com.unity.xr.legacyinputhelpers@1.0.0 +The following packages were updated: + com.unity.analytics from version 2.0.16 to 3.2.2 + com.unity.package-manager-ui from version 1.9.11 to 2.1.0-preview.1 + com.unity.textmeshpro from version 1.2.4 to 1.3.0 + +=== Wed Dec 19 22:16:38 2018 + +Packages were changed. +Update Mode: updateDependencies + +The following packages were added: + com.unity.collab-proxy@1.2.15 +The following packages were updated: + com.unity.analytics from version 2.0.16 to 3.2.2 + com.unity.package-manager-ui from version 1.9.11 to 2.0.3 + +=== Thu Mar 21 17:20:29 2019 + +Packages were changed. +Update Mode: updateDependencies + +The following packages were updated: + com.unity.package-manager-ui from version 2.0.3 to 2.0.7 + +=== Thu Jun 20 19:43:55 2019 + +Packages were changed. +Update Mode: updateDependencies + +The following packages were added: + com.unity.2d.tilemap@1.0.0 + com.unity.ext.nunit@1.0.0 + com.unity.test-framework@1.0.13 + com.unity.timeline@1.1.0 + com.unity.2d.sprite@1.0.0 + com.unity.ide.vscode@1.0.7 + com.unity.ide.visualstudio@1.0.11 + com.unity.ide.rider@1.0.8 + com.unity.ugui@1.0.0 + com.unity.modules.androidjni@1.0.0 + com.unity.multiplayer-hlapi@1.0.2 + com.unity.xr.legacyinputhelpers@2.0.2 +The following packages were updated: + com.unity.analytics from version 3.2.2 to 3.3.2 + com.unity.collab-proxy from version 1.2.15 to 1.2.16 + com.unity.textmeshpro from version 1.3.0 to 2.0.1 +The following packages were removed: + com.unity.package-manager-ui@2.0.7 + +=== Tue Jan 21 18:39:11 2020 + +Packages were changed. +Update Mode: updateDependencies + +The following packages were updated: + com.unity.analytics from version 3.3.2 to 3.3.4 + com.unity.ide.rider from version 1.0.8 to 1.1.4 + com.unity.ide.vscode from version 1.0.7 to 1.1.3 + com.unity.test-framework from version 1.0.14 to 1.1.9 + com.unity.timeline from version 1.1.0 to 1.2.9 + +=== Sun Jan 26 20:20:22 2020 + +Packages were changed. +Update Mode: updateDependencies + +The following packages were updated: + com.unity.collab-proxy from version 1.2.16 to 1.3.5 + com.unity.ide.rider from version 1.1.4 to 1.2.1 + com.unity.ide.visualstudio from version 1.0.11 to 2.0.0 + com.unity.ide.vscode from version 1.1.3 to 1.1.4 + com.unity.textmeshpro from version 2.0.1 to 3.0.0-preview.1 + +=== Thu Jun 4 12:35:08 2020 + +Packages were changed. +Update Mode: updateDependencies + +The following packages were updated: + com.unity.analytics from version 3.3.4 to 3.3.5 + com.unity.collab-proxy from version 1.3.5 to 1.3.7 + com.unity.ide.visualstudio from version 2.0.0 to 2.0.1 + com.unity.ide.vscode from version 1.1.4 to 1.2.0 + com.unity.test-framework from version 1.1.9 to 1.1.14 + com.unity.xr.legacyinputhelpers from version 2.0.2 to 2.1.4 + +=== Thu Jul 2 17:49:06 2020 + +Packages were changed. +Update Mode: updateDependencies + +The following packages were updated: + com.unity.ide.vscode from version 1.2.0 to 1.2.1 diff --git a/Packages/manifest.json b/Packages/manifest.json index ea55305..5389673 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -2,18 +2,18 @@ "dependencies": { "com.unity.2d.sprite": "1.0.0", "com.unity.2d.tilemap": "1.0.0", - "com.unity.analytics": "3.3.4", - "com.unity.collab-proxy": "1.3.5", + "com.unity.analytics": "3.3.5", + "com.unity.collab-proxy": "1.3.7", "com.unity.ext.nunit": "1.0.0", "com.unity.ide.rider": "1.2.1", - "com.unity.ide.visualstudio": "2.0.0", - "com.unity.ide.vscode": "1.1.4", + "com.unity.ide.visualstudio": "2.0.1", + "com.unity.ide.vscode": "1.2.1", "com.unity.multiplayer-hlapi": "1.0.4", - "com.unity.test-framework": "1.1.9", + "com.unity.test-framework": "1.1.14", "com.unity.textmeshpro": "3.0.0-preview.1", "com.unity.timeline": "1.2.9", "com.unity.ugui": "1.0.0", - "com.unity.xr.legacyinputhelpers": "2.0.2", + "com.unity.xr.legacyinputhelpers": "2.1.4", "nuget.mono-cecil": "0.1.6-preview", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json new file mode 100644 index 0000000..e3dd21c --- /dev/null +++ b/Packages/packages-lock.json @@ -0,0 +1,374 @@ +{ + "dependencies": { + "com.unity.2d.sprite": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.2d.tilemap": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.analytics": { + "version": "3.3.5", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.collab-proxy": { + "version": "1.3.7", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.ext.nunit": { + "version": "1.0.0", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.ide.rider": { + "version": "1.2.1", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.1" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ide.visualstudio": { + "version": "2.0.1", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.ide.vscode": { + "version": "1.2.1", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.multiplayer-hlapi": { + "version": "1.0.4", + "depth": 0, + "source": "registry", + "dependencies": { + "nuget.mono-cecil": "0.1.5-preview" + }, + "url": "https://packages.unity.com" + }, + "com.unity.test-framework": { + "version": "1.1.14", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.textmeshpro": { + "version": "3.0.0-preview.1", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.timeline": { + "version": "1.2.9", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.ugui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0" + } + }, + "com.unity.xr.legacyinputhelpers": { + "version": "2.1.4", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "nuget.mono-cecil": { + "version": "0.1.6-preview", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.modules.ai": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.androidjni": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.animation": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.assetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.audio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.cloth": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.director": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.animation": "1.0.0" + } + }, + "com.unity.modules.imageconversion": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.imgui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.jsonserialize": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.particlesystem": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics2d": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.screencapture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.subsystems": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.terrain": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.terrainphysics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.terrain": "1.0.0" + } + }, + "com.unity.modules.tilemap": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics2d": "1.0.0" + } + }, + "com.unity.modules.ui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.uielements": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.uielementsnative": "1.0.0" + } + }, + "com.unity.modules.uielementsnative": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.umbra": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unityanalytics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.unitywebrequest": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unitywebrequestassetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestaudio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.audio": "1.0.0" + } + }, + "com.unity.modules.unitywebrequesttexture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestwww": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.vehicles": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.video": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.vr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } + }, + "com.unity.modules.wind": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.xr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.subsystems": "1.0.0" + } + } + } +} diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index fc223cd..24bbd57 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2020.1.0a20 -m_EditorVersionWithRevision: 2020.1.0a20 (019325219793) +m_EditorVersion: 2020.1.0b14 +m_EditorVersionWithRevision: 2020.1.0b14 (69bacbd35688) diff --git a/UIElementsSchema/UIElements.xsd b/UIElementsSchema/UIElements.xsd index dece5b9..ee11fba 100644 --- a/UIElementsSchema/UIElements.xsd +++ b/UIElementsSchema/UIElements.xsd @@ -1,6 +1,10 @@ - - - - - + + + + + + + + + \ No newline at end of file diff --git a/UIElementsSchema/Unity.Cloud.Collaborate.Components.ChangeListEntries.xsd b/UIElementsSchema/Unity.Cloud.Collaborate.Components.ChangeListEntries.xsd new file mode 100644 index 0000000..479e02d --- /dev/null +++ b/UIElementsSchema/Unity.Cloud.Collaborate.Components.ChangeListEntries.xsd @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/UIElementsSchema/Unity.Cloud.Collaborate.Components.xsd b/UIElementsSchema/Unity.Cloud.Collaborate.Components.xsd new file mode 100644 index 0000000..713b4f5 --- /dev/null +++ b/UIElementsSchema/Unity.Cloud.Collaborate.Components.xsd @@ -0,0 +1,309 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/UIElementsSchema/Unity.Cloud.Collaborate.Views.xsd b/UIElementsSchema/Unity.Cloud.Collaborate.Views.xsd new file mode 100644 index 0000000..f849cd1 --- /dev/null +++ b/UIElementsSchema/Unity.Cloud.Collaborate.Views.xsd @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/UIElementsSchema/UnityEditor.PackageManager.UI.xsd b/UIElementsSchema/UnityEditor.PackageManager.UI.xsd index 99da975..bd63cb8 100644 --- a/UIElementsSchema/UnityEditor.PackageManager.UI.xsd +++ b/UIElementsSchema/UnityEditor.PackageManager.UI.xsd @@ -1,154 +1,313 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/UIElementsSchema/UnityEditor.UIElements.Debugger.xsd b/UIElementsSchema/UnityEditor.UIElements.Debugger.xsd new file mode 100644 index 0000000..7a4e702 --- /dev/null +++ b/UIElementsSchema/UnityEditor.UIElements.Debugger.xsd @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/UIElementsSchema/UnityEditor.UIElements.xsd b/UIElementsSchema/UnityEditor.UIElements.xsd new file mode 100644 index 0000000..3ec711a --- /dev/null +++ b/UIElementsSchema/UnityEditor.UIElements.xsd @@ -0,0 +1,887 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/UIElementsSchema/UnityEngine.UIElements.xsd b/UIElementsSchema/UnityEngine.UIElements.xsd new file mode 100644 index 0000000..9fd6ece --- /dev/null +++ b/UIElementsSchema/UnityEngine.UIElements.xsd @@ -0,0 +1,636 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stuff b/stuff deleted file mode 100644 index 4ddfd60..0000000 --- a/stuff +++ /dev/null @@ -1,31 +0,0 @@ -[ - { - "SucceedPercentToSucceed": 0.0, - "ElementType": "Assets.Scripts.AI.Components.Merge", - "HasChildren": true, - "Name": "Merge", - "ID": 0, - "Depth": -1, - "name": "", - "hideFlags": 0 - }, - { - "debugOutText": null, - "ElementType": "Assets.Scripts.AI.Nodes.DebugOutNode", - "HasChildren": false, - "Name": "DebugOutNode", - "ID": 0, - "Depth": 0, - "name": "", - "hideFlags": 0 - }, - { - "ElementType": "Assets.Scripts.AI.Decorators.Inverter", - "HasChildren": false, - "Name": "Inverter", - "ID": 0, - "Depth": 0, - "name": "", - "hideFlags": 0 - } -] \ No newline at end of file From 2ef21af5ab9d31b3540f18df8dea23268d5ae665 Mon Sep 17 00:00:00 2001 From: Pooka The Wolf Date: Fri, 3 Jul 2020 17:23:13 -0700 Subject: [PATCH 11/16] change menu to Testing/ --- .../Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs index b61bad6..73f132a 100644 --- a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs @@ -20,7 +20,7 @@ public class BehaviorEditorWindow : EditorWindow private ConnectionPoint selectedInPoint; private ConnectionPoint selectedOutPoint; - [MenuItem("Testies/Behavior Editor Window")] + [MenuItem("Testing/Behavior Editor Window")] public static void ShowExample() { BehaviorEditorWindow wnd = GetWindow(); From 10e18be339e64f6cd390e91dc3aab06c11623816 Mon Sep 17 00:00:00 2001 From: Pooka The Wolf Date: Wed, 8 Jul 2020 15:05:26 -0700 Subject: [PATCH 12/16] saver works for UI Toolkit editor --- Assets/Scripts/AI/Tree/TreeElement.cs | 3 +- .../Visual Behavior Tree/Editor/TreeSaver.cs | 10 ++- .../UIENodeEditor/Connection/Connection.cs | 6 +- .../Editor Window/BehaviorEditorWindow.cs | 21 +++--- .../Editor Window/BehaviorEditorWindow.uss | 1 + .../Editor/UIENodeEditor/Node/EditorNode.cs | 66 +++++++------------ .../Editor/UIENodeEditor/UIETreeLoader.cs | 8 ++- .../Examples/New Behavior Tree4.asset | 36 +++++----- 8 files changed, 66 insertions(+), 85 deletions(-) diff --git a/Assets/Scripts/AI/Tree/TreeElement.cs b/Assets/Scripts/AI/Tree/TreeElement.cs index 5a0e088..09cdc5c 100644 --- a/Assets/Scripts/AI/Tree/TreeElement.cs +++ b/Assets/Scripts/AI/Tree/TreeElement.cs @@ -46,8 +46,7 @@ public int ID public int Depth { get => _Depth; set => _Depth = value; } public TreeElement () - { - } + {} public TreeElement (string name, int depth, int id) { diff --git a/Assets/Visual Behavior Tree/Editor/TreeSaver.cs b/Assets/Visual Behavior Tree/Editor/TreeSaver.cs index 2b962bb..40a2fd0 100644 --- a/Assets/Visual Behavior Tree/Editor/TreeSaver.cs +++ b/Assets/Visual Behavior Tree/Editor/TreeSaver.cs @@ -59,19 +59,17 @@ public void SaveTree(List nodes, string path) { EditorNode rootNode = nodes.Find(node => node.inPoint.connections.Count == 0); - Debug.Log(rootNode.TreeElement.Name); - rootNode.TreeElement.Depth = -1; - positions = new List(); - positions.Add(rootNode.layout); + positions = new List + { + rootNode.layout + }; RecursiveAddChildren(rootNode); var json = GetJsonSaveDataFromRoot(rootNode.TreeElement); - Debug.Log(json); - SaveAssetToDatabase(path, positions, json); } diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs index b3adb73..f504e9f 100644 --- a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs @@ -15,15 +15,15 @@ public class Connection : VisualElement public ConnectionPoint outPoint; public Action OnClickRemoveConnection; - Button removeButton; + readonly Button removeButton; public float lineWidth = 3; - public Connection(ConnectionPoint inPoint, ConnectionPoint outPoint, Action OnClickRemoveConnection) + public Connection(ConnectionPoint inPoint, ConnectionPoint outPoint, Action onClickRemoveConnection) { this.inPoint = inPoint; this.outPoint = outPoint; - this.OnClickRemoveConnection = OnClickRemoveConnection; + this.OnClickRemoveConnection = onClickRemoveConnection; this.AddToClassList("Connection"); diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs index 73f132a..4716e92 100644 --- a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs @@ -31,7 +31,6 @@ public void OnEnable() { VisualElement root = rootVisualElement; - // Import UXML var visualTree = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uxml"); VisualElement uxmlRoot = visualTree.CloneTree(); @@ -48,8 +47,6 @@ public void OnEnable() var loadButton = (Button)rootVisualElement.Q("LoadButton"); loadButton.clicked += LoadNodesFromFile; - // A stylesheet can be added to a VisualElement. - // The style will be applied to the VisualElement and all of its children. var styleSheet = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss"); root.styleSheets.Add(styleSheet); @@ -87,12 +84,13 @@ where type.Name.Contains(selectedName) treeElement.Name = selectedName; treeElement.ElementType = typeName.First().ToString(); - EditorNode item = new EditorNode(treeElement, action.eventInfo.localMousePosition, OnClickInPoint, OnClickOutPoint, OnClickRemoveNode); + EditorNode item = new EditorNode(treeElement, action.eventInfo.localMousePosition, OnClickInPoint, OnClickOutPoint, OnClickAddNode, OnClickRemoveNode); OnClickAddNode(item); } void OnClickAddNode(EditorNode node) { + Debug.Log("Adding " + node.TreeElement.Name); nodes.Add(node); rootVisualElement.Q("GridContainer").Add(node); } @@ -201,7 +199,7 @@ protected void LoadNodesFromFile() UIETreeLoader loader = new UIETreeLoader(); var root = loader.LoadFromAsset(path); - nodes = loader.GetNodes(OnClickInPoint, OnClickOutPoint, OnClickRemoveNode); + nodes = loader.GetNodes(OnClickInPoint, OnClickOutPoint, OnClickAddNode, OnClickRemoveNode); connections = loader.GetConnectionsFromRoot(root, OnClickRemoveConnection); foreach(var node in nodes) @@ -223,6 +221,8 @@ private bool IsValidTree() private void OnClickRemoveNode(EditorNode node) { + Debug.Log("Removing " + node.TreeElement.Name); + var container = rootVisualElement.Q("GridContainer"); if (connections != null) { List connectionsToRemove = new List(); @@ -238,24 +238,21 @@ private void OnClickRemoveNode(EditorNode node) for (int i = 0; i < connectionsToRemove.Count; i++) { var connection = connectionsToRemove[i]; - connections.Remove(connection); + if (connection.inPoint.connections.Contains(connection)) { connection.inPoint.connections.Remove(connection); - rootVisualElement.Q("GridContainer").Remove(connection); - } if (connection.outPoint.connections.Contains(connection)) { connection.outPoint.connections.Remove(connection); - rootVisualElement.Q("GridContainer").Remove(connection); } + connections.Remove(connection); + container.Remove(connection); } - - connectionsToRemove = null; } - + container.Remove(node); nodes.Remove(node); } diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss index 48bf493..a09be80 100644 --- a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss @@ -23,4 +23,5 @@ background-color: rgba(242, 246, 250,1); width: auto; height: auto; + overflow: hidden; } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs index 74e76c7..a4378c4 100644 --- a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs @@ -23,7 +23,10 @@ public class EditorNode : Box public ConnectionPoint inPoint; public ConnectionPoint outPoint; - public EditorNode(BehaviorTreeElement wrappedElement, Vector2 position, Action OnClickInPoint, Action OnClickOutPoint, Action OnClickRemoveNode) + private Action OnClickAddNode; + private Action OnClickRemoveNode; + + public EditorNode(BehaviorTreeElement wrappedElement, Vector2 position, Action onClickInPoint, Action onClickOutPoint, Action onClickAddNode, Action onClickRemoveNode) { var styleSheet = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uss"); this.styleSheets.Add(styleSheet); @@ -33,11 +36,11 @@ public EditorNode(BehaviorTreeElement wrappedElement, Vector2 position, Action("ParentConnectorContainer"); - inPoint = new ConnectionPoint(this, ConnectionPointType.In, OnClickInPoint); + inPoint = new ConnectionPoint(this, ConnectionPointType.In, onClickInPoint); inPoint.AddToClassList("NodeButton"); parentContainer.Insert(1,inPoint); - outPoint = new ConnectionPoint(this, ConnectionPointType.Out, OnClickOutPoint); + outPoint = new ConnectionPoint(this, ConnectionPointType.Out, onClickOutPoint); this.AddToClassList("EditorNode"); @@ -51,6 +54,9 @@ public EditorNode(BehaviorTreeElement wrappedElement, Vector2 position, Action("NodeContainer"); - foreach(var child in nodeContainer.Children()) - { - Debug.Log("Removing 1 element"); - nodeContainer.Remove(child); - } + + nodeContainer.Clear(); foreach (var element in GetAllPropertyFields()) { - Debug.Log("Adding one"); nodeContainer.Add(element); element.Bind(ElementObject); } var childContainer = this.Q("ChildrenConnectorContainer"); + + if (childContainer.Contains(outPoint)) childContainer.Remove(outPoint); + if (this.TreeElement.CanHaveChildren) { outPoint.AddToClassList("NodeButton"); childContainer.Add(outPoint); } - else if(childContainer.Contains(outPoint)) - { - Debug.Log("Removing connections"); - var connections = outPoint.connections; - List connectionsToRemove = new List(); - - for (int i = 0; i < connections.Count; i++) - { - if (connections[i].inPoint.Equals(this.inPoint) || connections[i].outPoint.Equals(this.outPoint)) - { - connectionsToRemove.Add(connections[i]); - } - } - - for (int i = 0; i < connectionsToRemove.Count; i++) - { - var connection = connectionsToRemove[i]; - connections.Remove(connection); - if (connection.inPoint.connections.Contains(connection)) - { - connection.inPoint.connections.Remove(connection); - } - - if (connection.outPoint.connections.Contains(connection)) - { - connection.outPoint.connections.Remove(connection); - } - } - childContainer.Remove(outPoint); - } } public List GetAllPropertyFields() diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/UIETreeLoader.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/UIETreeLoader.cs index 23279f4..390c6c4 100644 --- a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/UIETreeLoader.cs +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/UIETreeLoader.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Reflection; using UnityEditor; +using UnityEngine; namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor { @@ -32,7 +33,8 @@ public BehaviorTreeElement LoadFromAsset(string path) { string typeName = el.ElementType; Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(typeName); - dynamic newBehavior = Activator.CreateInstance(type, (string)el.Name, (int)el.Depth, (int)el.ID); + //dynamic newBehavior = Activator.CreateInstance(type, (string)el.Name, (int)el.Depth, (int)el.ID); + dynamic newBehavior = ScriptableObject.CreateInstance(type); JsonConvert.PopulateObject(JsonConvert.SerializeObject(el), newBehavior); behaviorElements.Add(newBehavior); } @@ -40,14 +42,14 @@ public BehaviorTreeElement LoadFromAsset(string path) return root; } - public List GetNodes(Action OnClickInPoint, Action OnClickOutPoint, Action OnClickRemoveNode) + public List GetNodes(Action onClickInPoint, Action onClickOutPoint, Action onClickAddNode, Action onClickRemoveNode) { nodes = new List(); for(int i = 0; i < behaviorElements.Count; ++i) { var nodeRect = asset.positions[i]; - var newNode = new EditorNode(behaviorElements[i], nodeRect.position, OnClickInPoint, OnClickOutPoint, OnClickRemoveNode); + var newNode = new EditorNode(behaviorElements[i], nodeRect.position, onClickInPoint, onClickOutPoint, onClickAddNode, onClickRemoveNode); nodes.Add(newNode); } diff --git a/Assets/Visual Behavior Tree/Examples/New Behavior Tree4.asset b/Assets/Visual Behavior Tree/Examples/New Behavior Tree4.asset index 43368e7..fe4195c 100644 --- a/Assets/Visual Behavior Tree/Examples/New Behavior Tree4.asset +++ b/Assets/Visual Behavior Tree/Examples/New Behavior Tree4.asset @@ -14,48 +14,48 @@ MonoBehaviour: m_EditorClassIdentifier: positions: - serializedVersion: 2 - x: 424 - y: 38 + x: 301 + y: 48 width: 200 height: 100 - serializedVersion: 2 - x: 439 - y: 218 + x: 316 + y: 228 width: 200 height: 100 - serializedVersion: 2 - x: 339 - y: 389 + x: 216 + y: 399 width: 200 height: 100 - serializedVersion: 2 - x: 547 - y: 390 + x: 424 + y: 400 width: 200 height: 100 - serializedVersion: 2 - x: 215 - y: 219 + x: 92 + y: 229 width: 200 height: 100 - serializedVersion: 2 - x: 783 - y: 211 + x: 644 + y: 212 width: 200 height: 100 - serializedVersion: 2 - x: 787 - y: 394 + x: 647 + y: 397 width: 200 height: 100 - serializedVersion: 2 - x: 882 - y: 560 + x: 778 + y: 558 width: 200 height: 100 - serializedVersion: 2 - x: 658 - y: 557 + x: 563 + y: 559 width: 200 height: 100 treeElements: "[\r\n {\r\n \"SucceedPercent\": 100.0,\r\n \"ElementType\": From 3c5143b667fd2c421edddd9cd24e5564abd20947 Mon Sep 17 00:00:00 2001 From: Pooka The Wolf Date: Sun, 26 Jul 2020 20:58:38 -0700 Subject: [PATCH 13/16] start debugger --- .../Visual Behavior Tree/Editor/BaseEditor.cs | 190 ++--- .../Editor/BaseEditor.cs.meta | 26 +- .../Editor/BehaviorExtensions.cs | 282 ++++---- .../Editor/BehaviorExtensions.cs.meta | 26 +- .../Editor/BehaviorTreeViewEditor.meta | 20 +- .../BehaviorTreeViewEditor/BackendData.meta | 18 +- .../BackendData/MultiColumnBTreeWindow.cs | 524 +++++++------- .../MultiColumnBTreeWindow.cs.meta | 26 +- .../MultiColumnBehaviorTreeView.cs | 670 +++++++++--------- .../MultiColumnBehaviorTreeView.cs.meta | 26 +- .../BackendData/TreeViewWithTreeModel.cs | 496 ++++++------- .../BackendData/TreeViewWithTreeModel.cs.meta | 24 +- .../Editor/BuiltInResourcesWindow.cs | 456 ++++++------ .../Editor/CustomAssetUtitlity.cs | 58 +- .../Editor/CustomAssetUtitlity.cs.meta | 26 +- .../Visual Behavior Tree/Editor/EditorList.cs | 246 +++---- .../Editor/EditorList.cs.meta | 24 +- .../Visual Behavior Tree/Editor/TreeLoader.cs | 178 ++--- .../Visual Behavior Tree/Editor/TreeSaver.cs | 3 - .../Editor/TreeValidator.cs | 128 ++-- .../UIENodeEditor/Connection/Connection.cs | 1 - .../Editor/UIENodeEditor/Debug Window.meta | 8 + .../Debug Window/BehaviorManagerSelector.cs | 34 + .../BehaviorManagerSelector.cs.meta | 11 + .../Debug Window/BehaviorTreeSelector.cs | 42 ++ .../Debug Window/BehaviorTreeSelector.cs.meta | 11 + .../UIENodeEditor/Debug Window/DebugWindow.cs | 139 ++++ .../Debug Window/DebugWindow.cs.meta | 11 + .../Debug Window/DebugWindow.uss | 31 + .../Debug Window/DebugWindow.uss.meta | 11 + .../Debug Window/DebugWindow.uxml | 15 + .../Debug Window/DebugWindow.uxml.meta | 10 + .../Editor Window/BehaviorEditorWindow.cs | 14 +- .../Editor Window/BehaviorEditorWindow.uss | 4 +- .../Manipulators/EditorNodeResizer.cs | 97 +++ .../Manipulators/EditorNodeResizer.cs.meta | 11 + .../Manipulators/EditorNodeSelector.cs | 15 +- .../Editor/UIENodeEditor/Node/EditorNode.cs | 62 +- .../Editor/UIENodeEditor/Node/EditorNode.uss | 27 +- .../Editor/UIENodeEditor/Node/EditorNode.uxml | 9 +- .../UIENodeEditor/Node/EditorResizer.meta | 8 + .../Node/EditorResizer/EditorResizer.cs | 52 ++ .../Node/EditorResizer/EditorResizer.cs.meta | 11 + .../Editor/UIENodeEditor/UIETreeLoader.cs | 34 +- 44 files changed, 2326 insertions(+), 1789 deletions(-) create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorManagerSelector.cs create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorManagerSelector.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorTreeSelector.cs create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorTreeSelector.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.cs create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uss create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uss.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uxml create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uxml.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeResizer.cs create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeResizer.cs.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorResizer.meta create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorResizer/EditorResizer.cs create mode 100644 Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorResizer/EditorResizer.cs.meta diff --git a/Assets/Visual Behavior Tree/Editor/BaseEditor.cs b/Assets/Visual Behavior Tree/Editor/BaseEditor.cs index d6926a8..bbf23d0 100644 --- a/Assets/Visual Behavior Tree/Editor/BaseEditor.cs +++ b/Assets/Visual Behavior Tree/Editor/BaseEditor.cs @@ -1,96 +1,96 @@ -using Assets.Scripts.AI; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Reflection; -using UnityEditor; -using UnityEngine; - -namespace Assets.Editor -{ - public class BaseEditor : UnityEditor.Editor where T : MonoBehaviour - { - T data; - protected virtual void OnEnable() - { - data = (T)serializedObject.targetObject; - } - - public override void OnInspectorGUI() - { - serializedObject.Update(); - - GUIContent label = new GUIContent(); - label.text = "Properties"; - - DrawDefaultInspectors(label, data); - - if (GUI.changed) - { - EditorUtility.SetDirty(target); - } - - serializedObject.ApplyModifiedProperties(); - } - - protected void DrawDefaultInspectors(GUIContent label, T target) - { - EditorGUILayout.Separator(); - Type type = typeof(T); - FieldInfo[] fields = type.GetFields(); - EditorGUI.indentLevel++; - - foreach (FieldInfo field in fields) - { - if (field.IsPublic) - { - if (field.FieldType == typeof(int)) - { - field.SetValue(target, EditorGUILayout.IntField( - MakeLabel(field), (int)field.GetValue(target))); - } - else if (field.FieldType == typeof(float)) - { - field.SetValue(target, EditorGUILayout.FloatField( - MakeLabel(field), (float)field.GetValue(target))); - } - else if(field.FieldType == typeof(GameObject[])) - { - var fieldProp = serializedObject.FindProperty(field.Name); - EditorList.Show(fieldProp, EditorListOption.Buttons | EditorListOption.ElementLabels); - } - else if(serializedObject != null) - { - //Debug.Log("Trying to draw: " + field.Name); - EditorGUILayout.PropertyField(serializedObject.FindProperty(field.Name)); - } - else - { - Debug.LogError( - "DrawDefaultInspectors does not support fields of type " + - field.FieldType); - } - } - } - - EditorGUI.indentLevel--; - } - - private static GUIContent MakeLabel(FieldInfo field) - { - GUIContent guiContent = new GUIContent(); - guiContent.text = field.Name; - object[] descriptions = - field.GetCustomAttributes(typeof(DescriptionAttribute), true); - - if (descriptions.Length > 0) - { - //just use the first one. - guiContent.tooltip = - (descriptions[0] as DescriptionAttribute).Description; - } - - return guiContent; - } - } +using Assets.Scripts.AI; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace Assets.Editor +{ + public class BaseEditor : UnityEditor.Editor where T : MonoBehaviour + { + T data; + protected virtual void OnEnable() + { + data = (T)serializedObject.targetObject; + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + GUIContent label = new GUIContent(); + label.text = "Properties"; + + DrawDefaultInspectors(label, data); + + if (GUI.changed) + { + EditorUtility.SetDirty(target); + } + + serializedObject.ApplyModifiedProperties(); + } + + protected void DrawDefaultInspectors(GUIContent label, T target) + { + EditorGUILayout.Separator(); + Type type = typeof(T); + FieldInfo[] fields = type.GetFields(); + EditorGUI.indentLevel++; + + foreach (FieldInfo field in fields) + { + if (field.IsPublic) + { + if (field.FieldType == typeof(int)) + { + field.SetValue(target, EditorGUILayout.IntField( + MakeLabel(field), (int)field.GetValue(target))); + } + else if (field.FieldType == typeof(float)) + { + field.SetValue(target, EditorGUILayout.FloatField( + MakeLabel(field), (float)field.GetValue(target))); + } + else if(field.FieldType == typeof(GameObject[])) + { + var fieldProp = serializedObject.FindProperty(field.Name); + EditorList.Show(fieldProp, EditorListOption.Buttons | EditorListOption.ElementLabels); + } + else if(serializedObject != null) + { + //Debug.Log("Trying to draw: " + field.Name); + EditorGUILayout.PropertyField(serializedObject.FindProperty(field.Name)); + } + else + { + Debug.LogError( + "DrawDefaultInspectors does not support fields of type " + + field.FieldType); + } + } + } + + EditorGUI.indentLevel--; + } + + private static GUIContent MakeLabel(FieldInfo field) + { + GUIContent guiContent = new GUIContent(); + guiContent.text = field.Name; + object[] descriptions = + field.GetCustomAttributes(typeof(DescriptionAttribute), true); + + if (descriptions.Length > 0) + { + //just use the first one. + guiContent.tooltip = + (descriptions[0] as DescriptionAttribute).Description; + } + + return guiContent; + } + } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/BaseEditor.cs.meta b/Assets/Visual Behavior Tree/Editor/BaseEditor.cs.meta index 50e33ab..f3ae85f 100644 --- a/Assets/Visual Behavior Tree/Editor/BaseEditor.cs.meta +++ b/Assets/Visual Behavior Tree/Editor/BaseEditor.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: 0f35796c41cc8eb46b957581083c3fb6 -timeCreated: 1519507240 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 0f35796c41cc8eb46b957581083c3fb6 +timeCreated: 1519507240 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs b/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs index 4465180..e583a06 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs +++ b/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs @@ -1,141 +1,141 @@ -using Assets.Scripts.AI; -using Assets.Scripts.AI.Components; -using Assets.Scripts.AI.Tree; -using Assets.Visual_Behavior_Tree.Scripts; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using UnityEditor; -using UnityEngine; - -namespace Assets.Editor -{ - public static class BehaviorExtensions - { - public static IOrderedEnumerable Order(this IEnumerable source, Func selector, bool ascending) - { - if (ascending) - { - return source.OrderBy(selector); - } - else - { - return source.OrderByDescending(selector); - } - } - - public static IOrderedEnumerable ThenBy(this IOrderedEnumerable source, Func selector, bool ascending) - { - if (ascending) - { - return source.ThenBy(selector); - } - else - { - return source.ThenByDescending(selector); - } - } - - public static void CreateTypeMenu(this GenericMenu menu, GenericMenu.MenuFunction2 func) where T : class - { - foreach (Type type in - Assembly.GetAssembly(typeof(T)).GetTypes() - .Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(T)))) - { - var menuStrings = type.ToString().Split('.'); - menu.AddItem(new GUIContent(menuStrings[menuStrings.Length - 2] + - "/" + menuStrings.Last()), false, func, type.ToString()); - } - } - - public static void CreateManagerMenu(this GenericMenu menu, GenericMenu.MenuFunction2 func) - { - var managers = UnityEngine.Object.FindObjectsOfType(); - foreach (BehaviorManager manager in managers) - { - string menuName = manager.BehaviorLogger.Name; - menu.AddItem(new GUIContent(menuName), false, func, menuName); - } - } - - public static Color GetBehaviorStateColor(this BehaviorState state) - { - switch (state) - { - case BehaviorState.Fail: - return Color.red; - case BehaviorState.Running: - return Color.blue; - case BehaviorState.Success: - return new Color(0.1f, 0.9f, 0.2f); - case BehaviorState.Null: - return Color.grey; - default: - return Color.black; - } - } - - - /// - /// Saves a scriptable object behavior tree and sets the active asset back to the behavior manager - /// - /// - /// - /// - public static void SaveBehaviorAsset(this BehaviorManager behaviorManager, string filePath, - TreeNodeAsset asset, Merge root = null) - { - if (asset == null) - asset = ScriptableObject.CreateInstance(); - - var runnerElementList = new List(); - - Debug.Log("Attempting save at path: " + filePath); - - int indexS = filePath.LastIndexOf("/") + 1; - int indexD = filePath.LastIndexOf(".") - indexS; - - asset.name = filePath.Substring(indexS, indexD); - - var json = asset.treeElements; - - if(behaviorManager != null) - { - behaviorManager.Reinitialize(); - //asset.MilliSecondsBetweenTicks =behaviorManager.MilliSecondsBetweenTicks; - //asset.TimesToTick = behaviorManager.TimesToTick; - - TreeElementUtility.TreeToList(behaviorManager.Runner, runnerElementList); - } - - if(root != null) - { - TreeElementUtility.TreeToList(root, runnerElementList); - } - - if(json == "" || runnerElementList.Count == 0) - { - var runner = new Merge("Extension Root", -1, -1); - runnerElementList.Add(runner); - } - json = JsonConvert.SerializeObject(runnerElementList, Formatting.Indented); - asset.treeElements = json; - - Debug.Log("JSON Saved: " + asset.treeElements); - - var curPath = AssetDatabase.GetAssetPath(asset); - - if(curPath == null || curPath == "") - { - Debug.Log("Creating asset: " + filePath); - AssetDatabase.CreateAsset(asset, filePath); - } - - //AssetDatabase.Refresh(); - EditorUtility.SetDirty(asset); - AssetDatabase.SaveAssets(); - } - } -} +using Assets.Scripts.AI; +using Assets.Scripts.AI.Components; +using Assets.Scripts.AI.Tree; +using Assets.Visual_Behavior_Tree.Scripts; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace Assets.Editor +{ + public static class BehaviorExtensions + { + public static IOrderedEnumerable Order(this IEnumerable source, Func selector, bool ascending) + { + if (ascending) + { + return source.OrderBy(selector); + } + else + { + return source.OrderByDescending(selector); + } + } + + public static IOrderedEnumerable ThenBy(this IOrderedEnumerable source, Func selector, bool ascending) + { + if (ascending) + { + return source.ThenBy(selector); + } + else + { + return source.ThenByDescending(selector); + } + } + + public static void CreateTypeMenu(this GenericMenu menu, GenericMenu.MenuFunction2 func) where T : class + { + foreach (Type type in + Assembly.GetAssembly(typeof(T)).GetTypes() + .Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(T)))) + { + var menuStrings = type.ToString().Split('.'); + menu.AddItem(new GUIContent(menuStrings[menuStrings.Length - 2] + + "/" + menuStrings.Last()), false, func, type.ToString()); + } + } + + public static void CreateManagerMenu(this GenericMenu menu, GenericMenu.MenuFunction2 func) + { + var managers = UnityEngine.Object.FindObjectsOfType(); + foreach (BehaviorManager manager in managers) + { + string menuName = manager.BehaviorLogger.Name; + menu.AddItem(new GUIContent(menuName), false, func, menuName); + } + } + + public static Color GetBehaviorStateColor(this BehaviorState state) + { + switch (state) + { + case BehaviorState.Fail: + return Color.red; + case BehaviorState.Running: + return Color.blue; + case BehaviorState.Success: + return new Color(0.1f, 0.9f, 0.2f); + case BehaviorState.Null: + return Color.grey; + default: + return Color.black; + } + } + + + /// + /// Saves a scriptable object behavior tree and sets the active asset back to the behavior manager + /// + /// + /// + /// + public static void SaveBehaviorAsset(this BehaviorManager behaviorManager, string filePath, + TreeNodeAsset asset, Merge root = null) + { + if (asset == null) + asset = ScriptableObject.CreateInstance(); + + var runnerElementList = new List(); + + Debug.Log("Attempting save at path: " + filePath); + + int indexS = filePath.LastIndexOf("/") + 1; + int indexD = filePath.LastIndexOf(".") - indexS; + + asset.name = filePath.Substring(indexS, indexD); + + var json = asset.treeElements; + + if(behaviorManager != null) + { + behaviorManager.Reinitialize(); + //asset.MilliSecondsBetweenTicks =behaviorManager.MilliSecondsBetweenTicks; + //asset.TimesToTick = behaviorManager.TimesToTick; + + TreeElementUtility.TreeToList(behaviorManager.Runner, runnerElementList); + } + + if(root != null) + { + TreeElementUtility.TreeToList(root, runnerElementList); + } + + if(json == "" || runnerElementList.Count == 0) + { + var runner = new Merge("Extension Root", -1, -1); + runnerElementList.Add(runner); + } + json = JsonConvert.SerializeObject(runnerElementList, Formatting.Indented); + asset.treeElements = json; + + Debug.Log("JSON Saved: " + asset.treeElements); + + var curPath = AssetDatabase.GetAssetPath(asset); + + if(curPath == null || curPath == "") + { + Debug.Log("Creating asset: " + filePath); + AssetDatabase.CreateAsset(asset, filePath); + } + + //AssetDatabase.Refresh(); + EditorUtility.SetDirty(asset); + AssetDatabase.SaveAssets(); + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs.meta b/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs.meta index 613e62a..9524c48 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs.meta +++ b/Assets/Visual Behavior Tree/Editor/BehaviorExtensions.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: 1330b717549e1754396c1479bdd90d07 -timeCreated: 1520483523 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 1330b717549e1754396c1479bdd90d07 +timeCreated: 1520483523 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor.meta b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor.meta index 4d1b84b..71d8b3d 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor.meta +++ b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor.meta @@ -1,10 +1,10 @@ -fileFormatVersion: 2 -guid: 8500cdf61abde6f4d9f00cf5d3c4b012 -folderAsset: yes -timeCreated: 1518939676 -licenseType: Free -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 8500cdf61abde6f4d9f00cf5d3c4b012 +folderAsset: yes +timeCreated: 1518939676 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData.meta b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData.meta index cf20717..ec4f34b 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData.meta +++ b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData.meta @@ -1,9 +1,9 @@ -fileFormatVersion: 2 -guid: 352ae18c571bea34092dc22719650ab6 -folderAsset: yes -timeCreated: 1472023475 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 352ae18c571bea34092dc22719650ab6 +folderAsset: yes +timeCreated: 1472023475 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs index b155505..d6fe118 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs +++ b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs @@ -1,262 +1,262 @@ -using Assets.Scripts.AI; -using Assets.Scripts.AI.Components; -using Assets.Scripts.AI.Tree; -using Assets.Visual_Behavior_Tree.Scripts; -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEditor.Callbacks; -using UnityEditor.IMGUI.Controls; -using UnityEngine; - -namespace Assets.Editor.BehaviorTreeViewEditor.BackendData -{ - class MultiColumnBTreeWindow : EditorWindow - { - [NonSerialized] bool _Initialized; - [SerializeField] TreeViewState _TreeViewState; // Serialized in the window layout file so it survives assembly reloading - [SerializeField] MultiColumnHeaderState _MultiColumnHeaderState; - SearchField _SearchField; - MultiColumnBehaviorTreeView _TreeView; - [SerializeField] TreeNodeAsset _TreeNodeAsset; - - string FilePath = ""; - private static string FileDir = "Assets/Behaviors/"; - - [MenuItem("Behavior Tree/New Tree")] - public static MultiColumnBTreeWindow GetWindow() - { - var window = GetWindow(); - window.titleContent = new GUIContent("Behavior Tree Builder"); - window.Focus(); - window.Repaint(); - return window; - } - - [OnOpenAsset] - public static bool OnOpenAsset(int instanceID, int line) - { - var BTreeAsset = EditorUtility.InstanceIDToObject(instanceID) as TreeNodeAsset; - if (BTreeAsset != null) - { - var window = GetWindow(); - window.SetTreeAsset(BTreeAsset); - return true; - } - return false; // we did not handle the open - } - - public void SetTreeAsset(TreeNodeAsset BehaviorTreeAsset) - { - if(BehaviorTreeAsset == null || BehaviorTreeAsset.treeElements == "") - { - CreateNewTree(); - } - _TreeNodeAsset = BehaviorTreeAsset; - _Initialized = false; - } - - Rect multiColumnTreeViewRect - { - get { return new Rect(20, 50, position.width - 40, position.height - 70); } - } - - Rect toolbarRect - { - get { return new Rect(20f, 10f, position.width - 40f, 20f); } - } - - Rect topToolbarRect - { - get { return new Rect(20f, 30f, position.width - 40f, 30f); } - } - - Rect bottomToolbarRect - { - get { return new Rect(20f, position.height - 18f, position.width - 60f, 16f); } - } - - public MultiColumnBehaviorTreeView treeView - { - get { return _TreeView; } - } - - void InitIfNeeded() - { - if (!_Initialized) - { - // Check if it already exists (deserialized from window layout file or scriptable object) - if (_TreeViewState == null) - _TreeViewState = new TreeViewState(); - - bool firstInit = _MultiColumnHeaderState == null; - var headerState = MultiColumnBehaviorTreeView.CreateDefaultMultiColumnHeaderState(multiColumnTreeViewRect.width); - if (MultiColumnHeaderState.CanOverwriteSerializedFields(_MultiColumnHeaderState, headerState)) - MultiColumnHeaderState.OverwriteSerializedFields(_MultiColumnHeaderState, headerState); - _MultiColumnHeaderState = headerState; - - var multiColumnHeader = new BTreeMultiColumnHeader(headerState); - if (firstInit) - multiColumnHeader.ResizeToFit(); - - var treeModel = new TreeModel(GetData()); - - _TreeView = new MultiColumnBehaviorTreeView(_TreeViewState, multiColumnHeader, treeModel); - - _SearchField = new SearchField(); - _SearchField.downOrUpArrowKeyPressed += _TreeView.SetFocusAndEnsureSelectedItem; - - _Initialized = true; - } - } - - IList GetData() - { - if (_TreeNodeAsset == null) - { - CreateNewTree(); - } - - var treeRoot = _TreeNodeAsset.LoadRoot(); - if(treeRoot == null) - { - treeRoot = new Merge("New Root",-1, -1); - } - var treeList = new List(); - - TreeElementUtility.TreeToList(treeRoot, treeList); - - return treeList; - } - - void CreateNewTree() - { - CustomAssetUtility.CreateAsset(); - _TreeNodeAsset = (TreeNodeAsset)Selection.activeObject; - var root =new Merge("root",-1,-1); - //BehaviorExtensions.SaveBehaviorAsset(null, AssetDatabase.GetAssetPath(_TreeNodeAsset), - // _TreeNodeAsset,(Merge)root); - } - - void OnSelectionChange() - { - if (!_Initialized) - return; - - var BehaviorTreeAsset = Selection.activeObject as TreeNodeAsset; - if (BehaviorTreeAsset != null && BehaviorTreeAsset != _TreeNodeAsset) - { - _TreeNodeAsset = BehaviorTreeAsset; - _TreeView.treeModel.SetData(GetData()); - _TreeView.Reload(); - } - } - - void OnGUI() - { - InitIfNeeded(); - - SearchBar(toolbarRect); - TopToolbar(topToolbarRect); - DoTreeView(multiColumnTreeViewRect); - BottomToolBar(bottomToolbarRect); - } - - void SearchBar(Rect rect) - { - treeView.searchString = _SearchField.OnGUI(rect, treeView.searchString); - } - - void DoTreeView(Rect rect) - { - _TreeView.OnGUI(rect); - } - - void TopToolbar(Rect rect) - { - GUILayout.BeginArea(rect); - - using (new EditorGUILayout.HorizontalScope()) - { - GenericMenu menu = new GenericMenu(); - if (EditorGUILayout.DropdownButton(new GUIContent("Add Behavior"),FocusType.Passive)) - { - menu.CreateTypeMenu(OnTypeSelected); - menu.ShowAsContext(); - } - - if (GUILayout.Button("Remove Behavior")) - { - var selection = _TreeView.GetSelection(); - _TreeView.treeModel.RemoveElements(selection); - } - - FilePath = GUILayout.TextField(FilePath); - if (GUILayout.Button("Save Tree")) - { - FilePath = EditorUtility.SaveFilePanel("", FileDir, "New Behavior Tree", "asset"); - //BehaviorExtensions.SaveBehaviorAsset(null, FilePath, _TreeNodeAsset, (Merge)_TreeView.treeModel.Root); - } - } - - GUILayout.EndArea(); - } - - private void OnTypeSelected(object typeName) - { - var selection = _TreeView.GetSelection(); - BehaviorTreeElement parent = (selection.Count == 1 ? _TreeView.treeModel.Find(selection[0]) : null) ?? _TreeView.treeModel.Root; - int depth = parent != null ? parent.Depth + 1 : 0; - int id = _TreeView.treeModel.GenerateUniqueID(); - - Type type = typeof(BehaviorTreeElement).Assembly.GetType((string)typeName, true); - - dynamic element = Activator.CreateInstance(type, type.ToString().Split('.').Last() + " " + id, depth, id); - element.ElementType = element.GetType().ToString(); - //element.BehaviorTreeManager = parent.BehaviorTreeManager; - _TreeView.treeModel.AddElement(element, parent, 0); - - _TreeView.SetSelection(new[] { id }, TreeViewSelectionOptions.RevealAndFrame); - //TODO: Show there are unsaved changes - } - - void BottomToolBar(Rect rect) - { - GUILayout.BeginArea(rect); - - using(new EditorGUILayout.HorizontalScope()) - { - var style = "miniButton"; - if (GUILayout.Button("Expand All", style)) - { - treeView.ExpandAll(); - } - - if (GUILayout.Button("Collapse All", style)) - { - treeView.CollapseAll(); - } - - GUILayout.Space(10); - - _TreeView.ShowParams = (MultiColumnBehaviorTreeView.ShowParameters) - EditorGUILayout.EnumPopup("Show Parameter Lists", _TreeView.ShowParams, "miniButton"); - } - GUILayout.EndArea(); - } - } - - internal class BTreeMultiColumnHeader : MultiColumnHeader - { - public BTreeMultiColumnHeader(MultiColumnHeaderState state) - : base(state) - { } - - protected override void ColumnHeaderGUI(MultiColumnHeaderState.Column column, Rect headerRect, int columnIndex) - { - // Default column header gui - base.ColumnHeaderGUI(column, headerRect, columnIndex); - } - } -} +using Assets.Scripts.AI; +using Assets.Scripts.AI.Components; +using Assets.Scripts.AI.Tree; +using Assets.Visual_Behavior_Tree.Scripts; +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEditor.Callbacks; +using UnityEditor.IMGUI.Controls; +using UnityEngine; + +namespace Assets.Editor.BehaviorTreeViewEditor.BackendData +{ + class MultiColumnBTreeWindow : EditorWindow + { + [NonSerialized] bool _Initialized; + [SerializeField] TreeViewState _TreeViewState; // Serialized in the window layout file so it survives assembly reloading + [SerializeField] MultiColumnHeaderState _MultiColumnHeaderState; + SearchField _SearchField; + MultiColumnBehaviorTreeView _TreeView; + [SerializeField] TreeNodeAsset _TreeNodeAsset; + + string FilePath = ""; + private static string FileDir = "Assets/Behaviors/"; + + [MenuItem("Behavior Tree/New Tree")] + public static MultiColumnBTreeWindow GetWindow() + { + var window = GetWindow(); + window.titleContent = new GUIContent("Behavior Tree Builder"); + window.Focus(); + window.Repaint(); + return window; + } + + [OnOpenAsset] + public static bool OnOpenAsset(int instanceID, int line) + { + var BTreeAsset = EditorUtility.InstanceIDToObject(instanceID) as TreeNodeAsset; + if (BTreeAsset != null) + { + var window = GetWindow(); + window.SetTreeAsset(BTreeAsset); + return true; + } + return false; // we did not handle the open + } + + public void SetTreeAsset(TreeNodeAsset BehaviorTreeAsset) + { + if(BehaviorTreeAsset == null || BehaviorTreeAsset.treeElements == "") + { + CreateNewTree(); + } + _TreeNodeAsset = BehaviorTreeAsset; + _Initialized = false; + } + + Rect multiColumnTreeViewRect + { + get { return new Rect(20, 50, position.width - 40, position.height - 70); } + } + + Rect toolbarRect + { + get { return new Rect(20f, 10f, position.width - 40f, 20f); } + } + + Rect topToolbarRect + { + get { return new Rect(20f, 30f, position.width - 40f, 30f); } + } + + Rect bottomToolbarRect + { + get { return new Rect(20f, position.height - 18f, position.width - 60f, 16f); } + } + + public MultiColumnBehaviorTreeView treeView + { + get { return _TreeView; } + } + + void InitIfNeeded() + { + if (!_Initialized) + { + // Check if it already exists (deserialized from window layout file or scriptable object) + if (_TreeViewState == null) + _TreeViewState = new TreeViewState(); + + bool firstInit = _MultiColumnHeaderState == null; + var headerState = MultiColumnBehaviorTreeView.CreateDefaultMultiColumnHeaderState(multiColumnTreeViewRect.width); + if (MultiColumnHeaderState.CanOverwriteSerializedFields(_MultiColumnHeaderState, headerState)) + MultiColumnHeaderState.OverwriteSerializedFields(_MultiColumnHeaderState, headerState); + _MultiColumnHeaderState = headerState; + + var multiColumnHeader = new BTreeMultiColumnHeader(headerState); + if (firstInit) + multiColumnHeader.ResizeToFit(); + + var treeModel = new TreeModel(GetData()); + + _TreeView = new MultiColumnBehaviorTreeView(_TreeViewState, multiColumnHeader, treeModel); + + _SearchField = new SearchField(); + _SearchField.downOrUpArrowKeyPressed += _TreeView.SetFocusAndEnsureSelectedItem; + + _Initialized = true; + } + } + + IList GetData() + { + if (_TreeNodeAsset == null) + { + CreateNewTree(); + } + + var treeRoot = _TreeNodeAsset.LoadRoot(); + if(treeRoot == null) + { + treeRoot = new Merge("New Root",-1, -1); + } + var treeList = new List(); + + TreeElementUtility.TreeToList(treeRoot, treeList); + + return treeList; + } + + void CreateNewTree() + { + CustomAssetUtility.CreateAsset(); + _TreeNodeAsset = (TreeNodeAsset)Selection.activeObject; + var root =new Merge("root",-1,-1); + //BehaviorExtensions.SaveBehaviorAsset(null, AssetDatabase.GetAssetPath(_TreeNodeAsset), + // _TreeNodeAsset,(Merge)root); + } + + void OnSelectionChange() + { + if (!_Initialized) + return; + + var BehaviorTreeAsset = Selection.activeObject as TreeNodeAsset; + if (BehaviorTreeAsset != null && BehaviorTreeAsset != _TreeNodeAsset) + { + _TreeNodeAsset = BehaviorTreeAsset; + _TreeView.treeModel.SetData(GetData()); + _TreeView.Reload(); + } + } + + void OnGUI() + { + InitIfNeeded(); + + SearchBar(toolbarRect); + TopToolbar(topToolbarRect); + DoTreeView(multiColumnTreeViewRect); + BottomToolBar(bottomToolbarRect); + } + + void SearchBar(Rect rect) + { + treeView.searchString = _SearchField.OnGUI(rect, treeView.searchString); + } + + void DoTreeView(Rect rect) + { + _TreeView.OnGUI(rect); + } + + void TopToolbar(Rect rect) + { + GUILayout.BeginArea(rect); + + using (new EditorGUILayout.HorizontalScope()) + { + GenericMenu menu = new GenericMenu(); + if (EditorGUILayout.DropdownButton(new GUIContent("Add Behavior"),FocusType.Passive)) + { + menu.CreateTypeMenu(OnTypeSelected); + menu.ShowAsContext(); + } + + if (GUILayout.Button("Remove Behavior")) + { + var selection = _TreeView.GetSelection(); + _TreeView.treeModel.RemoveElements(selection); + } + + FilePath = GUILayout.TextField(FilePath); + if (GUILayout.Button("Save Tree")) + { + FilePath = EditorUtility.SaveFilePanel("", FileDir, "New Behavior Tree", "asset"); + //BehaviorExtensions.SaveBehaviorAsset(null, FilePath, _TreeNodeAsset, (Merge)_TreeView.treeModel.Root); + } + } + + GUILayout.EndArea(); + } + + private void OnTypeSelected(object typeName) + { + var selection = _TreeView.GetSelection(); + BehaviorTreeElement parent = (selection.Count == 1 ? _TreeView.treeModel.Find(selection[0]) : null) ?? _TreeView.treeModel.Root; + int depth = parent != null ? parent.Depth + 1 : 0; + int id = _TreeView.treeModel.GenerateUniqueID(); + + Type type = typeof(BehaviorTreeElement).Assembly.GetType((string)typeName, true); + + dynamic element = Activator.CreateInstance(type, type.ToString().Split('.').Last() + " " + id, depth, id); + element.ElementType = element.GetType().ToString(); + //element.BehaviorTreeManager = parent.BehaviorTreeManager; + _TreeView.treeModel.AddElement(element, parent, 0); + + _TreeView.SetSelection(new[] { id }, TreeViewSelectionOptions.RevealAndFrame); + //TODO: Show there are unsaved changes + } + + void BottomToolBar(Rect rect) + { + GUILayout.BeginArea(rect); + + using(new EditorGUILayout.HorizontalScope()) + { + var style = "miniButton"; + if (GUILayout.Button("Expand All", style)) + { + treeView.ExpandAll(); + } + + if (GUILayout.Button("Collapse All", style)) + { + treeView.CollapseAll(); + } + + GUILayout.Space(10); + + _TreeView.ShowParams = (MultiColumnBehaviorTreeView.ShowParameters) + EditorGUILayout.EnumPopup("Show Parameter Lists", _TreeView.ShowParams, "miniButton"); + } + GUILayout.EndArea(); + } + } + + internal class BTreeMultiColumnHeader : MultiColumnHeader + { + public BTreeMultiColumnHeader(MultiColumnHeaderState state) + : base(state) + { } + + protected override void ColumnHeaderGUI(MultiColumnHeaderState.Column column, Rect headerRect, int columnIndex) + { + // Default column header gui + base.ColumnHeaderGUI(column, headerRect, columnIndex); + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs.meta b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs.meta index 5dca947..8b776a8 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs.meta +++ b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBTreeWindow.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: 712b683d552664c44a375445a3a54067 -timeCreated: 1518236410 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 712b683d552664c44a375445a3a54067 +timeCreated: 1518236410 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBehaviorTreeView.cs b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBehaviorTreeView.cs index 3d9add1..20c1c9a 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBehaviorTreeView.cs +++ b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBehaviorTreeView.cs @@ -1,335 +1,335 @@ -using Assets.Scripts.AI; -using Assets.Scripts.AI.Tree; -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEditor.IMGUI.Controls; -using UnityEngine; -using UnityEngine.Assertions; - -namespace Assets.Editor.BehaviorTreeViewEditor.BackendData -{ - internal class MultiColumnBehaviorTreeView : TreeViewWithTreeModel - { - const float kRowHeights = 20f; - const float kToggleWidth = 18f; - const float kTypeButtonWidth = 70f; - public ShowParameters ShowParams; - - // All columns - enum BTreeColumns - { - State, - Name, - Parameters - } - - public enum SortOption - { - State, - Name, - Parameters - } - - public enum ShowParameters - { - None, - Active, - All - } - - // Sort options per column - SortOption[] m_SortOptions = - { - SortOption.State, - SortOption.Name, - SortOption.Parameters - }; - - public static void TreeToList(TreeViewItem root, IList result) - { - if (root == null) - throw new NullReferenceException("root"); - if (result == null) - throw new NullReferenceException("result"); - - result.Clear(); - - if (root.children == null) - return; - - Stack stack = new Stack(); - for (int i = root.children.Count - 1; i >= 0; i--) - stack.Push(root.children[i]); - - while (stack.Count > 0) - { - TreeViewItem current = stack.Pop(); - result.Add(current); - - if (current.hasChildren && current.children[0] != null) - { - for (int i = current.children.Count - 1; i >= 0; i--) - { - stack.Push(current.children[i]); - } - } - } - } - - public MultiColumnBehaviorTreeView(TreeViewState state, MultiColumnHeader multicolumnHeader, TreeModel model) - : base(state, multicolumnHeader, model) - { - Assert.AreEqual(m_SortOptions.Length, Enum.GetValues(typeof(BTreeColumns)).Length, "Ensure number of sort options are in sync with number of MyColumns enum values"); - - // Custom setup - columnIndexForTreeFoldouts = 1; - - showAlternatingRowBackgrounds = true; - showBorder = true; - customFoldoutYOffset = (kRowHeights - EditorGUIUtility.singleLineHeight) * 0.5f; // center foldout in the row since we also center content. See RowGUI - extraSpaceBeforeIconAndLabel = kToggleWidth; - multicolumnHeader.sortingChanged += OnSortingChanged; - - Reload(); - } - - - // Note we We only build the visible rows, only the backend has the full tree information. - // The treeview only creates info for the row list. - protected override IList BuildRows(TreeViewItem root) - { - var rows = base.BuildRows(root); - SortIfNeeded(root, rows); - return rows; - } - - void OnSortingChanged(MultiColumnHeader multiColumnHeader) - { - SortIfNeeded(rootItem, GetRows()); - } - - void SortIfNeeded(TreeViewItem root, IList rows) - { - if (rows.Count <= 1) - return; - - if (multiColumnHeader.sortedColumnIndex == -1) - { - return; // No column to sort for (just use the order the data are in) - } - - // Sort the roots of the existing tree items - SortByMultipleColumns(); - TreeToList(root, rows); - Repaint(); - } - - void SortByMultipleColumns() - { - var sortedColumns = multiColumnHeader.state.sortedColumns; - - if (sortedColumns.Length == 0) - return; - - var myTypes = rootItem.children.Cast>(); - var orderedQuery = InitialOrder(myTypes, sortedColumns); - for (int i = 1; i < sortedColumns.Length; i++) - { - SortOption sortOption = m_SortOptions[sortedColumns[i]]; - bool ascending = multiColumnHeader.IsSortedAscending(sortedColumns[i]); - - switch (sortOption) - { - case SortOption.Name: - orderedQuery = orderedQuery.ThenBy(l => l.data.Name, ascending); - break; - } - } - - rootItem.children = orderedQuery.Cast().ToList(); - } - - IOrderedEnumerable> InitialOrder(IEnumerable> myTypes, int[] history) - { - SortOption sortOption = m_SortOptions[history[0]]; - bool ascending = multiColumnHeader.IsSortedAscending(history[0]); - switch (sortOption) - { - case SortOption.Name: - return myTypes.Order(l => l.data.Name, ascending); - default: - Assert.IsTrue(false, "Unhandled enum"); - break; - } - - // default - return myTypes.Order(l => l.data.Name, ascending); - } - - protected override void ContextClickedItem(int id) - { - //var item = treeModel.Find(id); - GenericMenu menu = new GenericMenu(); - menu.CreateTypeMenu(OnMenuTypeSelected); - menu.ShowAsContext(); - } - - public void OnMenuTypeSelected(object itemTypeSelected) - { - Debug.Log(itemTypeSelected); - object[] obj = itemTypeSelected as object[]; - BehaviorTreeElement element = obj[0] as BehaviorTreeElement; - element.ElementType = obj[1].ToString(); - element.Name = element.ElementType.Split('.').Last() + " " + element.ID; - Reload(); - } - - protected override void RowGUI(RowGUIArgs args) - { - var item = (TreeViewItem)args.item; - - for (int i = 0; i < args.GetNumVisibleColumns(); ++i) - { - CellGUI(args.GetCellRect(i), item, (BTreeColumns)args.GetColumn(i), ref args); - } - } - - void CellGUI(Rect cellRect, TreeViewItem item, BTreeColumns column, ref RowGUIArgs args) - { - // Center cell rect vertically (makes it easier to place controls, icons etc in the cells) - switch (column) - { - case BTreeColumns.State: - CenterRectUsingSingleLineHeight(ref cellRect); - //EditorGUI.DrawRect(cellRect, GetBehaviorStateColor((int)item.data.CurrentState)); - break; - case BTreeColumns.Name: - // Do toggle - CenterRectUsingSingleLineHeight(ref cellRect); - Rect toggleRect = cellRect; - toggleRect.x += GetContentIndent(item); - toggleRect.width = kToggleWidth; - - // Default icon and label - args.rowRect = cellRect; - base.RowGUI(args); - break; - case BTreeColumns.Parameters: - switch(ShowParams) - { - case ShowParameters.Active: - if (IsSelected(item.id)) - { - //cellRect.height = TypeDependantDrawer.GetTotalHeightOfProperties(item.data); - //TypeDependantDrawer.DrawAllFields(item.data, cellRect); - } - break; - case ShowParameters.All: - //cellRect.height = TypeDependantDrawer.GetTotalHeightOfProperties(item.data); - //TypeDependantDrawer.DrawAllFields(item.data, cellRect); - break; - default: - break; - } - args.rowRect = cellRect; - break; - } - } - - protected override void AfterRowsGUI() - { - base.AfterRowsGUI(); - RefreshCustomRowHeights(); - } - - protected override float GetCustomRowHeight(int row, TreeViewItem item) - { - float maxHeight = 0; - if((ShowParams.HasFlag(ShowParameters.Active) && IsSelected(item.id)) || - ShowParams.HasFlag(ShowParameters.All)) - { - //maxHeight = TypeDependantDrawer.GetTotalHeightOfProperties((item as TreeViewItem).data); - } - return Math.Max(20f, maxHeight); - } - - // Rename - //-------- - - protected override bool CanRename(TreeViewItem item) - { - // Only allow rename if we can show the rename overlay with a certain width (label might be clipped by other columns) - Rect renameRect = GetRenameRect(treeViewRect, 0, item); - return renameRect.width > 30; - } - - protected override void RenameEnded(RenameEndedArgs args) - { - // Set the backend name and reload the tree to reflect the new model - if (args.acceptedRename) - { - var element = treeModel.Find(args.itemID); - element.Name = args.newName; - Reload(); - } - } - - protected override Rect GetRenameRect(Rect rowRect, int row, TreeViewItem item) - { - Rect cellRect = GetCellRectForTreeFoldouts(rowRect); - CenterRectUsingSingleLineHeight(ref cellRect); - return base.GetRenameRect(cellRect, row, item); - } - - // Misc - //-------- - - protected override bool CanMultiSelect(TreeViewItem item) - { - return true; - } - - public static MultiColumnHeaderState CreateDefaultMultiColumnHeaderState(float treeViewWidth) - { - var columns = new[] - { - new MultiColumnHeaderState.Column - { - headerContent = new GUIContent("State"), - headerTextAlignment = TextAlignment.Left, - width = 20, - minWidth = 10, - autoResize = true, - allowToggleVisibility = true - }, - new MultiColumnHeaderState.Column - { - headerContent = new GUIContent("Name"), - headerTextAlignment = TextAlignment.Left, - sortedAscending = true, - sortingArrowAlignment = TextAlignment.Center, - width = 125, - minWidth = 60, - autoResize = true, - allowToggleVisibility = false - }, - new MultiColumnHeaderState.Column - { - headerContent = new GUIContent("Parameters"), - headerTextAlignment = TextAlignment.Left, - width = 200, - minWidth = 60, - autoResize = true, - allowToggleVisibility = true - } - }; - - Assert.AreEqual(columns.Length, Enum.GetValues(typeof(BTreeColumns)).Length, "Number of columns should match number of enum values: You probably forgot to update one of them."); - - var state = new MultiColumnHeaderState(columns); - return state; - } - } -} +using Assets.Scripts.AI; +using Assets.Scripts.AI.Tree; +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEditor.IMGUI.Controls; +using UnityEngine; +using UnityEngine.Assertions; + +namespace Assets.Editor.BehaviorTreeViewEditor.BackendData +{ + internal class MultiColumnBehaviorTreeView : TreeViewWithTreeModel + { + const float kRowHeights = 20f; + const float kToggleWidth = 18f; + const float kTypeButtonWidth = 70f; + public ShowParameters ShowParams; + + // All columns + enum BTreeColumns + { + State, + Name, + Parameters + } + + public enum SortOption + { + State, + Name, + Parameters + } + + public enum ShowParameters + { + None, + Active, + All + } + + // Sort options per column + SortOption[] m_SortOptions = + { + SortOption.State, + SortOption.Name, + SortOption.Parameters + }; + + public static void TreeToList(TreeViewItem root, IList result) + { + if (root == null) + throw new NullReferenceException("root"); + if (result == null) + throw new NullReferenceException("result"); + + result.Clear(); + + if (root.children == null) + return; + + Stack stack = new Stack(); + for (int i = root.children.Count - 1; i >= 0; i--) + stack.Push(root.children[i]); + + while (stack.Count > 0) + { + TreeViewItem current = stack.Pop(); + result.Add(current); + + if (current.hasChildren && current.children[0] != null) + { + for (int i = current.children.Count - 1; i >= 0; i--) + { + stack.Push(current.children[i]); + } + } + } + } + + public MultiColumnBehaviorTreeView(TreeViewState state, MultiColumnHeader multicolumnHeader, TreeModel model) + : base(state, multicolumnHeader, model) + { + Assert.AreEqual(m_SortOptions.Length, Enum.GetValues(typeof(BTreeColumns)).Length, "Ensure number of sort options are in sync with number of MyColumns enum values"); + + // Custom setup + columnIndexForTreeFoldouts = 1; + + showAlternatingRowBackgrounds = true; + showBorder = true; + customFoldoutYOffset = (kRowHeights - EditorGUIUtility.singleLineHeight) * 0.5f; // center foldout in the row since we also center content. See RowGUI + extraSpaceBeforeIconAndLabel = kToggleWidth; + multicolumnHeader.sortingChanged += OnSortingChanged; + + Reload(); + } + + + // Note we We only build the visible rows, only the backend has the full tree information. + // The treeview only creates info for the row list. + protected override IList BuildRows(TreeViewItem root) + { + var rows = base.BuildRows(root); + SortIfNeeded(root, rows); + return rows; + } + + void OnSortingChanged(MultiColumnHeader multiColumnHeader) + { + SortIfNeeded(rootItem, GetRows()); + } + + void SortIfNeeded(TreeViewItem root, IList rows) + { + if (rows.Count <= 1) + return; + + if (multiColumnHeader.sortedColumnIndex == -1) + { + return; // No column to sort for (just use the order the data are in) + } + + // Sort the roots of the existing tree items + SortByMultipleColumns(); + TreeToList(root, rows); + Repaint(); + } + + void SortByMultipleColumns() + { + var sortedColumns = multiColumnHeader.state.sortedColumns; + + if (sortedColumns.Length == 0) + return; + + var myTypes = rootItem.children.Cast>(); + var orderedQuery = InitialOrder(myTypes, sortedColumns); + for (int i = 1; i < sortedColumns.Length; i++) + { + SortOption sortOption = m_SortOptions[sortedColumns[i]]; + bool ascending = multiColumnHeader.IsSortedAscending(sortedColumns[i]); + + switch (sortOption) + { + case SortOption.Name: + orderedQuery = orderedQuery.ThenBy(l => l.data.Name, ascending); + break; + } + } + + rootItem.children = orderedQuery.Cast().ToList(); + } + + IOrderedEnumerable> InitialOrder(IEnumerable> myTypes, int[] history) + { + SortOption sortOption = m_SortOptions[history[0]]; + bool ascending = multiColumnHeader.IsSortedAscending(history[0]); + switch (sortOption) + { + case SortOption.Name: + return myTypes.Order(l => l.data.Name, ascending); + default: + Assert.IsTrue(false, "Unhandled enum"); + break; + } + + // default + return myTypes.Order(l => l.data.Name, ascending); + } + + protected override void ContextClickedItem(int id) + { + //var item = treeModel.Find(id); + GenericMenu menu = new GenericMenu(); + menu.CreateTypeMenu(OnMenuTypeSelected); + menu.ShowAsContext(); + } + + public void OnMenuTypeSelected(object itemTypeSelected) + { + Debug.Log(itemTypeSelected); + object[] obj = itemTypeSelected as object[]; + BehaviorTreeElement element = obj[0] as BehaviorTreeElement; + element.ElementType = obj[1].ToString(); + element.Name = element.ElementType.Split('.').Last() + " " + element.ID; + Reload(); + } + + protected override void RowGUI(RowGUIArgs args) + { + var item = (TreeViewItem)args.item; + + for (int i = 0; i < args.GetNumVisibleColumns(); ++i) + { + CellGUI(args.GetCellRect(i), item, (BTreeColumns)args.GetColumn(i), ref args); + } + } + + void CellGUI(Rect cellRect, TreeViewItem item, BTreeColumns column, ref RowGUIArgs args) + { + // Center cell rect vertically (makes it easier to place controls, icons etc in the cells) + switch (column) + { + case BTreeColumns.State: + CenterRectUsingSingleLineHeight(ref cellRect); + //EditorGUI.DrawRect(cellRect, GetBehaviorStateColor((int)item.data.CurrentState)); + break; + case BTreeColumns.Name: + // Do toggle + CenterRectUsingSingleLineHeight(ref cellRect); + Rect toggleRect = cellRect; + toggleRect.x += GetContentIndent(item); + toggleRect.width = kToggleWidth; + + // Default icon and label + args.rowRect = cellRect; + base.RowGUI(args); + break; + case BTreeColumns.Parameters: + switch(ShowParams) + { + case ShowParameters.Active: + if (IsSelected(item.id)) + { + //cellRect.height = TypeDependantDrawer.GetTotalHeightOfProperties(item.data); + //TypeDependantDrawer.DrawAllFields(item.data, cellRect); + } + break; + case ShowParameters.All: + //cellRect.height = TypeDependantDrawer.GetTotalHeightOfProperties(item.data); + //TypeDependantDrawer.DrawAllFields(item.data, cellRect); + break; + default: + break; + } + args.rowRect = cellRect; + break; + } + } + + protected override void AfterRowsGUI() + { + base.AfterRowsGUI(); + RefreshCustomRowHeights(); + } + + protected override float GetCustomRowHeight(int row, TreeViewItem item) + { + float maxHeight = 0; + if((ShowParams.HasFlag(ShowParameters.Active) && IsSelected(item.id)) || + ShowParams.HasFlag(ShowParameters.All)) + { + //maxHeight = TypeDependantDrawer.GetTotalHeightOfProperties((item as TreeViewItem).data); + } + return Math.Max(20f, maxHeight); + } + + // Rename + //-------- + + protected override bool CanRename(TreeViewItem item) + { + // Only allow rename if we can show the rename overlay with a certain width (label might be clipped by other columns) + Rect renameRect = GetRenameRect(treeViewRect, 0, item); + return renameRect.width > 30; + } + + protected override void RenameEnded(RenameEndedArgs args) + { + // Set the backend name and reload the tree to reflect the new model + if (args.acceptedRename) + { + var element = treeModel.Find(args.itemID); + element.Name = args.newName; + Reload(); + } + } + + protected override Rect GetRenameRect(Rect rowRect, int row, TreeViewItem item) + { + Rect cellRect = GetCellRectForTreeFoldouts(rowRect); + CenterRectUsingSingleLineHeight(ref cellRect); + return base.GetRenameRect(cellRect, row, item); + } + + // Misc + //-------- + + protected override bool CanMultiSelect(TreeViewItem item) + { + return true; + } + + public static MultiColumnHeaderState CreateDefaultMultiColumnHeaderState(float treeViewWidth) + { + var columns = new[] + { + new MultiColumnHeaderState.Column + { + headerContent = new GUIContent("State"), + headerTextAlignment = TextAlignment.Left, + width = 20, + minWidth = 10, + autoResize = true, + allowToggleVisibility = true + }, + new MultiColumnHeaderState.Column + { + headerContent = new GUIContent("Name"), + headerTextAlignment = TextAlignment.Left, + sortedAscending = true, + sortingArrowAlignment = TextAlignment.Center, + width = 125, + minWidth = 60, + autoResize = true, + allowToggleVisibility = false + }, + new MultiColumnHeaderState.Column + { + headerContent = new GUIContent("Parameters"), + headerTextAlignment = TextAlignment.Left, + width = 200, + minWidth = 60, + autoResize = true, + allowToggleVisibility = true + } + }; + + Assert.AreEqual(columns.Length, Enum.GetValues(typeof(BTreeColumns)).Length, "Number of columns should match number of enum values: You probably forgot to update one of them."); + + var state = new MultiColumnHeaderState(columns); + return state; + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBehaviorTreeView.cs.meta b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBehaviorTreeView.cs.meta index df77774..9b8245a 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBehaviorTreeView.cs.meta +++ b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/MultiColumnBehaviorTreeView.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: bc4d8ed3357bc4f4783234fc525745d3 -timeCreated: 1518236410 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: bc4d8ed3357bc4f4783234fc525745d3 +timeCreated: 1518236410 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/TreeViewWithTreeModel.cs b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/TreeViewWithTreeModel.cs index 8378c86..b1e1bff 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/TreeViewWithTreeModel.cs +++ b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/TreeViewWithTreeModel.cs @@ -1,248 +1,248 @@ -using Assets.Scripts.AI.Tree; -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEditor.IMGUI.Controls; -using UnityEngine; - - -namespace Assets.Editor.BehaviorTreeViewEditor.BackendData -{ - internal class TreeViewItem : TreeViewItem where T : TreeElement - { - public T data { get; set; } - - public TreeViewItem (int id, int depth, string displayName, T data) : base (id, depth, displayName) - { - this.data = data; - } - } - - internal class TreeViewWithTreeModel : TreeView where T : TreeElement - { - TreeModel _TreeModel; - readonly List _Rows = new List(100); - public event Action treeChanged; - - public TreeModel treeModel { get { return _TreeModel; } } - public event Action> beforeDroppingDraggedItems; - - public TreeViewWithTreeModel (TreeViewState state, TreeModel model) : base (state) - { - Init (model); - } - - public TreeViewWithTreeModel (TreeViewState state, MultiColumnHeader multiColumnHeader, TreeModel model) - : base(state, multiColumnHeader) - { - Init (model); - } - - void Init (TreeModel model) - { - _TreeModel = model; - _TreeModel.ModelChanged += ModelChanged; - - } - - void ModelChanged () - { - if (treeChanged != null) - treeChanged (); - - Reload (); - } - - protected override TreeViewItem BuildRoot() - { - int depthForHiddenRoot = -1; - - if(null == _TreeModel.Root) - { - Debug.LogError("Tree Model root is null!!"); - } - - return new TreeViewItem(_TreeModel.Root.ID, depthForHiddenRoot, _TreeModel.Root.Name, _TreeModel.Root); - } - - protected override IList BuildRows (TreeViewItem root) - { - if (_TreeModel.Root == null) - { - Debug.LogError ("tree model root is null. did you call SetData()?"); - } - - _Rows.Clear (); - if (!string.IsNullOrEmpty(searchString)) - { - Search (_TreeModel.Root, searchString, _Rows); - } - else - { - if (_TreeModel.Root.HasChildren) - AddChildrenRecursive(_TreeModel.Root, 0, _Rows); - } - - // We still need to setup the child parent information for the rows since this - // information is used by the TreeView internal logic (navigation, dragging etc) - SetupParentsAndChildrenFromDepths (root, _Rows); - - return _Rows; - } - - void AddChildrenRecursive (T parent, int depth, IList newRows) - { - foreach (T child in parent.Children) - { - var item = new TreeViewItem(child.ID, depth, child.Name, child); - newRows.Add(item); - - if (child.HasChildren) - { - if (IsExpanded(child.ID)) - { - AddChildrenRecursive (child, depth + 1, newRows); - } - else - { - item.children = CreateChildListForCollapsedParent(); - } - } - } - } - - void Search(T searchFromThis, string search, List result) - { - if (string.IsNullOrEmpty(search)) - throw new ArgumentException("Invalid search: cannot be null or empty", "search"); - - const int kItemDepth = 0; // tree is flattened when searching - - Stack stack = new Stack(); - foreach (var element in searchFromThis.Children) - stack.Push((T)element); - while (stack.Count > 0) - { - T current = stack.Pop(); - // Matches search? - if (current.Name.IndexOf(search, StringComparison.OrdinalIgnoreCase) >= 0) - { - result.Add(new TreeViewItem(current.ID, kItemDepth, current.Name, current)); - } - - if (current.Children != null && current.Children.Count > 0) - { - foreach (var element in current.Children) - { - stack.Push((T)element); - } - } - } - SortSearchResult(result); - } - - protected virtual void SortSearchResult (List rows) - { - rows.Sort ((x,y) => EditorUtility.NaturalCompare (x.displayName, y.displayName)); // sort by displayName by default, can be overriden for multicolumn solutions - } - - protected override IList GetAncestors (int id) - { - return _TreeModel.GetAncestors(id); - } - - protected override IList GetDescendantsThatHaveChildren (int id) - { - return _TreeModel.GetDescendantsThatHaveChildren(id); - } - - - // Dragging - //----------- - - const string k_GenericDragID = "GenericDragColumnDragging"; - - protected override bool CanStartDrag (CanStartDragArgs args) - { - return true; - } - - protected override void SetupDragAndDrop(SetupDragAndDropArgs args) - { - if (hasSearch) - return; - - DragAndDrop.PrepareStartDrag(); - var draggedRows = GetRows().Where(item => args.draggedItemIDs.Contains(item.id)).ToList(); - DragAndDrop.SetGenericData(k_GenericDragID, draggedRows); - DragAndDrop.objectReferences = new UnityEngine.Object[] { }; // this IS required for dragging to work - string title = draggedRows.Count == 1 ? draggedRows[0].displayName : "< Multiple >"; - DragAndDrop.StartDrag (title); - } - - protected override DragAndDropVisualMode HandleDragAndDrop (DragAndDropArgs args) - { - // Check if we can handle the current drag data (could be dragged in from other areas/windows in the editor) - var draggedRows = DragAndDrop.GetGenericData(k_GenericDragID) as List; - if (draggedRows == null) - return DragAndDropVisualMode.None; - - // Parent item is null when dragging outside any tree view items. - switch (args.dragAndDropPosition) - { - case DragAndDropPosition.UponItem: - case DragAndDropPosition.BetweenItems: - { - bool validDrag = ValidDrag(args.parentItem, draggedRows); - if (args.performDrop && validDrag) - { - T parentData = ((TreeViewItem)args.parentItem).data; - OnDropDraggedElementsAtIndex(draggedRows, parentData, args.insertAtIndex == -1 ? 0 : args.insertAtIndex); - } - return validDrag ? DragAndDropVisualMode.Move : DragAndDropVisualMode.None; - } - - case DragAndDropPosition.OutsideItems: - { - if (args.performDrop) - OnDropDraggedElementsAtIndex(draggedRows, _TreeModel.Root, _TreeModel.Root.Children.Count); - - return DragAndDropVisualMode.Move; - } - default: - Debug.LogError("Unhandled enum " + args.dragAndDropPosition); - return DragAndDropVisualMode.None; - } - } - - public virtual void OnDropDraggedElementsAtIndex (List draggedRows, T parent, int insertIndex) - { - if (beforeDroppingDraggedItems != null) - beforeDroppingDraggedItems (draggedRows); - - var draggedElements = new List (); - foreach (var x in draggedRows) - draggedElements.Add (((TreeViewItem) x).data); - - var selectedIDs = draggedElements.Select (x => x.ID).ToArray(); - _TreeModel.MoveElements (parent, insertIndex, draggedElements); - SetSelection(selectedIDs, TreeViewSelectionOptions.RevealAndFrame); - } - - - bool ValidDrag(TreeViewItem parent, List draggedItems) - { - TreeViewItem currentParent = parent; - while (currentParent != null) - { - if (draggedItems.Contains(currentParent)) - return false; - currentParent = currentParent.parent; - } - return true; - } - - } - -} +using Assets.Scripts.AI.Tree; +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEditor.IMGUI.Controls; +using UnityEngine; + + +namespace Assets.Editor.BehaviorTreeViewEditor.BackendData +{ + internal class TreeViewItem : TreeViewItem where T : TreeElement + { + public T data { get; set; } + + public TreeViewItem (int id, int depth, string displayName, T data) : base (id, depth, displayName) + { + this.data = data; + } + } + + internal class TreeViewWithTreeModel : TreeView where T : TreeElement + { + TreeModel _TreeModel; + readonly List _Rows = new List(100); + public event Action treeChanged; + + public TreeModel treeModel { get { return _TreeModel; } } + public event Action> beforeDroppingDraggedItems; + + public TreeViewWithTreeModel (TreeViewState state, TreeModel model) : base (state) + { + Init (model); + } + + public TreeViewWithTreeModel (TreeViewState state, MultiColumnHeader multiColumnHeader, TreeModel model) + : base(state, multiColumnHeader) + { + Init (model); + } + + void Init (TreeModel model) + { + _TreeModel = model; + _TreeModel.ModelChanged += ModelChanged; + + } + + void ModelChanged () + { + if (treeChanged != null) + treeChanged (); + + Reload (); + } + + protected override TreeViewItem BuildRoot() + { + int depthForHiddenRoot = -1; + + if(null == _TreeModel.Root) + { + Debug.LogError("Tree Model root is null!!"); + } + + return new TreeViewItem(_TreeModel.Root.ID, depthForHiddenRoot, _TreeModel.Root.Name, _TreeModel.Root); + } + + protected override IList BuildRows (TreeViewItem root) + { + if (_TreeModel.Root == null) + { + Debug.LogError ("tree model root is null. did you call SetData()?"); + } + + _Rows.Clear (); + if (!string.IsNullOrEmpty(searchString)) + { + Search (_TreeModel.Root, searchString, _Rows); + } + else + { + if (_TreeModel.Root.HasChildren) + AddChildrenRecursive(_TreeModel.Root, 0, _Rows); + } + + // We still need to setup the child parent information for the rows since this + // information is used by the TreeView internal logic (navigation, dragging etc) + SetupParentsAndChildrenFromDepths (root, _Rows); + + return _Rows; + } + + void AddChildrenRecursive (T parent, int depth, IList newRows) + { + foreach (T child in parent.Children) + { + var item = new TreeViewItem(child.ID, depth, child.Name, child); + newRows.Add(item); + + if (child.HasChildren) + { + if (IsExpanded(child.ID)) + { + AddChildrenRecursive (child, depth + 1, newRows); + } + else + { + item.children = CreateChildListForCollapsedParent(); + } + } + } + } + + void Search(T searchFromThis, string search, List result) + { + if (string.IsNullOrEmpty(search)) + throw new ArgumentException("Invalid search: cannot be null or empty", "search"); + + const int kItemDepth = 0; // tree is flattened when searching + + Stack stack = new Stack(); + foreach (var element in searchFromThis.Children) + stack.Push((T)element); + while (stack.Count > 0) + { + T current = stack.Pop(); + // Matches search? + if (current.Name.IndexOf(search, StringComparison.OrdinalIgnoreCase) >= 0) + { + result.Add(new TreeViewItem(current.ID, kItemDepth, current.Name, current)); + } + + if (current.Children != null && current.Children.Count > 0) + { + foreach (var element in current.Children) + { + stack.Push((T)element); + } + } + } + SortSearchResult(result); + } + + protected virtual void SortSearchResult (List rows) + { + rows.Sort ((x,y) => EditorUtility.NaturalCompare (x.displayName, y.displayName)); // sort by displayName by default, can be overriden for multicolumn solutions + } + + protected override IList GetAncestors (int id) + { + return _TreeModel.GetAncestors(id); + } + + protected override IList GetDescendantsThatHaveChildren (int id) + { + return _TreeModel.GetDescendantsThatHaveChildren(id); + } + + + // Dragging + //----------- + + const string k_GenericDragID = "GenericDragColumnDragging"; + + protected override bool CanStartDrag (CanStartDragArgs args) + { + return true; + } + + protected override void SetupDragAndDrop(SetupDragAndDropArgs args) + { + if (hasSearch) + return; + + DragAndDrop.PrepareStartDrag(); + var draggedRows = GetRows().Where(item => args.draggedItemIDs.Contains(item.id)).ToList(); + DragAndDrop.SetGenericData(k_GenericDragID, draggedRows); + DragAndDrop.objectReferences = new UnityEngine.Object[] { }; // this IS required for dragging to work + string title = draggedRows.Count == 1 ? draggedRows[0].displayName : "< Multiple >"; + DragAndDrop.StartDrag (title); + } + + protected override DragAndDropVisualMode HandleDragAndDrop (DragAndDropArgs args) + { + // Check if we can handle the current drag data (could be dragged in from other areas/windows in the editor) + var draggedRows = DragAndDrop.GetGenericData(k_GenericDragID) as List; + if (draggedRows == null) + return DragAndDropVisualMode.None; + + // Parent item is null when dragging outside any tree view items. + switch (args.dragAndDropPosition) + { + case DragAndDropPosition.UponItem: + case DragAndDropPosition.BetweenItems: + { + bool validDrag = ValidDrag(args.parentItem, draggedRows); + if (args.performDrop && validDrag) + { + T parentData = ((TreeViewItem)args.parentItem).data; + OnDropDraggedElementsAtIndex(draggedRows, parentData, args.insertAtIndex == -1 ? 0 : args.insertAtIndex); + } + return validDrag ? DragAndDropVisualMode.Move : DragAndDropVisualMode.None; + } + + case DragAndDropPosition.OutsideItems: + { + if (args.performDrop) + OnDropDraggedElementsAtIndex(draggedRows, _TreeModel.Root, _TreeModel.Root.Children.Count); + + return DragAndDropVisualMode.Move; + } + default: + Debug.LogError("Unhandled enum " + args.dragAndDropPosition); + return DragAndDropVisualMode.None; + } + } + + public virtual void OnDropDraggedElementsAtIndex (List draggedRows, T parent, int insertIndex) + { + if (beforeDroppingDraggedItems != null) + beforeDroppingDraggedItems (draggedRows); + + var draggedElements = new List (); + foreach (var x in draggedRows) + draggedElements.Add (((TreeViewItem) x).data); + + var selectedIDs = draggedElements.Select (x => x.ID).ToArray(); + _TreeModel.MoveElements (parent, insertIndex, draggedElements); + SetSelection(selectedIDs, TreeViewSelectionOptions.RevealAndFrame); + } + + + bool ValidDrag(TreeViewItem parent, List draggedItems) + { + TreeViewItem currentParent = parent; + while (currentParent != null) + { + if (draggedItems.Contains(currentParent)) + return false; + currentParent = currentParent.parent; + } + return true; + } + + } + +} diff --git a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/TreeViewWithTreeModel.cs.meta b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/TreeViewWithTreeModel.cs.meta index 5077bf7..2cff069 100644 --- a/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/TreeViewWithTreeModel.cs.meta +++ b/Assets/Visual Behavior Tree/Editor/BehaviorTreeViewEditor/BackendData/TreeViewWithTreeModel.cs.meta @@ -1,12 +1,12 @@ -fileFormatVersion: 2 -guid: 68fe63fd42552e7418aac450b41b8afb -timeCreated: 1472481611 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 68fe63fd42552e7418aac450b41b8afb +timeCreated: 1472481611 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/BuiltInResourcesWindow.cs b/Assets/Visual Behavior Tree/Editor/BuiltInResourcesWindow.cs index 732b40a..0c36d22 100644 --- a/Assets/Visual Behavior Tree/Editor/BuiltInResourcesWindow.cs +++ b/Assets/Visual Behavior Tree/Editor/BuiltInResourcesWindow.cs @@ -1,229 +1,229 @@ -using System; -using UnityEditor; -using UnityEngine; -using System.Collections.Generic; - -namespace Assets.Editor.BehaviorTreeViewEditor.BackendData -{ - public class BuiltInResourcesWindow : EditorWindow - { - [MenuItem("Window/Built-in styles and icons")] - public static void ShowWindow() - { - BuiltInResourcesWindow w = (BuiltInResourcesWindow)EditorWindow.GetWindow(); - w.Show(); - } - - private struct Drawing - { - public Rect Rect; - public Action Draw; - } - - private List Drawings; - - private List _objects; - private float _scrollPos; - private float _maxY; - private Rect _oldPosition; - - private bool _showingStyles = true; - private bool _showingIcons = false; - - private string _search = ""; - - void OnGUI() - { - if (position.width != _oldPosition.width && Event.current.type == EventType.Layout) - { - Drawings = null; - _oldPosition = position; - } - - GUILayout.BeginHorizontal(); - - if (GUILayout.Toggle(_showingStyles, "Styles", EditorStyles.toolbarButton) != _showingStyles) - { - _showingStyles = !_showingStyles; - _showingIcons = !_showingStyles; - Drawings = null; - } - - if (GUILayout.Toggle(_showingIcons, "Icons", EditorStyles.toolbarButton) != _showingIcons) - { - _showingIcons = !_showingIcons; - _showingStyles = !_showingIcons; - Drawings = null; - } - - GUILayout.EndHorizontal(); - - string newSearch = GUILayout.TextField(_search); - if (newSearch != _search) - { - _search = newSearch; - Drawings = null; - } - - float top = 36; - - if (Drawings == null) - { - string lowerSearch = _search.ToLower(); - - Drawings = new List(); - - GUIContent inactiveText = new GUIContent("inactive"); - GUIContent activeText = new GUIContent("active"); - - float x = 5.0f; - float y = 5.0f; - - if (_showingStyles) - { - foreach (GUIStyle ss in GUI.skin.customStyles) - { - if (lowerSearch != "" && !ss.name.ToLower().Contains(lowerSearch)) - continue; - - GUIStyle thisStyle = ss; - - Drawing draw = new Drawing(); - - float width = Mathf.Max( - 100.0f, - GUI.skin.button.CalcSize(new GUIContent(ss.name)).x, - ss.CalcSize(inactiveText).x + ss.CalcSize(activeText).x - ) + 16.0f; - - float height = 60.0f; - - if (x + width > position.width - 32 && x > 5.0f) - { - x = 5.0f; - y += height + 10.0f; - } - - draw.Rect = new Rect(x, y, width, height); - - width -= 8.0f; - - draw.Draw = () => - { - if (GUILayout.Button(thisStyle.name, GUILayout.Width(width))) - CopyText("(GUIStyle)\"" + thisStyle.name + "\""); - - GUILayout.BeginHorizontal(); - GUILayout.Toggle(false, inactiveText, thisStyle, GUILayout.Width(width / 2)); - GUILayout.Toggle(false, activeText, thisStyle, GUILayout.Width(width / 2)); - GUILayout.EndHorizontal(); - }; - - x += width + 18.0f; - - Drawings.Add(draw); - } - } - else if (_showingIcons) - { - if (_objects == null) - { - _objects = new List(Resources.FindObjectsOfTypeAll(typeof(Texture))); - _objects.Sort((pA, pB) => System.String.Compare(pA.name, pB.name, System.StringComparison.OrdinalIgnoreCase)); - } - - float rowHeight = 0.0f; - - foreach (UnityEngine.Object oo in _objects) - { - Texture texture = (Texture)oo; - - if (texture.name == "") - continue; - - if (lowerSearch != "" && !texture.name.ToLower().Contains(lowerSearch)) - continue; - - Drawing draw = new Drawing(); - - float width = Mathf.Max( - GUI.skin.button.CalcSize(new GUIContent(texture.name)).x, - texture.width - ) + 8.0f; - - float height = texture.height + GUI.skin.button.CalcSize(new GUIContent(texture.name)).y + 8.0f; - - if (x + width > position.width - 32.0f) - { - x = 5.0f; - y += rowHeight + 8.0f; - rowHeight = 0.0f; - } - - draw.Rect = new Rect(x, y, width, height); - - rowHeight = Mathf.Max(rowHeight, height); - - width -= 8.0f; - - draw.Draw = () => - { - if (GUILayout.Button(texture.name, GUILayout.Width(width))) - CopyText("EditorGUIUtility.FindTexture( \"" + texture.name + "\" )"); - - Rect textureRect = GUILayoutUtility.GetRect(texture.width, texture.width, texture.height, texture.height, GUILayout.ExpandHeight(false), GUILayout.ExpandWidth(false)); - EditorGUI.DrawTextureTransparent(textureRect, texture); - }; - - x += width + 8.0f; - - Drawings.Add(draw); - } - } - - _maxY = y; - } - - Rect r = position; - r.y = top; - r.height -= r.y; - r.x = r.width - 16; - r.width = 16; - - float areaHeight = position.height - top; - _scrollPos = GUI.VerticalScrollbar(r, _scrollPos, areaHeight, 0.0f, _maxY); - - Rect area = new Rect(0, top, position.width - 16.0f, areaHeight); - GUILayout.BeginArea(area); - - int count = 0; - foreach (Drawing draw in Drawings) - { - Rect newRect = draw.Rect; - newRect.y -= _scrollPos; - - if (newRect.y + newRect.height > 0 && newRect.y < areaHeight) - { - GUILayout.BeginArea(newRect, GUI.skin.textField); - draw.Draw(); - GUILayout.EndArea(); - - count++; - } - } - - GUILayout.EndArea(); - } - - void CopyText(string pText) - { - TextEditor editor = new TextEditor(); - - //editor.content = new GUIContent(pText); // Unity 4.x code - editor.text = pText; // Unity 5.x code - - editor.SelectAll(); - editor.Copy(); - } - } +using System; +using UnityEditor; +using UnityEngine; +using System.Collections.Generic; + +namespace Assets.Editor.BehaviorTreeViewEditor.BackendData +{ + public class BuiltInResourcesWindow : EditorWindow + { + [MenuItem("Window/Built-in styles and icons")] + public static void ShowWindow() + { + BuiltInResourcesWindow w = (BuiltInResourcesWindow)EditorWindow.GetWindow(); + w.Show(); + } + + private struct Drawing + { + public Rect Rect; + public Action Draw; + } + + private List Drawings; + + private List _objects; + private float _scrollPos; + private float _maxY; + private Rect _oldPosition; + + private bool _showingStyles = true; + private bool _showingIcons = false; + + private string _search = ""; + + void OnGUI() + { + if (position.width != _oldPosition.width && Event.current.type == EventType.Layout) + { + Drawings = null; + _oldPosition = position; + } + + GUILayout.BeginHorizontal(); + + if (GUILayout.Toggle(_showingStyles, "Styles", EditorStyles.toolbarButton) != _showingStyles) + { + _showingStyles = !_showingStyles; + _showingIcons = !_showingStyles; + Drawings = null; + } + + if (GUILayout.Toggle(_showingIcons, "Icons", EditorStyles.toolbarButton) != _showingIcons) + { + _showingIcons = !_showingIcons; + _showingStyles = !_showingIcons; + Drawings = null; + } + + GUILayout.EndHorizontal(); + + string newSearch = GUILayout.TextField(_search); + if (newSearch != _search) + { + _search = newSearch; + Drawings = null; + } + + float top = 36; + + if (Drawings == null) + { + string lowerSearch = _search.ToLower(); + + Drawings = new List(); + + GUIContent inactiveText = new GUIContent("inactive"); + GUIContent activeText = new GUIContent("active"); + + float x = 5.0f; + float y = 5.0f; + + if (_showingStyles) + { + foreach (GUIStyle ss in GUI.skin.customStyles) + { + if (lowerSearch != "" && !ss.name.ToLower().Contains(lowerSearch)) + continue; + + GUIStyle thisStyle = ss; + + Drawing draw = new Drawing(); + + float width = Mathf.Max( + 100.0f, + GUI.skin.button.CalcSize(new GUIContent(ss.name)).x, + ss.CalcSize(inactiveText).x + ss.CalcSize(activeText).x + ) + 16.0f; + + float height = 60.0f; + + if (x + width > position.width - 32 && x > 5.0f) + { + x = 5.0f; + y += height + 10.0f; + } + + draw.Rect = new Rect(x, y, width, height); + + width -= 8.0f; + + draw.Draw = () => + { + if (GUILayout.Button(thisStyle.name, GUILayout.Width(width))) + CopyText("(GUIStyle)\"" + thisStyle.name + "\""); + + GUILayout.BeginHorizontal(); + GUILayout.Toggle(false, inactiveText, thisStyle, GUILayout.Width(width / 2)); + GUILayout.Toggle(false, activeText, thisStyle, GUILayout.Width(width / 2)); + GUILayout.EndHorizontal(); + }; + + x += width + 18.0f; + + Drawings.Add(draw); + } + } + else if (_showingIcons) + { + if (_objects == null) + { + _objects = new List(Resources.FindObjectsOfTypeAll(typeof(Texture))); + _objects.Sort((pA, pB) => System.String.Compare(pA.name, pB.name, System.StringComparison.OrdinalIgnoreCase)); + } + + float rowHeight = 0.0f; + + foreach (UnityEngine.Object oo in _objects) + { + Texture texture = (Texture)oo; + + if (texture.name == "") + continue; + + if (lowerSearch != "" && !texture.name.ToLower().Contains(lowerSearch)) + continue; + + Drawing draw = new Drawing(); + + float width = Mathf.Max( + GUI.skin.button.CalcSize(new GUIContent(texture.name)).x, + texture.width + ) + 8.0f; + + float height = texture.height + GUI.skin.button.CalcSize(new GUIContent(texture.name)).y + 8.0f; + + if (x + width > position.width - 32.0f) + { + x = 5.0f; + y += rowHeight + 8.0f; + rowHeight = 0.0f; + } + + draw.Rect = new Rect(x, y, width, height); + + rowHeight = Mathf.Max(rowHeight, height); + + width -= 8.0f; + + draw.Draw = () => + { + if (GUILayout.Button(texture.name, GUILayout.Width(width))) + CopyText("EditorGUIUtility.FindTexture( \"" + texture.name + "\" )"); + + Rect textureRect = GUILayoutUtility.GetRect(texture.width, texture.width, texture.height, texture.height, GUILayout.ExpandHeight(false), GUILayout.ExpandWidth(false)); + EditorGUI.DrawTextureTransparent(textureRect, texture); + }; + + x += width + 8.0f; + + Drawings.Add(draw); + } + } + + _maxY = y; + } + + Rect r = position; + r.y = top; + r.height -= r.y; + r.x = r.width - 16; + r.width = 16; + + float areaHeight = position.height - top; + _scrollPos = GUI.VerticalScrollbar(r, _scrollPos, areaHeight, 0.0f, _maxY); + + Rect area = new Rect(0, top, position.width - 16.0f, areaHeight); + GUILayout.BeginArea(area); + + int count = 0; + foreach (Drawing draw in Drawings) + { + Rect newRect = draw.Rect; + newRect.y -= _scrollPos; + + if (newRect.y + newRect.height > 0 && newRect.y < areaHeight) + { + GUILayout.BeginArea(newRect, GUI.skin.textField); + draw.Draw(); + GUILayout.EndArea(); + + count++; + } + } + + GUILayout.EndArea(); + } + + void CopyText(string pText) + { + TextEditor editor = new TextEditor(); + + //editor.content = new GUIContent(pText); // Unity 4.x code + editor.text = pText; // Unity 5.x code + + editor.SelectAll(); + editor.Copy(); + } + } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/CustomAssetUtitlity.cs b/Assets/Visual Behavior Tree/Editor/CustomAssetUtitlity.cs index 8040170..0694f0f 100644 --- a/Assets/Visual Behavior Tree/Editor/CustomAssetUtitlity.cs +++ b/Assets/Visual Behavior Tree/Editor/CustomAssetUtitlity.cs @@ -1,30 +1,30 @@ -using UnityEngine; -using UnityEditor; -using System.IO; - -public static class CustomAssetUtility -{ - public static void CreateAsset(string name = "") where T : ScriptableObject - { - T asset = ScriptableObject.CreateInstance(); - - string path = AssetDatabase.GetAssetPath(Selection.activeObject); - if (path == "") - { - path = "Assets/Visual Behavior Tree/Examples"; - } - else if (Path.GetExtension(path) != "") - { - path = path.Replace(Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)), ""); - } - - string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/" + - (name == "" ? "New "+ typeof(T).Name.ToString() : name) + ".asset"); - - AssetDatabase.CreateAsset(asset, assetPathAndName); - - AssetDatabase.SaveAssets(); - EditorUtility.FocusProjectWindow(); - Selection.activeObject = asset; - } +using UnityEngine; +using UnityEditor; +using System.IO; + +public static class CustomAssetUtility +{ + public static void CreateAsset(string name = "") where T : ScriptableObject + { + T asset = ScriptableObject.CreateInstance(); + + string path = AssetDatabase.GetAssetPath(Selection.activeObject); + if (path == "") + { + path = "Assets/Visual Behavior Tree/Examples"; + } + else if (Path.GetExtension(path) != "") + { + path = path.Replace(Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)), ""); + } + + string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/" + + (name == "" ? "New "+ typeof(T).Name.ToString() : name) + ".asset"); + + AssetDatabase.CreateAsset(asset, assetPathAndName); + + AssetDatabase.SaveAssets(); + EditorUtility.FocusProjectWindow(); + Selection.activeObject = asset; + } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/CustomAssetUtitlity.cs.meta b/Assets/Visual Behavior Tree/Editor/CustomAssetUtitlity.cs.meta index 9745e87..79bc2e6 100644 --- a/Assets/Visual Behavior Tree/Editor/CustomAssetUtitlity.cs.meta +++ b/Assets/Visual Behavior Tree/Editor/CustomAssetUtitlity.cs.meta @@ -1,13 +1,13 @@ -fileFormatVersion: 2 -guid: 4bae2ef2c7aaaa74fa70d0029c78ffa8 -timeCreated: 1518939824 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 4bae2ef2c7aaaa74fa70d0029c78ffa8 +timeCreated: 1518939824 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/EditorList.cs b/Assets/Visual Behavior Tree/Editor/EditorList.cs index 379cfb5..0f60974 100644 --- a/Assets/Visual Behavior Tree/Editor/EditorList.cs +++ b/Assets/Visual Behavior Tree/Editor/EditorList.cs @@ -1,124 +1,124 @@ -using UnityEditor; -using UnityEngine; -using System; - -namespace Assets.Editor -{ - [Flags] - public enum EditorListOption - { - None = 0, - ListSize = 1, - ListLabel = 2, - ElementLabels = 4, - Buttons = 8, - Default = ListSize | ListLabel | ElementLabels, - NoElementLabels = ListSize | ListLabel, - All = Default | Buttons - } - - public static class EditorList - { - - private static GUIContent - moveButtonContent = new GUIContent("\u21b4", "move down"), - duplicateButtonContent = new GUIContent("+", "duplicate"), - deleteButtonContent = new GUIContent("-", "delete"), - addButtonContent = new GUIContent("+", "add element"); - - private static GUILayoutOption miniButtonWidth = GUILayout.Width(20f); - - public static void Show(SerializedProperty list, EditorListOption options = EditorListOption.Default) - { - if (!list.isArray) - { - EditorGUILayout.HelpBox(list.name + " is neither an array nor a list!", MessageType.Error); - return; - } - - bool - showListLabel = (options & EditorListOption.ListLabel) != 0, - showListSize = (options & EditorListOption.ListSize) != 0; - - if (showListLabel) - { - EditorGUILayout.PropertyField(list); - EditorGUI.indentLevel += 1; - } - if (!showListLabel || list.isExpanded) - { - SerializedProperty size = list.FindPropertyRelative("Array.size"); - if (showListSize) - { - EditorGUILayout.PropertyField(size); - } - if (size.hasMultipleDifferentValues) - { - EditorGUILayout.HelpBox("Not showing lists with different sizes.", MessageType.Info); - } - else - { - ShowElements(list, options); - } - } - if (showListLabel) - { - EditorGUI.indentLevel -= 1; - } - } - - private static void ShowElements(SerializedProperty list, EditorListOption options) - { - bool - showElementLabels = (options & EditorListOption.ElementLabels) != 0, - showButtons = (options & EditorListOption.Buttons) != 0; - - for (int i = 0; i < list.arraySize; i++) - { - if (showButtons) - { - EditorGUILayout.BeginHorizontal(); - } - if (showElementLabels) - { - var element = list.GetArrayElementAtIndex(i); - EditorGUILayout.PropertyField(element); - } - else - { - EditorGUILayout.PropertyField(list.GetArrayElementAtIndex(i), GUIContent.none); - } - if (showButtons) - { - ShowButtons(list, i); - EditorGUILayout.EndHorizontal(); - } - } - if (showButtons && list.arraySize == 0 && GUILayout.Button(addButtonContent, EditorStyles.miniButton)) - { - list.arraySize += 1; - } - } - - private static void ShowButtons(SerializedProperty list, int index) - { - if (GUILayout.Button(moveButtonContent, EditorStyles.miniButtonLeft, miniButtonWidth)) - { - list.MoveArrayElement(index, index + 1); - } - if (GUILayout.Button(duplicateButtonContent, EditorStyles.miniButtonMid, miniButtonWidth)) - { - list.InsertArrayElementAtIndex(index); - } - if (GUILayout.Button(deleteButtonContent, EditorStyles.miniButtonRight, miniButtonWidth)) - { - int oldSize = list.arraySize; - list.DeleteArrayElementAtIndex(index); - if (list.arraySize == oldSize) - { - list.DeleteArrayElementAtIndex(index); - } - } - } - } +using UnityEditor; +using UnityEngine; +using System; + +namespace Assets.Editor +{ + [Flags] + public enum EditorListOption + { + None = 0, + ListSize = 1, + ListLabel = 2, + ElementLabels = 4, + Buttons = 8, + Default = ListSize | ListLabel | ElementLabels, + NoElementLabels = ListSize | ListLabel, + All = Default | Buttons + } + + public static class EditorList + { + + private static GUIContent + moveButtonContent = new GUIContent("\u21b4", "move down"), + duplicateButtonContent = new GUIContent("+", "duplicate"), + deleteButtonContent = new GUIContent("-", "delete"), + addButtonContent = new GUIContent("+", "add element"); + + private static GUILayoutOption miniButtonWidth = GUILayout.Width(20f); + + public static void Show(SerializedProperty list, EditorListOption options = EditorListOption.Default) + { + if (!list.isArray) + { + EditorGUILayout.HelpBox(list.name + " is neither an array nor a list!", MessageType.Error); + return; + } + + bool + showListLabel = (options & EditorListOption.ListLabel) != 0, + showListSize = (options & EditorListOption.ListSize) != 0; + + if (showListLabel) + { + EditorGUILayout.PropertyField(list); + EditorGUI.indentLevel += 1; + } + if (!showListLabel || list.isExpanded) + { + SerializedProperty size = list.FindPropertyRelative("Array.size"); + if (showListSize) + { + EditorGUILayout.PropertyField(size); + } + if (size.hasMultipleDifferentValues) + { + EditorGUILayout.HelpBox("Not showing lists with different sizes.", MessageType.Info); + } + else + { + ShowElements(list, options); + } + } + if (showListLabel) + { + EditorGUI.indentLevel -= 1; + } + } + + private static void ShowElements(SerializedProperty list, EditorListOption options) + { + bool + showElementLabels = (options & EditorListOption.ElementLabels) != 0, + showButtons = (options & EditorListOption.Buttons) != 0; + + for (int i = 0; i < list.arraySize; i++) + { + if (showButtons) + { + EditorGUILayout.BeginHorizontal(); + } + if (showElementLabels) + { + var element = list.GetArrayElementAtIndex(i); + EditorGUILayout.PropertyField(element); + } + else + { + EditorGUILayout.PropertyField(list.GetArrayElementAtIndex(i), GUIContent.none); + } + if (showButtons) + { + ShowButtons(list, i); + EditorGUILayout.EndHorizontal(); + } + } + if (showButtons && list.arraySize == 0 && GUILayout.Button(addButtonContent, EditorStyles.miniButton)) + { + list.arraySize += 1; + } + } + + private static void ShowButtons(SerializedProperty list, int index) + { + if (GUILayout.Button(moveButtonContent, EditorStyles.miniButtonLeft, miniButtonWidth)) + { + list.MoveArrayElement(index, index + 1); + } + if (GUILayout.Button(duplicateButtonContent, EditorStyles.miniButtonMid, miniButtonWidth)) + { + list.InsertArrayElementAtIndex(index); + } + if (GUILayout.Button(deleteButtonContent, EditorStyles.miniButtonRight, miniButtonWidth)) + { + int oldSize = list.arraySize; + list.DeleteArrayElementAtIndex(index); + if (list.arraySize == oldSize) + { + list.DeleteArrayElementAtIndex(index); + } + } + } + } } \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/EditorList.cs.meta b/Assets/Visual Behavior Tree/Editor/EditorList.cs.meta index 0b8074f..0a71b59 100644 --- a/Assets/Visual Behavior Tree/Editor/EditorList.cs.meta +++ b/Assets/Visual Behavior Tree/Editor/EditorList.cs.meta @@ -1,12 +1,12 @@ -fileFormatVersion: 2 -guid: 2e8e452db8c3f44fdb9b2c25ba5e641a -timeCreated: 18446744011573954816 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 2e8e452db8c3f44fdb9b2c25ba5e641a +timeCreated: 18446744011573954816 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/TreeLoader.cs b/Assets/Visual Behavior Tree/Editor/TreeLoader.cs index ebd7130..304e3af 100644 --- a/Assets/Visual Behavior Tree/Editor/TreeLoader.cs +++ b/Assets/Visual Behavior Tree/Editor/TreeLoader.cs @@ -1,89 +1,89 @@ -using Assets.Scripts.AI; -using Assets.Scripts.AI.Tree; -using Assets.Visual_Behavior_Tree.Editor.NodeEditor; -using Assets.Visual_Behavior_Tree.Scripts; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using UnityEditor; -using UnityEngine; - -namespace Assets.Visual_Behavior_Tree.Editor -{ - public class TreeLoader - { - private TreeNodeAsset asset; - - private List behaviorElements = new List(); - - private BehaviorTreeElement root; - - private List nodes; - private List connections = new List(); - - public BehaviorTreeElement LoadFromAsset(string path) - { - var filename = path.Substring(path.LastIndexOf("Assets/")); - asset = AssetDatabase.LoadAssetAtPath(filename); - - var elements = JsonConvert.DeserializeObject>(asset.treeElements); - - behaviorElements = new List(); - foreach (dynamic el in elements) - { - string typeName = el.ElementType; - Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(typeName); - dynamic newBehavior = Activator.CreateInstance(type, (string)el.Name, (int)el.Depth, (int)el.ID); - JsonConvert.PopulateObject(JsonConvert.SerializeObject(el), newBehavior); - behaviorElements.Add(newBehavior); - } - root = TreeElementUtility.ListToTree(behaviorElements); - return root; - } - - public List GetNodes(Action OnClickInPoint, Action OnClickOutPoint, Action OnClickRemoveNode) - { - nodes = new List(); - - for(int i = 0; i < behaviorElements.Count; ++i) - { - var nodeRect = asset.positions[i]; - var newNode = new BehaviorEditorNode(nodeRect.position, nodeRect.width, nodeRect.height, behaviorElements[i], OnClickInPoint, OnClickOutPoint, OnClickRemoveNode); - - nodes.Add(newNode); - } - - return nodes; - } - - internal List GetConnectionsFromRoot(BehaviorTreeElement root, Action onClickRemoveConnection) - { - for (int parentIndex = 0; parentIndex < behaviorElements.Count; parentIndex++) - { - var parent = behaviorElements[parentIndex]; - - int parentDepth = parent.Depth; - - // Count children based depth value, we are looking at children until it's the same depth as this object - for (int i = parentIndex + 1; i < behaviorElements.Count; i++) - { - if (behaviorElements[i].Depth == parentDepth + 1) - { - var inPoint = nodes[i].inPoint; - var connection = new Connection(nodes[i].inPoint, nodes[parentIndex].outPoint, onClickRemoveConnection); - nodes[i].inPoint.connections.Add(connection); - nodes[parentIndex].outPoint.connections.Add(connection); - connections.Add(connection); - } - - if (behaviorElements[i].Depth <= parentDepth) - break; - } - } - return connections; - } - } -} +using Assets.Scripts.AI; +using Assets.Scripts.AI.Tree; +using Assets.Visual_Behavior_Tree.Editor.NodeEditor; +using Assets.Visual_Behavior_Tree.Scripts; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Editor +{ + public class TreeLoader + { + private TreeNodeAsset asset; + + private List behaviorElements = new List(); + + private BehaviorTreeElement root; + + private List nodes; + private List connections = new List(); + + public BehaviorTreeElement LoadFromAsset(string path) + { + var filename = path.Substring(path.LastIndexOf("Assets/")); + asset = AssetDatabase.LoadAssetAtPath(filename); + + var elements = JsonConvert.DeserializeObject>(asset.treeElements); + + behaviorElements = new List(); + foreach (dynamic el in elements) + { + string typeName = el.ElementType; + Type type = Assembly.GetAssembly(typeof(BehaviorTreeElement)).GetType(typeName); + dynamic newBehavior = Activator.CreateInstance(type, (string)el.Name, (int)el.Depth, (int)el.ID); + JsonConvert.PopulateObject(JsonConvert.SerializeObject(el), newBehavior); + behaviorElements.Add(newBehavior); + } + root = TreeElementUtility.ListToTree(behaviorElements); + return root; + } + + public List GetNodes(Action OnClickInPoint, Action OnClickOutPoint, Action OnClickRemoveNode) + { + nodes = new List(); + + for(int i = 0; i < behaviorElements.Count; ++i) + { + var nodeRect = asset.positions[i]; + var newNode = new BehaviorEditorNode(nodeRect.position, nodeRect.width, nodeRect.height, behaviorElements[i], OnClickInPoint, OnClickOutPoint, OnClickRemoveNode); + + nodes.Add(newNode); + } + + return nodes; + } + + internal List GetConnectionsFromRoot(BehaviorTreeElement root, Action onClickRemoveConnection) + { + for (int parentIndex = 0; parentIndex < behaviorElements.Count; parentIndex++) + { + var parent = behaviorElements[parentIndex]; + + int parentDepth = parent.Depth; + + // Count children based depth value, we are looking at children until it's the same depth as this object + for (int i = parentIndex + 1; i < behaviorElements.Count; i++) + { + if (behaviorElements[i].Depth == parentDepth + 1) + { + var inPoint = nodes[i].inPoint; + var connection = new Connection(nodes[i].inPoint, nodes[parentIndex].outPoint, onClickRemoveConnection); + nodes[i].inPoint.connections.Add(connection); + nodes[parentIndex].outPoint.connections.Add(connection); + connections.Add(connection); + } + + if (behaviorElements[i].Depth <= parentDepth) + break; + } + } + return connections; + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/TreeSaver.cs b/Assets/Visual Behavior Tree/Editor/TreeSaver.cs index 40a2fd0..ac7c7f6 100644 --- a/Assets/Visual Behavior Tree/Editor/TreeSaver.cs +++ b/Assets/Visual Behavior Tree/Editor/TreeSaver.cs @@ -4,10 +4,7 @@ using Assets.Visual_Behavior_Tree.Editor.UIENodeEditor; using Assets.Visual_Behavior_Tree.Scripts; using Newtonsoft.Json; -using System; using System.Collections.Generic; -using System.IO; -using System.Reflection; using UnityEditor; using UnityEngine; diff --git a/Assets/Visual Behavior Tree/Editor/TreeValidator.cs b/Assets/Visual Behavior Tree/Editor/TreeValidator.cs index acd745b..1fadb79 100644 --- a/Assets/Visual Behavior Tree/Editor/TreeValidator.cs +++ b/Assets/Visual Behavior Tree/Editor/TreeValidator.cs @@ -1,64 +1,64 @@ -using Assets.Visual_Behavior_Tree.Editor.NodeEditor; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEngine; - -namespace Assets.Visual_Behavior_Tree.Editor -{ - public class TreeValidator - { - private List checkNodes; - private GUIStyle errorHighlightStyle; - - public TreeValidator(GUIStyle errorStyle) - { - errorHighlightStyle = errorStyle; - } - - public bool IsValidTreeByNodes(List nodes) - { - checkNodes = nodes; - return HasExactlyOneRootNode() && NoChildHasTwoParents(); - } - - private bool HasExactlyOneRootNode() - { - var rootNodes = checkNodes.FindAll(node => node.inPoint.connections.Count() == 0); - - if(rootNodes.Count > 1) - { - Debug.LogError("Behavior Tree Is INVALID! You cannot have more than one root node (node with no inConnections)! Check Highlighted nodes."); - HighlightErrorNodes(rootNodes); - return false; - } - - return true; - } - - private bool NoChildHasTwoParents() - { - var errorChildNodes = checkNodes.FindAll(node => node.inPoint.connections.Count() > 1); - - if(errorChildNodes.Count > 0) - { - Debug.LogError("Behavior Tree Is INVALID! You cannot have more than one parent node for a child! Check Highlighted nodes."); - - HighlightErrorNodes(errorChildNodes); - return false; - } - - return true; - } - - private void HighlightErrorNodes(List errorNodes) - { - foreach(var node in errorNodes) - { - node.style = errorHighlightStyle; - } - } - } -} +using Assets.Visual_Behavior_Tree.Editor.NodeEditor; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace Assets.Visual_Behavior_Tree.Editor +{ + public class TreeValidator + { + private List checkNodes; + private GUIStyle errorHighlightStyle; + + public TreeValidator(GUIStyle errorStyle) + { + errorHighlightStyle = errorStyle; + } + + public bool IsValidTreeByNodes(List nodes) + { + checkNodes = nodes; + return HasExactlyOneRootNode() && NoChildHasTwoParents(); + } + + private bool HasExactlyOneRootNode() + { + var rootNodes = checkNodes.FindAll(node => node.inPoint.connections.Count() == 0); + + if(rootNodes.Count > 1) + { + Debug.LogError("Behavior Tree Is INVALID! You cannot have more than one root node (node with no inConnections)! Check Highlighted nodes."); + HighlightErrorNodes(rootNodes); + return false; + } + + return true; + } + + private bool NoChildHasTwoParents() + { + var errorChildNodes = checkNodes.FindAll(node => node.inPoint.connections.Count() > 1); + + if(errorChildNodes.Count > 0) + { + Debug.LogError("Behavior Tree Is INVALID! You cannot have more than one parent node for a child! Check Highlighted nodes."); + + HighlightErrorNodes(errorChildNodes); + return false; + } + + return true; + } + + private void HighlightErrorNodes(List errorNodes) + { + foreach(var node in errorNodes) + { + node.style = errorHighlightStyle; + } + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs index f504e9f..7ea84a0 100644 --- a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.cs @@ -30,7 +30,6 @@ public Connection(ConnectionPoint inPoint, ConnectionPoint outPoint, Action("Assets/Visual Behavior Tree/Editor/UIENodeEditor/Connection/Connection.uss"); this.styleSheets.Add(styleSheet); - removeButton = new Button(); removeButton.AddToClassList("ConnectionButton"); removeButton.clicked += OnClicked; diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window.meta new file mode 100644 index 0000000..e14b48b --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 28967b4ae251bf541a5b21e5c420a3d4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorManagerSelector.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorManagerSelector.cs new file mode 100644 index 0000000..02165c2 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorManagerSelector.cs @@ -0,0 +1,34 @@ +using Assets.Scripts.AI; +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor.UIElements; +using UnityEngine.UIElements; + +namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Debug_Window +{ + public class BehaviorManagerSelector : VisualElement + { + public BehaviorManagerSelector(Func onSelectedChanged) + { + this.AddToClassList("Selector"); + var dropdown = new PopupField(GetDropdownList(),0); + dropdown.label = "Manager"; + this.Add(dropdown); + dropdown.formatSelectedValueCallback += onSelectedChanged; + } + + private List GetDropdownList() + { + var menuItems = new List(); + menuItems.Add("None"); + + var managers = from manager in UnityEngine.Object.FindObjectsOfType() + select manager.GetInstanceID() + "-" + manager.name; + + menuItems.AddRange(managers); + + return menuItems; + } + } +} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorManagerSelector.cs.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorManagerSelector.cs.meta new file mode 100644 index 0000000..4cf2551 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorManagerSelector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b4f70a7600ef144f9c89256998d4e1a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorTreeSelector.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorTreeSelector.cs new file mode 100644 index 0000000..bdcf08e --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorTreeSelector.cs @@ -0,0 +1,42 @@ +using Assets.Scripts.AI; +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor.UIElements; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Debug_Window +{ + public class BehaviorTreeSelector : VisualElement + { + public BehaviorManager RootManager; + public BehaviorTreeSelector(BehaviorManager manager, Func onSelectedChanged) + { + this.AddToClassList("Selector"); + RootManager = manager; + var dropdown = new PopupField(GetDropdownList(),0); + dropdown.label = "Tree"; + this.Add(dropdown); + dropdown.formatSelectedValueCallback += onSelectedChanged; + dropdown.formatListItemCallback += FormatItem; + } + + private List GetDropdownList() + { + var menuItems = new List(); + + var trees = from tree in RootManager.rootList + select tree.Key; + + menuItems.AddRange(trees); + + return menuItems; + } + + private string FormatItem(BehaviorTreeElement element) + { + return element.GetInstanceID() + "-" + element.Name; + } + } +} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorTreeSelector.cs.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorTreeSelector.cs.meta new file mode 100644 index 0000000..f3e9525 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/BehaviorTreeSelector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1b98ba5e907b19048b6078e1c401b28e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.cs new file mode 100644 index 0000000..078dc13 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.cs @@ -0,0 +1,139 @@ +using Assets.Scripts.AI; +using Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Debug_Window; +using Assets.Visual_Behavior_Tree.Scripts; +using System.Collections.Generic; +using System.Linq; +using UniRx; +using UnityEditor; +using UnityEditor.UIElements; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor +{ + public class DebugWindow : EditorWindow + { + List nodes = new List(); + + List connections = new List(); + + BehaviorManager selectedManager; + + [MenuItem("Testing/Behavior Debug Window")] + public static void Open() + { + DebugWindow wnd = GetWindow(); + wnd.titleContent = new GUIContent("Behavior Node Debugger"); + } + + private void OnEnable() + { + VisualElement root = rootVisualElement; + + var visualTree = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uxml"); + VisualElement uxmlRoot = visualTree.CloneTree(); + + var toolbar = uxmlRoot.Q("Toolbar"); + var dropdown = new BehaviorManagerSelector(OnSelectedManagerChanged); + + toolbar.Add(dropdown); + + root.Add(uxmlRoot); + + var container = rootVisualElement.Q("TabContainer"); + + //container.AddManipulator(new BehaviorEditorDragger(this)); + + var styleSheet = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uss"); + root.styleSheets.Add(styleSheet); + + this.SetAntiAliasing(4); + } + + private string OnSelectedManagerChanged(string selected) + { + var toolbar = rootVisualElement.Q("Toolbar"); + var selector = rootVisualElement.Q("TreeSelector"); + if (selector != null) toolbar.Remove(selector); + + + var idAndName = selected.Split('-'); + if (idAndName.Length > 1) + { + var matchedManager = from manager in UnityEngine.Object.FindObjectsOfType() + where manager.GetInstanceID() == int.Parse(idAndName[0]) + select manager; + selectedManager = matchedManager.First(); + + var treeDropdown = new BehaviorTreeSelector(selectedManager, OnSelectedTreeChanged); + treeDropdown.name = "TreeSelector"; + + toolbar.Add(treeDropdown); + } + + return selected; + } + + private string OnSelectedTreeChanged(BehaviorTreeElement selected) + { + Debug.Log(selected.name); + var asset = selectedManager.rootList[selected]; + LoadNodesFromAssetAndRoot(asset, selected); + + return selected.GetInstanceID() + "-" + selected.Name; + } + + private void LoadNodesFromAssetAndRoot(TreeNodeAsset asset, BehaviorTreeElement root) + { + var container = rootVisualElement.Q("TabContainer"); + if (nodes != null) + foreach (var node in nodes) + { + container.Remove(node); + } + + if (connections != null) + foreach (var connection in connections) + { + container.Remove(connection); + connection.MarkDirtyRepaint(); + } + + UIETreeLoader loader = new UIETreeLoader(); + var rootNode = loader.LoadFromAssetAndRoot(asset, root); + nodes = loader.GetNodes(OnClickInPoint, OnClickOutPoint, OnClickAddNode, OnClickRemoveNode); + connections = loader.GetConnectionsFromRoot(rootNode, OnClickRemoveConnection); + + foreach (var node in nodes) + { + container.Add(node); + } + + foreach (var connection in connections) + { + container.Add(connection); + connection.MarkDirtyRepaint(); + } + } + + private void OnClickRemoveNode(EditorNode obj) + {} + + private void OnClickAddNode(EditorNode node) + {} + + private void OnGUI() + { + rootVisualElement.Q("TabContainer").style.height = new StyleLength(position.height); + } + + private void OnClickInPoint(ConnectionPoint inPoint) + {} + + private void OnClickOutPoint(ConnectionPoint outPoint) + {} + + private void OnClickRemoveConnection(Connection obj) + {} + } +} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.cs.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.cs.meta new file mode 100644 index 0000000..8cd1686 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1096fa4f3fd25e742a56feb8ba7560f0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uss b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uss new file mode 100644 index 0000000..dcfa31f --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uss @@ -0,0 +1,31 @@ +#Toolbar +{ + height: 40px; + width: auto; + background-color: rgb(21, 132, 67); + + display: flex; + flex-direction: row; +} + +#TabContainer +{ + background-color: rgba(242, 246, 250,1); + width: auto; + height: auto; + overflow: hidden; +} + +.EditorNode { + width: auto; + height: auto; + position: absolute; +} + +.Connection { + position: absolute; +} + +.Selector { + align-self: flex-end; +} \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uss.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uss.meta new file mode 100644 index 0000000..35739d3 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uss.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 716dd544288b7d14c8416eec9cba1aed +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} + disableValidation: 0 diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uxml b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uxml new file mode 100644 index 0000000..06dc1c7 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uxml @@ -0,0 +1,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uxml.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uxml.meta new file mode 100644 index 0000000..8b0a1ca --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Debug Window/DebugWindow.uxml.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a850434b6f383fb45a505323764b0e59 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0} diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs index 4716e92..ec2716c 100644 --- a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.cs @@ -27,7 +27,7 @@ public static void ShowExample() wnd.titleContent = new GUIContent("Behavior Node Editor"); } - public void OnEnable() + private void OnEnable() { VisualElement root = rootVisualElement; @@ -84,13 +84,14 @@ where type.Name.Contains(selectedName) treeElement.Name = selectedName; treeElement.ElementType = typeName.First().ToString(); - EditorNode item = new EditorNode(treeElement, action.eventInfo.localMousePosition, OnClickInPoint, OnClickOutPoint, OnClickAddNode, OnClickRemoveNode); + Rect contentRect = new Rect(action.eventInfo.localMousePosition, Vector2.zero); + + EditorNode item = new EditorNode(treeElement, contentRect, OnClickInPoint, OnClickOutPoint, OnClickAddNode, OnClickRemoveNode); OnClickAddNode(item); } - void OnClickAddNode(EditorNode node) + private void OnClickAddNode(EditorNode node) { - Debug.Log("Adding " + node.TreeElement.Name); nodes.Add(node); rootVisualElement.Q("GridContainer").Add(node); } @@ -100,7 +101,7 @@ private void OnGUI() rootVisualElement.Q("GridContainer").style.height = new StyleLength(position.height); } - protected void OnClickInPoint(ConnectionPoint inPoint) + private void OnClickInPoint(ConnectionPoint inPoint) { selectedInPoint = inPoint; @@ -198,7 +199,7 @@ protected void LoadNodesFromFile() "asset"); UIETreeLoader loader = new UIETreeLoader(); - var root = loader.LoadFromAsset(path); + var root = loader.LoadFromPath(path); nodes = loader.GetNodes(OnClickInPoint, OnClickOutPoint, OnClickAddNode, OnClickRemoveNode); connections = loader.GetConnectionsFromRoot(root, OnClickRemoveConnection); @@ -221,7 +222,6 @@ private bool IsValidTree() private void OnClickRemoveNode(EditorNode node) { - Debug.Log("Removing " + node.TreeElement.Name); var container = rootVisualElement.Q("GridContainer"); if (connections != null) { diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss index a09be80..2915a28 100644 --- a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Editor Window/BehaviorEditorWindow.uss @@ -1,6 +1,6 @@ .EditorNode { - width: 200px; - height: 100px; + width: auto; + height: auto; position: absolute; } diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeResizer.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeResizer.cs new file mode 100644 index 0000000..effddfb --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeResizer.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Manipulators +{ + public class EditorNodeResizer : MouseManipulator + { + private EditorNode Node; + + public EditorNodeResizer(EditorNode node) + { + Node = node; + } + private Vector2 start; + protected bool isActive; + + protected override void RegisterCallbacksOnTarget() + { + target.RegisterCallback(OnMouseDown); + target.RegisterCallback(OnMouseMove); + target.RegisterCallback(OnMouseUp); + } + + protected override void UnregisterCallbacksFromTarget() + { + target.UnregisterCallback(OnMouseDown); + target.UnregisterCallback(OnMouseMove); + target.UnregisterCallback(OnMouseUp); + } + + private void OnMouseDown(MouseDownEvent evt) + { + if (isActive) + { + isActive = false; + evt.StopImmediatePropagation(); + return; + } + + start = evt.localMousePosition; + + isActive = true; + target.CaptureMouse(); + evt.StopPropagation(); + } + + private void OnMouseMove(MouseMoveEvent evt) + { + if (!isActive || !target.HasMouseCapture()) + return; + + Vector2 diff = evt.mousePosition - Node.worldBound.position; + + var rootContainer = Node.Q("RootContainer"); + + Node.style.width = diff.x; + Node.style.height = diff.y; + + rootContainer.style.width = diff.x; + rootContainer.style.height = diff.y; + + var inConnections = Node.inPoint.connections; + + foreach (var connection in inConnections) + { + connection.MarkDirtyRepaint(); + } + + if (Node.TreeElement.CanHaveChildren) + { + var outConnections = Node.outPoint.connections; + + foreach (var connection in outConnections) + { + connection.MarkDirtyRepaint(); + } + } + + evt.StopPropagation(); + } + + private void OnMouseUp(MouseUpEvent evt) + { + if (!isActive || !target.HasMouseCapture() || !CanStopManipulation(evt)) + return; + + isActive = false; + target.ReleaseMouse(); + evt.StopPropagation(); + } + } +} diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeResizer.cs.meta b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeResizer.cs.meta new file mode 100644 index 0000000..d04cd87 --- /dev/null +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeResizer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a60970ed4d74c34a9cf65da04a05bad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeSelector.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeSelector.cs index 020225c..5fc5485 100644 --- a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeSelector.cs +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Manipulators/EditorNodeSelector.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; -using UnityEngine; -using UnityEngine.UIElements; +using UnityEngine.UIElements; namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Manipulators { @@ -32,15 +25,17 @@ protected override void UnregisterCallbacksFromTarget() private void OnMouseDown(MouseDownEvent evt) { + var root = Node.Q("RootContainer"); + if (isSelected) { - Node.RemoveFromClassList("Selected"); + root.RemoveFromClassList("Selected"); isSelected = false; evt.StopImmediatePropagation(); return; } - Node.AddToClassList("Selected"); + root.AddToClassList("Selected"); isSelected = true; evt.StopPropagation(); diff --git a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs index a4378c4..8c94ceb 100644 --- a/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs +++ b/Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.cs @@ -1,20 +1,18 @@ -using UnityEditor; -using UnityEngine; -using UnityEngine.UIElements; -using UnityEditor.UIElements; using Assets.Scripts.AI; -using Assets.Scripts.AI.Components; -using UnityEditor.Experimental.GraphView; +using Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Manipulators; +using Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Node.EditorResizer; using System; using System.Collections.Generic; -using System.Reflection; -using UnityEngine.Analytics; -using Assets.Visual_Behavior_Tree.Editor.UIENodeEditor.Manipulators; using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEditor.UIElements; +using UnityEngine; +using UnityEngine.UIElements; namespace Assets.Visual_Behavior_Tree.Editor.UIENodeEditor { - public class EditorNode : Box + public class EditorNode : VisualElement { public BehaviorTreeElement TreeElement; @@ -26,26 +24,19 @@ public class EditorNode : Box private Action OnClickAddNode; private Action OnClickRemoveNode; - public EditorNode(BehaviorTreeElement wrappedElement, Vector2 position, Action onClickInPoint, Action onClickOutPoint, Action onClickAddNode, Action onClickRemoveNode) + public EditorNode(BehaviorTreeElement wrappedElement, Rect content, Action onClickInPoint, Action onClickOutPoint, Action onClickAddNode, Action onClickRemoveNode) { var styleSheet = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uss"); this.styleSheets.Add(styleSheet); - var visualTree = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uxml"); - VisualElement uxmlRoot = visualTree.Instantiate(); - this.Add(uxmlRoot); - - var parentContainer = uxmlRoot.Q("ParentConnectorContainer"); inPoint = new ConnectionPoint(this, ConnectionPointType.In, onClickInPoint); - inPoint.AddToClassList("NodeButton"); - parentContainer.Insert(1,inPoint); - outPoint = new ConnectionPoint(this, ConnectionPointType.Out, onClickOutPoint); this.AddToClassList("EditorNode"); - - this.style.left = position.x; - this.style.top = position.y; + if(content.width > 0) this.style.width = content.width; + if(content.height > 0) this.style.height = content.height; + this.style.left = content.position.x; + this.style.top = content.position.y; this.AddManipulator(new NodeDragger()); this.AddManipulator(new EditorNodeSelector(this)); @@ -93,14 +84,32 @@ where type.Name.Contains(selectedName) treeElement.ElementType = typeName.First().ToString(); this.TreeElement = treeElement; ElementObject = new SerializedObject(TreeElement); + OnClickAddNode(this); ReBindAllProperties(); } internal void ReBindAllProperties() { + this.Clear(); this.Bind(ElementObject); + var visualTree = AssetDatabase.LoadAssetAtPath("Assets/Visual Behavior Tree/Editor/UIENodeEditor/Node/EditorNode.uxml"); + VisualElement uxmlRoot = visualTree.Instantiate(); + this.Add(uxmlRoot); + + var rootContainer = uxmlRoot.Q("RootContainer"); + + rootContainer.style.width = this.style.width; + rootContainer.style.height = this.style.height; + + var parentContainer = uxmlRoot.Q("ParentConnectorContainer"); + inPoint.AddToClassList("NodeButton"); + parentContainer.Insert(1, inPoint); + + var typeLabel = this.Q