diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..7029950 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +*.mat merge=unityyamlmerge eol=lf +*.anim merge=unityyamlmerge eol=lf +*.unity merge=unityyamlmerge eol=lf +*.prefab merge=unityyamlmerge eol=lf +*.physicsMaterial2D merge=unityyamlmerge eol=lf +*.physicMaterial merge=unityyamlmerge eol=lf +*.asset merge=unityyamlmerge eol=lf +*.meta merge=unityyamlmerge eol=lf +*.controller merge=unityyamlmerge eol=lf \ No newline at end of file diff --git a/.gitignore b/.gitignore index cb06110..1eb89e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,17 @@ +*/Library +*/Assets/UnityVS +*/Temp +*/obj +*/Assets/UnityVS.meta +*/.vs +*/_Resharper.* +*/.idea +*/Logs -/example/Library -/example/ProjectSettings -/example/Temp/CaseSensitiveTest -/example/Temp/WindowsLockFile -/example/Temp -/example_project/Library -/example_project/Assets/UnityVS -/example_project/Temp -/example_project/obj -/example_project/*.suo -/example_project/*.DotSettings -/example_project/Assets/UnityVS.meta -/example_project/*.unityproj -/example_project/.vs -/example_project/_Resharper.* +*/Assets/Plugins/Editor/Jetbrains/** +*/Assets/Plugins/Editor/Jetbrains.meta +*.DotSettings +*.DotSettings.user +*.unityproj +*.suo \ No newline at end of file diff --git a/MonsterLove-StateMachine.unitypackage b/MonsterLove-StateMachine.unitypackage deleted file mode 100644 index ef877c0..0000000 Binary files a/MonsterLove-StateMachine.unitypackage and /dev/null differ diff --git a/README.md b/README.md index 725654e..da45dc8 100644 --- a/README.md +++ b/README.md @@ -1,118 +1,259 @@ -# Unity3D - Simple Finite State Machine (C#) +# Simple Finite State Machine for Unity (C#) -State machines are a very effective way to manage game state, either on your main game play object (Game Over, Restart, Continue etc) or on individual actors and NPCs (AI behaviours, Animations, etc). The following is a simple state machine that should work well within any Unity context. +State machines are a very effective way to manage game state, either on your main game play object (Game Over, Restart, Continue etc) or UI (buttonHover, buttonPress etc) or on individual actors and NPCs (AI behaviours, Animations, etc). The following is a simple state machine that should work well within any Unity context. -## Designed with simplicity in mind +## Designed for simplicity -Most state machines come from the world of C# enterprise, and are wonderfully complicated or require a lot of boilerplate code. State Machines however are an incredibly useful pattern in game development, administrative overhead should never be a burden that discourages you from writing good code. +The textbook state machine implementation, and by extension other C# state machine libraries, have a tendency towards complicated configuration or excessive boilerplate. StateMachines are incredibly useful though - administrative overhead should never prevent us from improving readability, fixing bugs, and otherwise writing good code. -* Simple use of Enums as state definition. -* Minimal initialization - one line of code. -* Incredibly easy to add/remove states -* Uses reflection to avoid boiler plate code - only write the methods you actually need. -* Compatible with Coroutines. -* Tested on iOS and Android +* **Create states at the speed of thought:** Just add Enum fields! +* **Effectively reason about your code:** Everything is in one place directly inside your MonoBehaviour. +* **Use what you know about Unity:** Doing things the "Unity" way avoids unexpected weirdness and side effects. +* **Only write the methods you're going to use:** Clever under-the-hood reflection saves you from writing tedious boilerplate. -## Usage +However, working programmers still need to ship production code. Correctness and performance should not be sacrificed in the name of convenience. + +* Extensive unit test coverage +* Garbage allocation free after initialization +* Battle hardened and shipped in production code +* Suports iOS/Android/IL2CPP -An example project is included (Unity 5.0) to show the State Machine in action. -To use the state machine you need a few simple steps +## Usage -##### Include the StateMachine package +The included example project (for Unity 2019.4) shows the State Machine in action. However, the following is everything you need to get going immediately: ```C# -using MonsterLove.StateMachine; //Remember the using statement before the class declaration +using MonsterLove.StateMachine; //1. Remember the using statement -public class MyManagedComponent : MonoBehaviour +public class MyGameplayScript : MonoBehaviour { + public enum States + { + Init, + Play, + Win, + Lose + } + + StateMachine fsm; + + void Awake(){ + fsm = new StateMachine(this); //2. The main bit of "magic". + + fsm.ChangeState(States.Init); //3. Easily trigger state transitions + } + + void Init_Enter() + { + Debug.Log("Ready"); + } + + void Play_Enter() + { + Debug.Log("Spawning Player"); + } + + void Play_FixedUpdate() + { + Debug.Log("Doing Physics stuff"); + } + + void Play_Update() + { + if(player.health <= 0) + { + fsm.ChangeState(States.Lose); //3. Easily trigger state transitions + } + } + + void Play_Exit() + { + Debug.Log("Despawning Player"); + } + + void Win_Enter() + { + Debug.Log("Game Over - you won!"); + } + + void Lose_Enter() + { + Debug.Log("Game Over - you lost!"); + } } ``` -##### Define your states using an Enum +### State Methods are defined by underscore convention ( `StateName_Method` ) + +Like MonoBehavior methods (`Awake`, `Updates`, etc), state methods are defined by convention. Declare a method in the format `StateName_Method`, and this will be associated with any matching names in the provided enum. ```C# -public enum States +void enum States { - Init, Play, - Win, - Lose +} + + +//Coroutines are supported, simply return IEnumerator +IEnumerator Play_Enter() +{ + yield return new WaitForSeconds(1); + + Debug.Log("Start"); +} + + +IEnumerator Play_Exit() +{ + yield return new WaitForSeconds(1); +} + +void Play_Finally() +{ + Debug.Log("GameOver"); +} +``` +These built-in methods are always available, triggered automatically by `ChangeState(States newState)` calls: +- `Enter` +- `Exit` +- `Finally` + +Both `Enter` and `Exit` support co-routines, simply return `IEnumerator`. However, return `void`, and they will be called immediately with no overhead. `Finally` is always called after `Exit` and provides an opportunity to perform clean-up and hygiene in special cases where the `Exit` routine might be interrupted before completing (see the Transitions heading). + +## Data-Driven State Events + +To define additional events, we need to specify a `Driver`. + +```C# +public class Driver +{ + StateEvent Update; + StateEvent OnCollisionEnter; + StateEvent OnHealthPickup; } ``` -##### Create a variable to store a reference to the State Machine + +This is a very simple class. It doesn't have to be called `Driver`; the only constraint is that it must contain `StateEvent` fields. When we pass this to our state machine definition, it will take care of everything needed to set up new State event hooks. ```C# -StateMachine fsm; +StateMachine fsm; + +void Awake(){ + fsm = new StateMachine(this); +} + +void Play_Enter() +{ + Debug.Log("Started"); +} + +void Play_Update() +{ + Debug.Log("Ticked"); +} + +void Play_OnHealthPickup(int health) +{ + //Add to player health +} + ``` -##### Get a valid state machine for your MonoBehaviour +As these are custom events, the final step is to tell the state machine when these should be fired. ```C# -fsm = StateMachine.Initialize(this); +void Update() +{ + fsm.Driver.Update.Invoke(); +} + +void OnCollisionEnter(Collision collision) +{ + fsm.Driver.OnCollisionEnter.Invoke(collision); +} + +void OnHealthPickup(int health) +{ + fsm.Driver.OnHealthPickup.Invoke(); +} ``` -This is where all of the magic in the StateMachine happens: in the background it inspects your MonoBehaviour (`this`) and looks for any methods described by the convention shown below. +##### Driver Deep-Dive + +Compared to the rest of the StateMachine, the `Driver` might elicit a reaction of: *"Hey! You said there wasn't going to be any funny business here!"* -You can call this at any time, but generally `Awake()` is a safe choice. +Indeed, there aren't many analogues in either C# or Unity. Before `v4.0`, the state machine would dynamically assign a `StateMachineRunner` component that would call `FixedUpdate`,`Update` & `LateUpate` hooks. (For backwards compatibility this is still the default behaviour when omitting a `Driver`). This worked, but additional hooks meant forking the `StateMachineRunner` class. Also, as a separate MonoBehaviour, it has it's own script execution order which could sometimes lead to oddities. + +But with the user responsible for invoking events - eg `fsm.Drive.Update.Invoke()`, it becomes much easier to reason about the lifecycle of the fsm. No more having to guess whether the StateMachine will update before or after the rest of the class, because the trigger is right there. It can be moved to right spot in the main `Update()` call. -##### You are now ready to manage state by simply calling `ChangeState()` ```C# -fsm.ChangeState(States.Init); +void Update() +{ + //Do Stuff + + fsm.Driver.Update.Invoke(); + + //Do Other Stuff +} + +void Play_Update() +{ + //No guessing when this happens +} ``` -##### State callbacks are defined by underscore convention ( `StateName_Method` ) +The real power shines when we consider another anti-pattern. Calling a state change from outside the state machine can lead to unintended side-effects. Imagine the following scenario where a global call causes a state transition. However without ```C# -void Init_Enter() +public void EndGame() { - Debug.Log("We are now ready"); + fsm.ChangeState(States.GameOver); } -//Coroutines are supported, simply return IEnumerator -IEnumerator Play_Enter() +void Idle_Update() { - Debug.Log("Game Starting in 3"); - yield return new WaitForSeconds(1); - - Debug.Log("Game Starting in 2"); - yield return new WaitForSeconds(1); - - Debug.Log("Game Starting in 1"); - yield return new WaitForSeconds(1); - - Debug.Log("Start"); + //Changing to GameOver would cause unintended things to happen } void Play_Update() { - Debug.Log("Game Playing"); + //GameOver is legal } +``` -void Play_Exit() +Some libraries deal with this by defining transitons tables. However, it's possible to achieve a similar outcome using state events: +```C# +public class Driver() { - Debug.Log("Game Over"); + public StateEvent OnEndGame; } -``` -Currently supported methods are: -- `Enter` -- `Exit` -- `FixedUpdate` -- `Update` -- `LateUpdate` -- `Finally` +public void EndGame() +{ + fsm.Driver.OnEndGame.Invoke(); +} -It should be easy enough to extend the source to include other Unity Methods such as OnTriggerEnter, OnMouseDown etc +void Idle_Update() +{ + //Changing to GameOver would cause unintended things to happen +} -These methods can be private or public. The methods themselves are all optional, so you only need to provide the ones you actually intend on using. +void Play_Update() +{ + //GameOver is legal +} -Couroutines are supported on Enter and Exit, simply return `IEnumerator`. This can be great way to accommodate animations. Note: `FixedUpdate`, `Update` and `LateUpdate` calls won't execute while an Enter or Exit routine is running. +void Play_OnEndGame() +{ + fsm.ChangeState(State.GameOver); +} +``` +Now the `Play` state is only state that can respond to EndGame calls. This creates an implicit transition table as sort of "free" side-effect. -Finally is a special method guaranteed to be called after a state has exited. This is a good place to perform any hygiene operations such as removing event listeners. Note: Finally does not support coroutines. -##### Transitions +## Async Transitions There is simple support for managing asynchronous state changes with long enter or exit coroutines. @@ -120,7 +261,7 @@ There is simple support for managing asynchronous state changes with long enter fsm.ChangeState(States.MyNextState, StateTransition.Safe); ``` -The default is `StateTransition.Safe`. This will always allows the current state to finish both it's enter and exit functions before transitioning to any new states. +The default is `StateTransition.Safe`. This will always allows the current state to finish both its enter and exit functions before transitioning to any new states. ```C# fsm.ChangeState(States.MyNextState, StateTransition.Overwrite); @@ -135,35 +276,25 @@ void MyCurrentState_Finally() } ``` -##### Dependencies +## Upgrading from v3 and above - April 2020 -There are no dependencies, but if you're working with the source files, the tests rely on the UnityTestTools package. These are non-essential, only work in the editor, and can be deleted if you so choose. +Version `4.0` brings substantial innovation, however the API strives for backwards compatibility which means all the code you've already written does not need to change. However, the layout of the files inside the package has changed. To avoid errors it is recommended you delete the existing `MonsterLove` folder containing `StateMachine.cs` and related files, then reimport the new package. -## Upgrade Notes - March 2016 - v3.0 +## Performance & Limitations -Version 3 brings with it a substantial redesign of the library to overcome limitations plaguing the previous iteration (now supports multiple states machines per component, instant Enter & Exit calls, more robust initialization, etc). As such there is a now a more semantic class organisation with `StateMachine` & `StateMachineRunner`. +##### Design Philosophy -It is recommend you delete the previous package before upgrading, **but this will break your code!** +The state machine is designed to maximise simplicity for the end-user. To achieve this, under the hood lies some intricate reflection "magic". Reflection is a controversial choice because it is slow - and that's no exception here. However, we seek to balance the trade-off by limiting all the reflection to a single call when the state machine is initialised. This does degrade instantiation performance, however, instantiation is already slow. It's expected that strategies such as object pooling (recycling objects spawned on startup instead of at runtime) are already in effect, which moves this cost to a time when the user is unlikely to notice it. -To do a complete upgrade you will need to rewrite initialization as per above. You will also need to replace missing `StateEngine` component references with `StateMachineRunner` in the Unity editor. If you want a workaround in order to do a gradual upgrade without breaking changes, you can change the namespace of the `StateMachine` and `StateMachineRunner` and you will be able to use it alongside v2 code until you feel confident enough to do a full upgrade. +Once the initialisation cost has been swallowed, the State Machine aims to be a good citizen at runtime, avoiding allocations that cause garbage pressure and aiming for respectable performance. Ensuring correctness does mean that calling StateEvents' `Invoke()` is slower than naked method calls. Over tens of thousands of instances this can add up to a significant overhead. In these use cases (multiple 1000's of objects) it is recommended to replace the state machine with something hand-tuned. -## Implementation and Shortcomings - -This implementation uses reflection to automatically bind the state methods callbacks for each state. This saves you having to write endless boilerplate and generally makes life a lot more pleasant. But of course reflection is slow, so we try minimize this by only doing it once during the call to `Initialize`. - -For most objects this won't be a problem, but note that if you are spawning many objects during game play it might pay to make use of an object pool, and initialize objects on start up instead. (This is generally good practice anyway). - -##### Manual Initialization -In performance critical situations (e.g. thousands of instances) you can optimize initialization further but manually configuring the StateMachineRunner component. You will need to manually add this to a GameObject and then call: -```C# -StateMachines fsm = GetComponent().Initialize(componentReference); -``` +However, for most general use cases, eg manager classes, or other items with low instance counts (10's or 100's) - the difference in performance should absolutely not be something you need to think about. ##### Memory Allocation Free? -This is designed to target mobile, as such should be memory allocation free. However the same rules apply as with the rest of unity in regards to using `IEnumerator` and Coroutines. +This is designed to target mobile, as such should be memory allocation free. However the same rules apply as with the rest of Unity in regards to using `IEnumerator` and Coroutines. ##### Windows Store Platforms -Due to differences in the Windows Store flavour of .Net, this is currently incompatible. More details available in this [issue](https://github.com/thefuntastic/Unity3d-Finite-State-Machine/issues/4). +Due to differences in the Windows Store flavour of .Net and WinRT, this platform is currently incompatible. More details available in this [issue](https://github.com/thefuntastic/Unity3d-Finite-State-Machine/issues/4). ## License MIT License @@ -175,5 +306,4 @@ This is state machine is used extensively on the [Made With Monster Love](http:/ This library owes its origins to the state machine found at http://unitygems.com/ (available via [The Internet Archive](http://web.archive.org/web/20140902150909/http://unitygems.com/fsm1/) as of Nov 2014). The original project, however, had many short comings that made usage difficult. Adhering to the principle that a library should do one thing really well, what we have now is perhaps the easiest and most straight forward State Machine in existence for Unity. ##### Feedback and suggestions: -- http://www.thefuntastic.com/2012/04/simple-finite-state-machine/ - http://www.twitter.com/thefuntastic diff --git a/example_project/.gitignore b/StateMachine/.gitignore similarity index 100% rename from example_project/.gitignore rename to StateMachine/.gitignore diff --git a/example_project/Assets/MonsterLove.meta b/StateMachine/Assets/MonsterLove.meta similarity index 100% rename from example_project/Assets/MonsterLove.meta rename to StateMachine/Assets/MonsterLove.meta diff --git a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine.meta b/StateMachine/Assets/MonsterLove/Runtime.meta similarity index 63% rename from example_project/Assets/Editor/MonsterLove/Tests/StateMachine.meta rename to StateMachine/Assets/MonsterLove/Runtime.meta index 90a34ad..4bb2ca4 100644 --- a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine.meta +++ b/StateMachine/Assets/MonsterLove/Runtime.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 10cbb6ec5afcb3844a54136dd78247ce +guid: 8608d2a9134ccf94c8f0036d61c0b622 folderAsset: yes DefaultImporter: userData: diff --git a/example_project/Assets/TestCases/Helper.meta b/StateMachine/Assets/MonsterLove/Runtime/Drivers.meta similarity index 57% rename from example_project/Assets/TestCases/Helper.meta rename to StateMachine/Assets/MonsterLove/Runtime/Drivers.meta index 18bc406..6c4ec34 100644 --- a/example_project/Assets/TestCases/Helper.meta +++ b/StateMachine/Assets/MonsterLove/Runtime/Drivers.meta @@ -1,9 +1,8 @@ fileFormatVersion: 2 -guid: 2c39877347b5e8941812947d66b10c22 +guid: 6d19f3162564ec54aa39985d42873958 folderAsset: yes -timeCreated: 1433410911 -licenseType: Free DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/StateMachine/Assets/MonsterLove/Runtime/Drivers/StateDriverRunner.cs b/StateMachine/Assets/MonsterLove/Runtime/Drivers/StateDriverRunner.cs new file mode 100644 index 0000000..9669a09 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Runtime/Drivers/StateDriverRunner.cs @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2019 Made With Monster Love (Pty) Ltd + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace MonsterLove.StateMachine +{ + public class StateDriverRunner + { + public StateEvent FixedUpdate; + public StateEvent Update; + public StateEvent LateUpdate; + } +} diff --git a/example_project/Assets/TestCases/ClassDeactivateDuringChange.cs.meta b/StateMachine/Assets/MonsterLove/Runtime/Drivers/StateDriverRunner.cs.meta similarity index 69% rename from example_project/Assets/TestCases/ClassDeactivateDuringChange.cs.meta rename to StateMachine/Assets/MonsterLove/Runtime/Drivers/StateDriverRunner.cs.meta index aa39c83..56eb635 100644 --- a/example_project/Assets/TestCases/ClassDeactivateDuringChange.cs.meta +++ b/StateMachine/Assets/MonsterLove/Runtime/Drivers/StateDriverRunner.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: c8468bd71286f2a4eabc01f65df28efc -timeCreated: 1433410911 -licenseType: Free +guid: 8580b7087fdeecd4fb42025a957800f3 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/StateMachine/Assets/MonsterLove/Runtime/Drivers/StateDriverUnity.cs b/StateMachine/Assets/MonsterLove/Runtime/Drivers/StateDriverUnity.cs new file mode 100644 index 0000000..5eaef8d --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Runtime/Drivers/StateDriverUnity.cs @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2019 Made With Monster Love (Pty) Ltd + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +using UnityEngine; + +namespace MonsterLove.StateMachine +{ + public class StateDriverUnity + { + public StateEvent Awake; + public StateEvent LateUpdate; + public StateEvent OnAnimatorIK; + public StateEvent OnAnimatorMove; + public StateEvent OnApplicationFocus; + public StateEvent OnApplicationPause; + public StateEvent OnApplicationQuit; + public StateEvent OnAudioFilterRead; + public StateEvent OnBecameInvisible; + public StateEvent OnBecameVisible; + public StateEvent OnCollisionEnter; + public StateEvent OnCollisionEnter2D; + public StateEvent OnCollisionExit; + public StateEvent OnCollisionExit2D; + public StateEvent OnCollisionStay; + public StateEvent OnCollisionStay2D; + public StateEvent OnConnectedToServer; + public StateEvent OnControllerColliderHit; + public StateEvent OnDestroy; + public StateEvent OnDisable; + public StateEvent OnDrawGizmos; + public StateEvent OnDrawGizmosSelected; + public StateEvent OnEnable; + public StateEvent OnGUI; + public StateEvent OnJointBreak; + public StateEvent OnJointBreak2D; + public StateEvent OnMouseDown; + public StateEvent OnMouseDrag; + public StateEvent OnMouseEnter; + public StateEvent OnMouseExit; + public StateEvent OnMouseOver; + public StateEvent OnMouseUp; + public StateEvent OnMouseUpAsButton; + public StateEvent OnParticleCollision; + public StateEvent OnParticleSystemStopped; + public StateEvent OnParticleTrigger; + public StateEvent OnPostRender; + public StateEvent OnPreCull; + public StateEvent OnRenderImage; + public StateEvent OnRenderObject; + public StateEvent OnTransformChildrenChanged; + public StateEvent OnTransformParentChanged; + public StateEvent OnTriggerEnter; + public StateEvent OnTriggerEnter2D; + public StateEvent OnTriggerExit; + public StateEvent OnTriggerExit2D; + public StateEvent OnTriggerStay; + public StateEvent OnTriggerStay2D; + public StateEvent OnValidate; + public StateEvent OnWillRenderOjbect; + public StateEvent Reset; + public StateEvent Start; + public StateEvent Update; + + //Unity Networking Deprecated + //public StateEvent OnDisconnectedFromServer; + //public StateEvent OnFailedToConnect; + //public StateEvent OnFailedToConnectToMasterServer; + //public StateEvent OnMasterServerEvent; + //public StateEvent OnNetworkInstantiate; + //public StateEvent OnPlayerConnected; + //public StateEvent OnPlayerDisconnected; + //public StateEvent OnSerializeNetworkView; + //public StateEvent OnSeverInitialized; + + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Runtime/Drivers/StateDriverUnity.cs.meta b/StateMachine/Assets/MonsterLove/Runtime/Drivers/StateDriverUnity.cs.meta new file mode 100644 index 0000000..452a652 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Runtime/Drivers/StateDriverUnity.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: de0d37dba910471099253a3cc12484fb +timeCreated: 1567762416 \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Runtime/Events.meta b/StateMachine/Assets/MonsterLove/Runtime/Events.meta new file mode 100644 index 0000000..cfbc1a8 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Runtime/Events.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 26a1a054d8aa3a94cac21be251c4e634 +timeCreated: 1568024794 \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Runtime/Events/StateEvent.cs b/StateMachine/Assets/MonsterLove/Runtime/Events/StateEvent.cs new file mode 100644 index 0000000..daadcd9 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Runtime/Events/StateEvent.cs @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2019 Made With Monster Love (Pty) Ltd + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +using System; +using System.Collections.Generic; + +// Warning! +// This is somewhat fragile Event pattern implementation. Recommended they aren't used outside of the state machine +// +namespace MonsterLove.StateMachine +{ + public class StateEvent + { + private Func getStateInt; + private Func isInvokeAllowed; + private Action[] routingTable; + + public StateEvent(Func isInvokeAllowed, Func stateProvider, int capacity) + { + this.isInvokeAllowed = isInvokeAllowed; + this.getStateInt = stateProvider; + routingTable = new Action[capacity]; + } + + internal void AddListener(int stateInt, Action listener) + { + routingTable[stateInt] = listener; + } + + public void Invoke() + { + if (isInvokeAllowed != null && !isInvokeAllowed()) + { + return; + } + + Action call = routingTable[getStateInt()]; + if (call != null) + { + call(); + return; + } + } + } + + public class StateEvent + { + private Func getStateInt; + private Func isInvokeAllowed; + private Action[] routingTable; + + public StateEvent(Func isInvokeAllowed, Func stateProvider, int capacity) + { + this.isInvokeAllowed = isInvokeAllowed; + this.getStateInt = stateProvider; + routingTable = new Action[capacity]; + } + + internal void AddListener(int stateInt, Action listener) + { + routingTable[stateInt] = listener; + } + + public void Invoke(T param) + { + if (isInvokeAllowed != null && !isInvokeAllowed()) + { + return; + } + + Action call = routingTable[getStateInt()]; + if (call != null) + { + call(param); + return; + } + } + } + + public class StateEvent + { + private Func getStateInt; + private Func isInvokeAllowed; + private Action[] routingTable; + + public StateEvent(Func isInvokeAllowed, Func stateProvider, int capacity) + { + this.isInvokeAllowed = isInvokeAllowed; + this.getStateInt = stateProvider; + routingTable = new Action[capacity]; + } + + internal void AddListener(int stateInt, Action listener) + { + routingTable[stateInt] = listener; + } + + public void Invoke(T1 param1, T2 param2) + { + if (isInvokeAllowed != null && !isInvokeAllowed()) + { + return; + } + + Action call = routingTable[getStateInt()]; + if (call != null) + { + call(param1, param2); + return; + } + } + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Runtime/Events/StateEvent.cs.meta b/StateMachine/Assets/MonsterLove/Runtime/Events/StateEvent.cs.meta new file mode 100644 index 0000000..8109d58 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Runtime/Events/StateEvent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a130ac4a15eb4a0cabf018a385e09999 +timeCreated: 1568024803 \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Runtime/MonsterLove.StateMachine.Runtime.asmdef b/StateMachine/Assets/MonsterLove/Runtime/MonsterLove.StateMachine.Runtime.asmdef new file mode 100644 index 0000000..da48e0e --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Runtime/MonsterLove.StateMachine.Runtime.asmdef @@ -0,0 +1,13 @@ +{ + "name": "MonsterLove.StateMachine.Runtime", + "references": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Runtime/MonsterLove.StateMachine.Runtime.asmdef.meta b/StateMachine/Assets/MonsterLove/Runtime/MonsterLove.StateMachine.Runtime.asmdef.meta new file mode 100644 index 0000000..95d2d4a --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Runtime/MonsterLove.StateMachine.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 39f9fc2c98cf6654498562b4bdd17a1e +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/StateMachine/Assets/MonsterLove/Runtime/StateMachine.cs b/StateMachine/Assets/MonsterLove/Runtime/StateMachine.cs new file mode 100644 index 0000000..469b448 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Runtime/StateMachine.cs @@ -0,0 +1,659 @@ +/* + * Copyright (c) 2019 Made With Monster Love (Pty) Ltd + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.CompilerServices; +using UnityEngine; +using Object = System.Object; + +namespace MonsterLove.StateMachine +{ + public enum StateTransition + { + Safe, + Overwrite, + } + + public interface IStateMachine + { + MonoBehaviour Component { get; } + TDriver Driver { get; } + bool IsInTransition { get; } + } + + public class StateMachine : StateMachine where TState : struct, IConvertible, IComparable + { + public StateMachine(MonoBehaviour component) : base(component) + { + } + } + + public class StateMachine : IStateMachine where TState : struct, IConvertible, IComparable where TDriver : class, new() + { + public event Action Changed; + + public bool reenter = false; + private MonoBehaviour component; + + private StateMapping lastState; + private StateMapping currentState; + private StateMapping destinationState; + private StateMapping queuedState; + private TDriver rootDriver; + + private Dictionary> stateLookup; + private Func enumConverter; + + private bool isInTransition = false; + private IEnumerator currentTransition; + private IEnumerator exitRoutine; + private IEnumerator enterRoutine; + private IEnumerator queuedChange; + + private static BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; + +#region Initialization + + public StateMachine(MonoBehaviour component) + { + this.component = component; + + //Compiler shenanigans to get ints from generic enums + Func identity = Identity; + enumConverter = Delegate.CreateDelegate(typeof(Func), identity.Method) as Func; + + //Define States + var enumValues = Enum.GetValues(typeof(TState)); + if (enumValues.Length < 1) + { + throw new ArgumentException("Enum provided to Initialize must have at least 1 visible definition"); + } + + var enumBackingType = Enum.GetUnderlyingType(typeof(TState)); + if(enumBackingType != typeof(int)) + { + throw new ArgumentException("Only enums with an underlying type of int are supported"); + } + + //Find all items in Driver class + // public class Driver + // { + // StateEvent Foo; <- Selected + // StateEvent Boo; <- Selected + // float x; <- Throw exception + // } + List eventFields = GetFilteredFields(typeof(TDriver), "MonsterLove.StateMachine.StateEvent"); + Dictionary eventFieldsLookup = CreateFieldsLookup(eventFields); + + //Instantiate driver + // driver = new Driver(); + // for each StateEvent: + // StateEvent foo = new StateEvent(isAllowed, getStateInt, capacity); + rootDriver = CreateDriver(IsDispatchAllowed, GetStateInt, enumValues.Length, eventFields); + + // Create a state mapping for each state defined in the enum + stateLookup = CreateStateLookup(this, enumValues); + + //Collect methods in target component + MethodInfo[] methods = component.GetType().GetMethods(bindingFlags); + + //Bind methods to states + for (int i = 0; i < methods.Length; i++) + { + TState state; + string evtName; + if (!ParseName(methods[i], out state, out evtName)) + { + continue; //Skip methods where State_Event name convention could not be parsed + } + + StateMapping mapping = stateLookup[state]; + + if (eventFieldsLookup.ContainsKey(evtName)) + { + //Bind methods defined in TDriver + // driver.Foo.AddListener(StateOne_Foo); + FieldInfo eventField = eventFieldsLookup[evtName]; + BindEvents(rootDriver, component, state, enumConverter(state), methods[i], eventField); + } + else + { + //Bind Enter, Exit and Finally Methods + BindEventsInternal(mapping, component, methods[i], evtName); + } + } + + //Create nil state mapping + currentState = null; + } + + static List GetFilteredFields(Type type, string searchTerm) + { + List list = new List(); + + FieldInfo[] fields = type.GetFields(bindingFlags); + + for (int i = 0; i < fields.Length; i++) + { + FieldInfo item = fields[i]; + if (item.FieldType.ToString().Contains(searchTerm)) + { + list.Add(item); + } + else + { + throw new ArgumentException(string.Format("{0} contains unsupported type {1}", type, item.FieldType)); + } + } + + return list; + } + + static Dictionary CreateFieldsLookup(List fields) + { + var dict = new Dictionary(); + + for (int i = 0; i < fields.Count; i++) + { + FieldInfo item = fields[i]; + + dict.Add(item.Name, item); + } + + return dict; + } + + static Dictionary> CreateStateLookup(StateMachine fsm, Array values) + { + var stateLookup = new Dictionary>(); + for (int i = 0; i < values.Length; i++) + { + var mapping = new StateMapping(fsm, (TState) values.GetValue(i), fsm.GetState); + stateLookup.Add(mapping.state, mapping); + } + + return stateLookup; + } + + static TDriver CreateDriver(Func isInvokeAllowedCallback, Func getStateIntCallback, int capacity, List fieldInfos) + { + if (fieldInfos == null) + { + throw new ArgumentException(string.Format("Arguments cannot be null. Callback {0} fieldInfos {1}", isInvokeAllowedCallback, fieldInfos)); + } + + TDriver driver = new TDriver(); + + for (int i = 0; i < fieldInfos.Count; i++) + { + //driver.Event = new StateEvent(callback) + FieldInfo fieldInfo = fieldInfos[i]; //Event + ConstructorInfo constructorInfo = fieldInfo.FieldType.GetConstructor(new Type[] {typeof(Func), typeof(Func), typeof(int)}); //StateEvent(Func invokeAllowed, Func getState, int capacity) + object obj = constructorInfo.Invoke(new object[] {isInvokeAllowedCallback, getStateIntCallback, capacity}); //obj = new StateEvent(Func isInvokeAllowed, Func stateProvider, int capacity); + fieldInfo.SetValue(driver, obj); //driver.Event = obj; + } + + return driver; + } + + static bool ParseName(MethodInfo methodInfo, out TState state, out string eventName) + { + state = default(TState); + eventName = null; + + if (methodInfo.GetCustomAttributes(typeof(CompilerGeneratedAttribute), true).Length != 0) + { + return false; + } + + string name = methodInfo.Name; + int index = name.IndexOf('_'); + + //Ignore functions without an underscore + if (index < 0) + { + return false; + } + + string stateName = name.Substring(0, index); + eventName = name.Substring(index + 1); + + try + { + state = (TState) Enum.Parse(typeof(TState), stateName); + } + catch (ArgumentException) + { + //Not an method as listed in the state enum + return false; + } + + return true; + } + + static void BindEvents(TDriver driver, Component component, TState state, int stateInt, MethodInfo stateTargetDef, FieldInfo driverEvtDef) + { + var genericTypes = driverEvtDef.FieldType.GetGenericArguments(); //get T1,T2,...TN from StateEvent + var actionType = GetActionType(genericTypes); //typeof(Action) + + //evt.AddListener(State_Method); + var obj = driverEvtDef.GetValue(driver); //driver.Foo + var addMethodInfo = driverEvtDef.FieldType.GetMethod("AddListener", bindingFlags); // driver.Foo.AddListener + + Delegate del = null; + try + { + del = Delegate.CreateDelegate(actionType, component, stateTargetDef); + } + catch (ArgumentException) + { + throw new ArgumentException(string.Format("State ({0}_{1}) requires a callback of type: {2}, type found: {3}", state, driverEvtDef.Name, actionType, stateTargetDef)); + } + + addMethodInfo.Invoke(obj, new object[] {stateInt, del}); //driver.Foo.AddListener(stateInt, component.State_Event); + } + + static void BindEventsInternal(StateMapping targetState, Component component, MethodInfo method, string evtName) + { + switch (evtName) + { + case "Enter": + if (method.ReturnType == typeof(IEnumerator)) + { + targetState.hasEnterRoutine = true; + targetState.EnterRoutine = CreateDelegate>(method, component); + } + else + { + targetState.hasEnterRoutine = false; + targetState.EnterCall = CreateDelegate(method, component); + } + + break; + case "Exit": + if (method.ReturnType == typeof(IEnumerator)) + { + targetState.hasExitRoutine = true; + targetState.ExitRoutine = CreateDelegate>(method, component); + } + else + { + targetState.hasExitRoutine = false; + targetState.ExitCall = CreateDelegate(method, component); + } + + break; + case "Finally": + targetState.Finally = CreateDelegate(method, component); + break; + } + } + + static V CreateDelegate(MethodInfo method, Object target) where V : class + { + var ret = (Delegate.CreateDelegate(typeof(V), target, method) as V); + + if (ret == null) + { + throw new ArgumentException("Unable to create delegate for method called " + method.Name); + } + + return ret; + } + + static Type GetActionType(Type[] genericArgs) + { + switch (genericArgs.Length) + { + case 0: + return typeof(Action); + case 1: + return typeof(Action<>).MakeGenericType(genericArgs); + case 2: + return typeof(Action<,>).MakeGenericType(genericArgs); + default: + throw new ArgumentOutOfRangeException(string.Format("Cannot create Action Type with {0} type arguments", genericArgs.Length)); + } + } + +#endregion + +#region ChangeStates + + public void ChangeState(TState newState) + { + ChangeState(newState, StateTransition.Safe); + } + + public void ChangeState(TState newState, StateTransition transition) + { + if (stateLookup == null) + { + throw new Exception("States have not been configured, please call initialized before trying to set state"); + } + + if (!stateLookup.ContainsKey(newState)) + { + throw new Exception("No state with the name " + newState.ToString() + " can be found. Please make sure you are called the correct type the statemachine was initialized with"); + } + + var nextState = stateLookup[newState]; + + if (!reenter && currentState == nextState) + { + return; + } + + //Cancel any queued changes. + if (queuedChange != null) + { + component.StopCoroutine(queuedChange); + queuedChange = null; + } + + switch (transition) + { + //case StateMachineTransition.Blend: + //Do nothing - allows the state transitions to overlap each other. This is a dumb idea, as previous state might trigger new changes. + //A better way would be to start the two couroutines at the same time. IE don't wait for exit before starting start. + //How does this work in terms of overwrite? + //Is there a way to make this safe, I don't think so? + //break; + case StateTransition.Safe: + if (isInTransition) + { + if (exitRoutine != null) //We are already exiting current state on our way to our previous target state + { + //Overwrite with our new target + destinationState = nextState; + return; + } + + if (enterRoutine != null) //We are already entering our previous target state. Need to wait for that to finish and call the exit routine. + { + //Damn, I need to test this hard + queuedChange = WaitForPreviousTransition(nextState); + component.StartCoroutine(queuedChange); + return; + } + } + + break; + case StateTransition.Overwrite: + if (currentTransition != null) + { + component.StopCoroutine(currentTransition); + } + + if (exitRoutine != null) + { + component.StopCoroutine(exitRoutine); + } + + if (enterRoutine != null) + { + component.StopCoroutine(enterRoutine); + } + + //Note: if we are currently in an EnterRoutine and Exit is also a routine, this will be skipped in ChangeToNewStateRoutine() + break; + } + + + if ((currentState != null && currentState.hasExitRoutine) || nextState.hasEnterRoutine) + { + isInTransition = true; + currentTransition = ChangeToNewStateRoutine(nextState, transition); + component.StartCoroutine(currentTransition); + } + else //Same frame transition, no coroutines are present + { + destinationState = nextState; //Assign here so Exit() has a valid reference + + if (currentState != null) + { + currentState.ExitCall(); + currentState.Finally(); + } + + lastState = currentState; + currentState = destinationState; + if (currentState != null) + { + currentState.EnterCall(); + if (Changed != null) + { + Changed((TState) currentState.state); + } + } + + isInTransition = false; + } + } + + private IEnumerator ChangeToNewStateRoutine(StateMapping newState, StateTransition transition) + { + destinationState = newState; //Cache this so that we can overwrite it and hijack a transition + + if (currentState != null) + { + if (currentState.hasExitRoutine) + { + exitRoutine = currentState.ExitRoutine(); + + if (exitRoutine != null && transition != StateTransition.Overwrite) //Don't wait for exit if we are overwriting + { + yield return component.StartCoroutine(exitRoutine); + } + + exitRoutine = null; + } + else + { + currentState.ExitCall(); + } + + currentState.Finally(); + } + + lastState = currentState; + currentState = destinationState; + + if (currentState != null) + { + if (currentState.hasEnterRoutine) + { + enterRoutine = currentState.EnterRoutine(); + + if (enterRoutine != null) + { + yield return component.StartCoroutine(enterRoutine); + } + + enterRoutine = null; + } + else + { + currentState.EnterCall(); + } + + //Broadcast change only after enter transition has begun. + if (Changed != null) + { + Changed((TState) currentState.state); + } + } + + isInTransition = false; + } + + IEnumerator WaitForPreviousTransition(StateMapping nextState) + { + queuedState = nextState; //Cache this so fsm.NextState is accurate; + + while (isInTransition) + { + yield return null; + } + + queuedState = null; + ChangeState((TState) nextState.state); + } + +#endregion + +#region Properties & Helpers + + public bool LastStateExists + { + get { return lastState != null; } + } + + public TState LastState + { + get + { + if (lastState == null) + { + throw new NullReferenceException("LastState cannot be accessed before ChangeState() has been called at least twice"); + } + + return (TState) lastState.state; + } + } + + public TState NextState + { + get + { + if (queuedState != null) //In safe mode sometimes we need to wait for the destination state to complete, and will be stored in queued state + { + return (TState) queuedState.state; + } + + if (destinationState == null) + { + return State; + } + + return (TState) destinationState.state; + } + } + + public TState State + { + get + { + if (currentState == null) + { + throw new NullReferenceException("State cannot be accessed before ChangeState() has been called at least once"); + } + + return (TState) currentState.state; + } + } + + public bool IsInTransition + { + get { return isInTransition; } + } + + public TDriver Driver + { + get { return rootDriver; } + } + + public MonoBehaviour Component + { + get { return component; } + } + + //format as method so can be passed as Func + private TState GetState() + { + return State; + } + + private int GetStateInt() + { + return enumConverter(State); + } + + //Compiler shenanigans to get ints from generic enums + private static int Identity(int x) + { + return x; + } + + private bool IsDispatchAllowed() + { + if (currentState == null) + { + return false; + } + + if (IsInTransition) + { + return false; + } + + return true; + } + +#endregion + +#region Static API + + //Static Methods + + /// + /// Inspects a MonoBehaviour for state methods as defined by the supplied Enum, and returns a stateMachine instance used to transition states. + /// + /// The component with defined state methods + /// A valid stateMachine instance to manage MonoBehaviour state transitions + public static StateMachine Initialize(MonoBehaviour component) + { + var engine = component.GetComponent(); + if (engine == null) engine = component.gameObject.AddComponent(); + + return engine.Initialize(component); + } + + /// + /// Inspects a MonoBehaviour for state methods as defined by the supplied Enum, and returns a stateMachine instance used to transition states. + /// + /// The component with defined state methods + /// The default starting state + /// A valid stateMachine instance to manage MonoBehaviour state transitions + public static StateMachine Initialize(MonoBehaviour component, TState startState) + { + var engine = component.GetComponent(); + if (engine == null) engine = component.gameObject.AddComponent(); + + return engine.Initialize(component, startState); + } + +#endregion + } +} \ No newline at end of file diff --git a/example_project/Assets/MonsterLove/StateMachine/StateMachine.cs.meta b/StateMachine/Assets/MonsterLove/Runtime/StateMachine.cs.meta similarity index 100% rename from example_project/Assets/MonsterLove/StateMachine/StateMachine.cs.meta rename to StateMachine/Assets/MonsterLove/Runtime/StateMachine.cs.meta diff --git a/example_project/Assets/MonsterLove/StateMachine/StateMachineRunner.cs b/StateMachine/Assets/MonsterLove/Runtime/StateMachineRunner.cs similarity index 57% rename from example_project/Assets/MonsterLove/StateMachine/StateMachineRunner.cs rename to StateMachine/Assets/MonsterLove/Runtime/StateMachineRunner.cs index a3d6ff7..2fa9997 100644 --- a/example_project/Assets/MonsterLove/StateMachine/StateMachineRunner.cs +++ b/StateMachine/Assets/MonsterLove/Runtime/StateMachineRunner.cs @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Made With Monster Love (Pty) Ltd + * Copyright (c) 2019 Made With Monster Love (Pty) Ltd * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -23,26 +23,23 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Reflection; -using System.Runtime.CompilerServices; using UnityEngine; -using Object = System.Object; namespace MonsterLove.StateMachine { public class StateMachineRunner : MonoBehaviour { - private List stateMachineList = new List(); + private List> stateMachineList = new List>(); /// /// Creates a stateMachine token object which is used to managed to the state of a monobehaviour. /// - /// An Enum listing different state transitions + /// An Enum listing different state transitions /// The component whose state will be managed /// - public StateMachine Initialize(MonoBehaviour component) where T : struct, IConvertible, IComparable + public StateMachine Initialize(MonoBehaviour component) where TState : struct, IConvertible, IComparable { - var fsm = new StateMachine(this, component); + var fsm = new StateMachine(component); stateMachineList.Add(fsm); @@ -52,13 +49,13 @@ public StateMachine Initialize(MonoBehaviour component) where T : struct, /// /// Creates a stateMachine token object which is used to managed to the state of a monobehaviour. Will automatically transition the startState /// - /// An Enum listing different state transitions + /// An Enum listing different state transitions /// The component whose state will be managed /// The default start state /// - public StateMachine Initialize(MonoBehaviour component, T startState) where T : struct, IConvertible, IComparable + public StateMachine Initialize(MonoBehaviour component, TState startState) where TState : struct, IConvertible, IComparable { - var fsm = Initialize(component); + var fsm = Initialize(component); fsm.ChangeState(startState); @@ -70,7 +67,10 @@ void FixedUpdate() for (int i = 0; i < stateMachineList.Count; i++) { var fsm = stateMachineList[i]; - if(!fsm.IsInTransition && fsm.Component.enabled) fsm.CurrentStateMap.FixedUpdate(); + if (!fsm.IsInTransition && fsm.Component.enabled) + { + fsm.Driver.FixedUpdate.Invoke(); + } } } @@ -81,7 +81,7 @@ void Update() var fsm = stateMachineList[i]; if (!fsm.IsInTransition && fsm.Component.enabled) { - fsm.CurrentStateMap.Update(); + fsm.Driver.Update.Invoke(); } } } @@ -93,62 +93,18 @@ void LateUpdate() var fsm = stateMachineList[i]; if (!fsm.IsInTransition && fsm.Component.enabled) { - fsm.CurrentStateMap.LateUpdate(); + fsm.Driver.LateUpdate.Invoke(); } } } - //void OnCollisionEnter(Collision collision) - //{ - // if(currentState != null && !IsInTransition) - // { - // currentState.OnCollisionEnter(collision); - // } - //} - public static void DoNothing() { } - public static void DoNothingCollider(Collider other) - { - } - - public static void DoNothingCollision(Collision other) - { - } - public static IEnumerator DoNothingCoroutine() { yield break; } } - - - public class StateMapping - { - public object state; - - public bool hasEnterRoutine; - public Action EnterCall = StateMachineRunner.DoNothing; - public Func EnterRoutine = StateMachineRunner.DoNothingCoroutine; - - public bool hasExitRoutine; - public Action ExitCall = StateMachineRunner.DoNothing; - public Func ExitRoutine = StateMachineRunner.DoNothingCoroutine; - - public Action Finally = StateMachineRunner.DoNothing; - public Action Update = StateMachineRunner.DoNothing; - public Action LateUpdate = StateMachineRunner.DoNothing; - public Action FixedUpdate = StateMachineRunner.DoNothing; - public Action OnCollisionEnter = StateMachineRunner.DoNothingCollision; - - public StateMapping(object state) - { - this.state = state; - } - - } -} - - +} \ No newline at end of file diff --git a/example_project/Assets/MonsterLove/StateMachine/StateMachineRunner.cs.meta b/StateMachine/Assets/MonsterLove/Runtime/StateMachineRunner.cs.meta similarity index 100% rename from example_project/Assets/MonsterLove/StateMachine/StateMachineRunner.cs.meta rename to StateMachine/Assets/MonsterLove/Runtime/StateMachineRunner.cs.meta diff --git a/StateMachine/Assets/MonsterLove/Runtime/StateMapping.cs b/StateMachine/Assets/MonsterLove/Runtime/StateMapping.cs new file mode 100644 index 0000000..45ed989 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Runtime/StateMapping.cs @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2019 Made With Monster Love (Pty) Ltd + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace MonsterLove.StateMachine +{ + internal class StateMapping where TState : struct, IConvertible, IComparable + where TDriver : class, new() + { + public TState state; + + public bool hasEnterRoutine; + public Action EnterCall = StateMachineRunner.DoNothing; + public Func EnterRoutine = StateMachineRunner.DoNothingCoroutine; + + public bool hasExitRoutine; + public Action ExitCall = StateMachineRunner.DoNothing; + public Func ExitRoutine = StateMachineRunner.DoNothingCoroutine; + + public Action Finally = StateMachineRunner.DoNothing; + + private Func stateProviderCallback; + private StateMachine fsm; + + public StateMapping(StateMachine fsm, TState state, Func stateProvider) + { + this.fsm = fsm; + this.state = state; + stateProviderCallback = stateProvider; + } + } +} diff --git a/StateMachine/Assets/MonsterLove/Runtime/StateMapping.cs.meta b/StateMachine/Assets/MonsterLove/Runtime/StateMapping.cs.meta new file mode 100644 index 0000000..0ff8b29 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Runtime/StateMapping.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0a9d115393f24d76a917d05ac6a87127 +timeCreated: 1568111091 \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools.meta b/StateMachine/Assets/MonsterLove/Samples.meta similarity index 57% rename from example_project/Assets/UnityTestTools.meta rename to StateMachine/Assets/MonsterLove/Samples.meta index ecbdf85..c57ff63 100644 --- a/example_project/Assets/UnityTestTools.meta +++ b/StateMachine/Assets/MonsterLove/Samples.meta @@ -1,9 +1,8 @@ fileFormatVersion: 2 -guid: 3862af9ac1459dd45bb9a3770be8f80e +guid: 3268d4567b17b144c93ebe97e1b38779 folderAsset: yes -timeCreated: 1466591207 -licenseType: Free DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/example_project/Assets/UnityTestTools/Common/Settings.meta b/StateMachine/Assets/MonsterLove/Samples/Prefabs.meta similarity index 57% rename from example_project/Assets/UnityTestTools/Common/Settings.meta rename to StateMachine/Assets/MonsterLove/Samples/Prefabs.meta index c5024c3..8b45e12 100644 --- a/example_project/Assets/UnityTestTools/Common/Settings.meta +++ b/StateMachine/Assets/MonsterLove/Samples/Prefabs.meta @@ -1,9 +1,8 @@ fileFormatVersion: 2 -guid: 4ea9588149718704db3e154151026689 +guid: 1b25c0e4b36a737478915ab5422e5775 folderAsset: yes -timeCreated: 1466591233 -licenseType: Free DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/StateMachine/Assets/MonsterLove/Samples/Prefabs/Item.prefab b/StateMachine/Assets/MonsterLove/Samples/Prefabs/Item.prefab new file mode 100644 index 0000000..03b9c32 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/Prefabs/Item.prefab @@ -0,0 +1,110 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4204478616006888474 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7356218733581437328} + - component: {fileID: 7630017851788502069} + - component: {fileID: 6320050345510877602} + - component: {fileID: 3275343476624940446} + - component: {fileID: 2663155548185288521} + m_Layer: 0 + m_Name: Item + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7356218733581437328 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4204478616006888474} + 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: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7630017851788502069 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4204478616006888474} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6320050345510877602 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4204478616006888474} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &3275343476624940446 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4204478616006888474} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &2663155548185288521 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4204478616006888474} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0f92323e092843a7a057ef31db09f92d, type: 3} + m_Name: + m_EditorClassIdentifier: + isTarget: 0 diff --git a/StateMachine/Assets/MonsterLove/Samples/Prefabs/Item.prefab.meta b/StateMachine/Assets/MonsterLove/Samples/Prefabs/Item.prefab.meta new file mode 100644 index 0000000..0ba8317 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/Prefabs/Item.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8f65e2077557e2a48bb201a371e5d29b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/StateMachine/Assets/MonsterLove/Samples/Scripts.meta b/StateMachine/Assets/MonsterLove/Samples/Scripts.meta new file mode 100644 index 0000000..167b559 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/Scripts.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5a0f0a984818fcf4db10db5d5455492c diff --git a/example_project/Assets/Scripts/ColorChanger.cs b/StateMachine/Assets/MonsterLove/Samples/Scripts/ColorChanger.cs similarity index 100% rename from example_project/Assets/Scripts/ColorChanger.cs rename to StateMachine/Assets/MonsterLove/Samples/Scripts/ColorChanger.cs diff --git a/example_project/Assets/Scripts/ColorChanger.cs.meta b/StateMachine/Assets/MonsterLove/Samples/Scripts/ColorChanger.cs.meta similarity index 100% rename from example_project/Assets/Scripts/ColorChanger.cs.meta rename to StateMachine/Assets/MonsterLove/Samples/Scripts/ColorChanger.cs.meta diff --git a/StateMachine/Assets/MonsterLove/Samples/Scripts/ExampleAdvanced.cs b/StateMachine/Assets/MonsterLove/Samples/Scripts/ExampleAdvanced.cs new file mode 100644 index 0000000..37c576a --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/Scripts/ExampleAdvanced.cs @@ -0,0 +1,161 @@ +using System.Collections.Generic; +using MonsterLove.StateMachine; +using UnityEngine; + +public class ExampleAdvanced : MonoBehaviour +{ + public Item prefab; + public float roundTime; + + private List spawnedItems; + private Item targetItem; + private float playStartTime; + + private StateMachine fsm; + + private void Awake() + { + //Initialize the state machine + fsm = new StateMachine(this); + fsm.ChangeState(States.Idle); //Remember to set an initial state! + } + + private void Update() + { + fsm.Driver.Update.Invoke(); //Tap the state machine into Unity's update loop. We could choose to call this from anywhere though! + } + + void OnGUI() + { + fsm.Driver.OnGUI.Invoke(); //Tap into the OnGUI update loop. + } + + void DestroyItem(Item item) + { + item.Triggered -= fsm.Driver.OnItemSelected.Invoke; //Good hygiene, always remove your listeners when you are done! + Destroy(item.gameObject); + } + +#region fsm + + public enum States + { + Idle, + Play, + GameWin, + GameLose, + } + + public class Driver + { + public StateEvent Update; + public StateEvent OnGUI; + public StateEvent OnItemSelected; + } + + void Idle_OnGUI() + { + if (GUI.Button(new Rect(20, 20, 100, 30), "Begin")) + { + fsm.ChangeState(States.Play); + } + } + + void Play_Enter() + { + playStartTime = Time.time; + + int count = 10; + int targetIndex = Random.Range(0, count); + spawnedItems = new List(count); + for (int i = 0; i < count; i++) + { + var pos2D = Random.insideUnitCircle * 5; + var item = (Item) Instantiate(prefab, new Vector3(pos2D.x, 0, pos2D.y), Quaternion.identity); + item.isTarget = (i == targetIndex); + item.Triggered += fsm.Driver.OnItemSelected.Invoke; //Pipe external events into the fsm - this is very powerful! + spawnedItems.Add(item); + } + } + + void Play_OnGUI() + { + float timeRemaining = roundTime - (Time.time - playStartTime); + GUI.Label(new Rect(20, 20, 300, 30), "Click items to find the target"); + GUI.Label(new Rect(20, 50, 300, 30), $"Time Remaining: {timeRemaining:n3}"); + } + + void Play_Update() + { + if (Time.time - playStartTime >= roundTime) + { + fsm.ChangeState(States.GameLose); + } + } + + void Play_OnItemSelected(Item item) //Data driven events guarantee correctness - only the Play state responds to OnItemSelected events + { + if (item.isTarget) + { + targetItem = item; + fsm.ChangeState(States.GameWin); + } + else + { + spawnedItems.Remove(item); + DestroyItem(item); + } + } + + void GameWin_Enter() + { + spawnedItems.Remove(targetItem); + + for (int i = spawnedItems.Count - 1; i >= 0; i--) //Reverse order as we're modifying the list in place + { + var item = spawnedItems[i]; + spawnedItems.Remove(item); + DestroyItem(item); + } + } + + void GameWin_OnGUI() + { + GUI.Label(new Rect(20, 20, 300, 30), "Well done, you found it!"); + + if (GUI.Button(new Rect(20, 50, 100, 30), "Restart")) + { + fsm.ChangeState(States.Idle); + } + } + + void GameWin_Exit() + { + DestroyItem(targetItem); + targetItem = null; + } + + void GameLose_Enter() + { + for (int i = spawnedItems.Count - 1; i >= 0; i--) //Reverse order as we're modifying the list in place + { + var item = spawnedItems[i]; + spawnedItems.Remove(item); + DestroyItem(item); + } + } + + void GameLose_OnGUI() + { + GUI.Label(new Rect(20, 20, 300, 30), "Bad luck, you didn't find it in time!"); + + if (GUI.Button(new Rect(20, 50, 100, 30), "Restart")) + { + fsm.ChangeState(States.Idle); + } + } + + +#endregion + +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Samples/Scripts/ExampleAdvanced.cs.meta b/StateMachine/Assets/MonsterLove/Samples/Scripts/ExampleAdvanced.cs.meta new file mode 100644 index 0000000..a83d6f5 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/Scripts/ExampleAdvanced.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c086227322664a1ab09daecc44f8e5fa +timeCreated: 1616755006 \ No newline at end of file diff --git a/example_project/Assets/Scripts/Main.cs b/StateMachine/Assets/MonsterLove/Samples/Scripts/ExampleBasic.cs similarity index 59% rename from example_project/Assets/Scripts/Main.cs rename to StateMachine/Assets/MonsterLove/Samples/Scripts/ExampleBasic.cs index df78e19..da59d6d 100644 --- a/example_project/Assets/Scripts/Main.cs +++ b/StateMachine/Assets/MonsterLove/Samples/Scripts/ExampleBasic.cs @@ -2,7 +2,7 @@ using System.Collections; using MonsterLove.StateMachine; -public class Main : MonoBehaviour +public class ExampleBasic : MonoBehaviour { //Declare which states we'd like use public enum States @@ -19,58 +19,46 @@ public enum States private float startHealth; - private StateMachine fsm; + private StateMachine fsm; private void Awake() { startHealth = health; //Initialize State Machine Engine - fsm = StateMachine.Initialize(this, States.Init); + fsm = new StateMachine(this); + fsm.ChangeState(States.Init); } - void OnGUI() + void Update() { - //Example of polling state - var state = fsm.State; + fsm.Driver.Update.Invoke(); + } + void OnGUI() + { GUILayout.BeginArea(new Rect(50,50,120,40)); - if(state == States.Init && GUILayout.Button("Start")) - { - fsm.ChangeState(States.Countdown); - } - if(state == States.Countdown) - { - GUILayout.Label("Look at Console"); - } - if(state == States.Play) - { - if(GUILayout.Button("Force Win")) - { - fsm.ChangeState(States.Win); - } - - GUILayout.Label("Health: " + Mathf.Round(health).ToString()); - } - if(state == States.Win || state == States.Lose) - { - if(GUILayout.Button("Play Again")) - { - fsm.ChangeState(States.Countdown); - } - } - + fsm.Driver.OnGUI.Invoke(); + GUILayout.EndArea(); } - private void Init_Enter() + void Init_Enter() { Debug.Log("Waiting for start button to be pressed"); } + void Init_OnGUI() + { + if(GUILayout.Button("Start")) + { + fsm.ChangeState(States.Countdown); + } + } + //We can return a coroutine, this is useful animations and the like - private IEnumerator Countdown_Enter() + IEnumerator Countdown_Enter() { health = startHealth; @@ -82,16 +70,19 @@ private IEnumerator Countdown_Enter() yield return new WaitForSeconds(0.5f); fsm.ChangeState(States.Play); - } + void Countdown_OnGUI() + { + GUILayout.Label("Look at Console"); + } - private void Play_Enter() + void Play_Enter() { Debug.Log("FIGHT!"); } - private void Play_Update() + void Play_Update() { health -= damage * Time.deltaTime; @@ -101,6 +92,16 @@ private void Play_Update() } } + void Play_OnGUI() + { + if(GUILayout.Button("Make me win!")) + { + fsm.ChangeState(States.Win); + } + + GUILayout.Label("Health: " + Mathf.Round(health).ToString()); + } + void Play_Exit() { Debug.Log("Game Over"); @@ -110,9 +111,25 @@ void Lose_Enter() { Debug.Log("Lost"); } + + void Lose_OnGUI() + { + if(GUILayout.Button("Play Again")) + { + fsm.ChangeState(States.Countdown); + } + } void Win_Enter() { Debug.Log("Won"); } + + void Win_OnGUI() + { + if(GUILayout.Button("Play Again")) + { + fsm.ChangeState(States.Countdown); + } + } } diff --git a/example_project/Assets/Scripts/Main.cs.meta b/StateMachine/Assets/MonsterLove/Samples/Scripts/ExampleBasic.cs.meta similarity index 100% rename from example_project/Assets/Scripts/Main.cs.meta rename to StateMachine/Assets/MonsterLove/Samples/Scripts/ExampleBasic.cs.meta diff --git a/StateMachine/Assets/MonsterLove/Samples/Scripts/Item.cs b/StateMachine/Assets/MonsterLove/Samples/Scripts/Item.cs new file mode 100644 index 0000000..f3647e9 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/Scripts/Item.cs @@ -0,0 +1,17 @@ +using System; +using UnityEngine; + +public class Item : MonoBehaviour +{ + public event Action Triggered; + + public bool isTarget; + + public void OnMouseDown() + { + if (Triggered != null) + { + Triggered(this); + } + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Samples/Scripts/Item.cs.meta b/StateMachine/Assets/MonsterLove/Samples/Scripts/Item.cs.meta new file mode 100644 index 0000000..abb2acc --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/Scripts/Item.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0f92323e092843a7a057ef31db09f92d +timeCreated: 1616756619 \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Samples/Scripts/MonsterLove.StateMachine.Samples.asmdef b/StateMachine/Assets/MonsterLove/Samples/Scripts/MonsterLove.StateMachine.Samples.asmdef new file mode 100644 index 0000000..bfd6a36 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/Scripts/MonsterLove.StateMachine.Samples.asmdef @@ -0,0 +1,15 @@ +{ + "name": "MonsterLove.StateMachine.Samples", + "references": [ + "GUID:39f9fc2c98cf6654498562b4bdd17a1e" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Samples/Scripts/MonsterLove.StateMachine.Samples.asmdef.meta b/StateMachine/Assets/MonsterLove/Samples/Scripts/MonsterLove.StateMachine.Samples.asmdef.meta new file mode 100644 index 0000000..69c9a78 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/Scripts/MonsterLove.StateMachine.Samples.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 64e8a9da2ff291b458d3a67fda350daa +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs.meta b/StateMachine/Assets/MonsterLove/Samples/Scripts/Perf.meta similarity index 57% rename from example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs.meta rename to StateMachine/Assets/MonsterLove/Samples/Scripts/Perf.meta index 1b74975..e354789 100644 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs.meta +++ b/StateMachine/Assets/MonsterLove/Samples/Scripts/Perf.meta @@ -1,9 +1,8 @@ fileFormatVersion: 2 -guid: e22ba039de7077c4aa95758ef723b803 +guid: f34f140b3438bc944beff20f0b786636 folderAsset: yes -timeCreated: 1445282049 -licenseType: Store DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/StateMachine/Assets/MonsterLove/Samples/Scripts/Perf/StressTest.cs b/StateMachine/Assets/MonsterLove/Samples/Scripts/Perf/StressTest.cs new file mode 100644 index 0000000..c4170da --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/Scripts/Perf/StressTest.cs @@ -0,0 +1,82 @@ + +using System; +using MonsterLove.StateMachine; +using UnityEngine; +using UnityEngine.Profiling; + +public class StressTest : MonoBehaviour +{ + enum States + { + State0, + State1, + State2, + State3, + State4, + State5, + State6, + State7, + State8, + State9, + State10, + State11, + State12, + State13, + State14, + } + + public class Driver + { + public StateEvent Update; + public StateEvent OnChanged; + } + + private StateMachine fsm; + + private int value = 0; + + public void Awake() + { + fsm = new StateMachine(this); + fsm.ChangeState(States.State1); + } + + private void Update() + { + Profiler.BeginSample("Fsm_Invoke"); + for (int i = 0; i < 10000; i++) + { + fsm.Driver.Update.Invoke(); + fsm.Driver.OnChanged.Invoke(i); + } + Profiler.EndSample(); + + Profiler.BeginSample("Fsm_Native"); + for (int i = 0; i < 10000; i++) + { + State1_Update(); + State1_OnChanged(i); + } + Profiler.EndSample(); + } + + void State1_Update() + { + value++; + } + + void State1_OnChanged(int value) + { + this.value = value; + } + + void State2_Update() + { + value++; + } + + void State2_OnChanged(int value) + { + this.value = -value; + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Samples/Scripts/Perf/StressTest.cs.meta b/StateMachine/Assets/MonsterLove/Samples/Scripts/Perf/StressTest.cs.meta new file mode 100644 index 0000000..1a7e650 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/Scripts/Perf/StressTest.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5feefe5bbb45416ca0f4953ecfff49da +timeCreated: 1616777700 \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Samples/StateMachine_Advanced.unity b/StateMachine/Assets/MonsterLove/Samples/StateMachine_Advanced.unity new file mode 100644 index 0000000..8fdc2ec --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/StateMachine_Advanced.unity @@ -0,0 +1,468 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &4 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 1 + m_BakeResolution: 50 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 0 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 0 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 0 +--- !u!196 &5 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &335347781 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 335347786} + - component: {fileID: 335347785} + - component: {fileID: 335347782} + 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 &335347782 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 335347781} + m_Enabled: 1 +--- !u!20 &335347785 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 335347781} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.2519135, g: 0.28969136, b: 0.3490566, a: 0.019607844} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + 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: 0 + 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_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &335347786 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 335347781} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -9.6} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1431333937} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1431333936 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1431333937} + m_Layer: 0 + m_Name: CamPivot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1431333937 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1431333936} + m_LocalRotation: {x: 0.2588191, y: 0, z: 0, w: 0.9659258} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 335347786} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 30, y: 0, z: 0} +--- !u!1 &1563837377 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1563837381} + - component: {fileID: 1563837380} + - component: {fileID: 1563837379} + - component: {fileID: 1563837378} + m_Layer: 0 + m_Name: Floor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &1563837378 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1563837377} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1563837379 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1563837377} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1563837380 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1563837377} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1563837381 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1563837377} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -1, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1876863014 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1876863016} + - component: {fileID: 1876863015} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1876863015 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1876863014} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + 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} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + 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 &1876863016 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1876863014} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1979347781 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1979347783} + - component: {fileID: 1979347782} + m_Layer: 0 + m_Name: ExampleAdvanced + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1979347782 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1979347781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c086227322664a1ab09daecc44f8e5fa, type: 3} + m_Name: + m_EditorClassIdentifier: + prefab: {fileID: 2663155548185288521, guid: 8f65e2077557e2a48bb201a371e5d29b, type: 3} + roundTime: 10 +--- !u!4 &1979347783 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1979347781} + 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: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/example_project/Assets/TestCases/IntegrationTests.unity.meta b/StateMachine/Assets/MonsterLove/Samples/StateMachine_Advanced.unity.meta similarity index 56% rename from example_project/Assets/TestCases/IntegrationTests.unity.meta rename to StateMachine/Assets/MonsterLove/Samples/StateMachine_Advanced.unity.meta index 3bc94d5..c50e696 100644 --- a/example_project/Assets/TestCases/IntegrationTests.unity.meta +++ b/StateMachine/Assets/MonsterLove/Samples/StateMachine_Advanced.unity.meta @@ -1,4 +1,4 @@ fileFormatVersion: 2 -guid: 31a2fbd942c2a444d831243db448b600 +guid: fa60728e35284674e88aa2ae6df84576 DefaultImporter: userData: diff --git a/StateMachine/Assets/MonsterLove/Samples/StateMachine_Basic.unity b/StateMachine/Assets/MonsterLove/Samples/StateMachine_Basic.unity new file mode 100644 index 0000000..3a15f77 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/StateMachine_Basic.unity @@ -0,0 +1,265 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &4 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 1 + m_BakeResolution: 50 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 0 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 0 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 0 +--- !u!196 &5 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &335347781 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 335347786} + - component: {fileID: 335347785} + - component: {fileID: 335347782} + 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 &335347782 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 335347781} + m_Enabled: 1 +--- !u!20 &335347785 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 335347781} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.2519135, g: 0.28969136, b: 0.3490566, a: 0.019607844} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + 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: 0 + 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_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &335347786 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 335347781} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1979347781 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1979347783} + - component: {fileID: 1979347782} + - component: {fileID: 1979347784} + m_Layer: 0 + m_Name: ExampleBasic + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1979347782 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1979347781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e1b8c2ce0ae416a4ebf4865c20d2d12e, type: 3} + m_Name: + m_EditorClassIdentifier: + health: 100 + damage: 20 +--- !u!4 &1979347783 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1979347781} + 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: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1979347784 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1979347781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a57cafd734b9e8d4da74fd1b24e6107e, type: 3} + m_Name: + m_EditorClassIdentifier: + interval: 1.2 diff --git a/example_project/Assets/StateMachineExample.unity.meta b/StateMachine/Assets/MonsterLove/Samples/StateMachine_Basic.unity.meta similarity index 100% rename from example_project/Assets/StateMachineExample.unity.meta rename to StateMachine/Assets/MonsterLove/Samples/StateMachine_Basic.unity.meta diff --git a/StateMachine/Assets/MonsterLove/Samples/StressTest.unity b/StateMachine/Assets/MonsterLove/Samples/StressTest.unity new file mode 100644 index 0000000..5a507cd --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/StressTest.unity @@ -0,0 +1,341 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &741488261 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 741488263} + - component: {fileID: 741488262} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &741488262 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 741488261} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + 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} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + 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 &741488263 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 741488261} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1532717787 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1532717790} + - component: {fileID: 1532717789} + - component: {fileID: 1532717788} + 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 &1532717788 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1532717787} + m_Enabled: 1 +--- !u!20 &1532717789 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1532717787} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, 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 + 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: 0 + 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: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1532717790 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1532717787} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1882005350 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1882005352} + - component: {fileID: 1882005351} + m_Layer: 0 + m_Name: StressTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1882005351 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1882005350} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5feefe5bbb45416ca0f4953ecfff49da, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &1882005352 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1882005350} + 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 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/StateMachine/Assets/MonsterLove/Samples/StressTest.unity.meta b/StateMachine/Assets/MonsterLove/Samples/StressTest.unity.meta new file mode 100644 index 0000000..e0c2ed4 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Samples/StressTest.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 838eb45cb78a5f94eaf4f72ef961a72f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/StateMachine/Assets/MonsterLove/Tests.meta b/StateMachine/Assets/MonsterLove/Tests.meta new file mode 100644 index 0000000..96cd0b1 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9bb6984bd108d8f4f8418c4f37e0ca0d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor.meta b/StateMachine/Assets/MonsterLove/Tests/Editor.meta new file mode 100644 index 0000000..9b82887 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9c8afd02806bc1d4cab6182962b1ccc4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/MonsterLove.StateMachine.Tests.Editor.asmdef b/StateMachine/Assets/MonsterLove/Tests/Editor/MonsterLove.StateMachine.Tests.Editor.asmdef new file mode 100644 index 0000000..f374384 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/MonsterLove.StateMachine.Tests.Editor.asmdef @@ -0,0 +1,24 @@ +{ + "name": "EditorTests", + "references": [ + "MonsterLove.StateMachine.Runtime", + "MonsterLove.StateMachine.Tests.Runtime", + "UnityEngine.TestRunner", + "UnityEditor.TestRunner" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll" + ], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/MonsterLove.StateMachine.Tests.Editor.asmdef.meta b/StateMachine/Assets/MonsterLove/Tests/Editor/MonsterLove.StateMachine.Tests.Editor.asmdef.meta new file mode 100644 index 0000000..5fe8635 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/MonsterLove.StateMachine.Tests.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7a05261385aac3941b3b93eaf9a30bed +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestBasicTransitions.cs b/StateMachine/Assets/MonsterLove/Tests/Editor/TestBasicTransitions.cs similarity index 89% rename from example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestBasicTransitions.cs rename to StateMachine/Assets/MonsterLove/Tests/Editor/TestBasicTransitions.cs index c97bd07..f7852ef 100644 --- a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestBasicTransitions.cs +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestBasicTransitions.cs @@ -112,6 +112,25 @@ public void IgnoreMultipleTransitions() Assert.AreEqual(0, behaviour.threeStats.lateUpdateCount); Assert.AreEqual(0, behaviour.threeStats.exitCount); Assert.AreEqual(0, behaviour.threeStats.finallyCount); + + fsm.reenter = true; + + fsm.ChangeState(States.Three); + fsm.ChangeState(States.Three); + + Assert.AreEqual(1, behaviour.twoStats.enterCount); + Assert.AreEqual(0, behaviour.twoStats.updateCount); + Assert.AreEqual(0, behaviour.twoStats.lateUpdateCount); + Assert.AreEqual(1, behaviour.twoStats.exitCount); + Assert.AreEqual(1, behaviour.twoStats.finallyCount); + + Assert.AreEqual(2, behaviour.threeStats.enterCount); + Assert.AreEqual(0, behaviour.threeStats.updateCount); + Assert.AreEqual(0, behaviour.threeStats.lateUpdateCount); + Assert.AreEqual(1, behaviour.threeStats.exitCount); + Assert.AreEqual(1, behaviour.threeStats.finallyCount); + + } [Test] diff --git a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestBasicTransitions.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Editor/TestBasicTransitions.cs.meta similarity index 100% rename from example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestBasicTransitions.cs.meta rename to StateMachine/Assets/MonsterLove/Tests/Editor/TestBasicTransitions.cs.meta diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestCachedDriver.cs b/StateMachine/Assets/MonsterLove/Tests/Editor/TestCachedDriver.cs new file mode 100644 index 0000000..732a6bf --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestCachedDriver.cs @@ -0,0 +1,108 @@ +using System.Runtime.CompilerServices; +using MonsterLove.StateMachine; +using NUnit.Framework; +using UnityEngine; + +/// This is an important test, enables subscription directly to driver objects +/// Eg. button.OnClick.AddListener(fsm.Driver.Foo.Invoke) +public class TestCachedDriver +{ + public enum States + { + One, + Two, + Three, + Four, + } + + public class Driver + { + public StateEvent Foo; + } + + private GameObject go; + private StateClass behaviour; + private StateMachine fsm; + private Driver driver; + + [SetUp] + public void Init() + { + go = new GameObject(); + behaviour = go.AddComponent(); + + fsm = new StateMachine(behaviour); + driver = fsm.Driver; + } + + [TearDown] + public void Kill() + { + Object.DestroyImmediate(go); + } + + [Test] + public void TestCachedDriverEvents() + { + fsm.ChangeState(States.One); + + driver.Foo.Invoke(); + + Assert.AreEqual(1, behaviour.oneFoo); + Assert.AreEqual(0, behaviour.twoFoo); + + fsm.ChangeState(States.Two); + + driver.Foo.Invoke(); + + Assert.AreEqual(1, behaviour.oneFoo); + Assert.AreEqual(1, behaviour.twoFoo); + } + + private class StateClass : MonoBehaviour + { + public int oneEnter; + public int oneFoo; + public int oneExit; + + public int twoEnter; + public int twoFoo; + public int twoExit; + + void One_Enter() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Enter", Time.frameCount); + oneEnter++; + } + + void One_Foo() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Foo", Time.frameCount); + oneFoo++; + } + + void One_Exit() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Exit", Time.frameCount); + oneExit++; + } + + void Two_Enter() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Enter", Time.frameCount); + twoEnter++; + } + + void Two_Foo() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Foo", Time.frameCount); + twoFoo++; + } + + void Two_Exit() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Exit", Time.frameCount); + twoExit++; + } + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestCachedDriver.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Editor/TestCachedDriver.cs.meta new file mode 100644 index 0000000..74f7679 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestCachedDriver.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 597262340b854411b6859c314743cbfe +timeCreated: 1568106780 \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestCustomDriver.cs b/StateMachine/Assets/MonsterLove/Tests/Editor/TestCustomDriver.cs new file mode 100644 index 0000000..4bcf00c --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestCustomDriver.cs @@ -0,0 +1,179 @@ +using MonsterLove.StateMachine; +using NUnit.Framework; +using UnityEngine; + +public class TestCustomDriver +{ + public enum States + { + One, + Two, + Three, + Four, + } + + public class Driver + { + public StateEvent Foo; + public StateEvent Bar; + public StateEvent Baz; + } + + private GameObject go; + private StateClass behaviour; + private StateMachine fsm; + + [SetUp] + public void Init() + { + go = new GameObject(); + behaviour = go.AddComponent(); + + fsm = new StateMachine(behaviour); + } + + [TearDown] + public void Kill() + { + Object.DestroyImmediate(go); + } + + [Test] + public void TestDriverNotNull() + { + Assert.NotNull(fsm.Driver); + } + + [Test] + public void TestCustomEvents() + { + fsm.ChangeState(States.One); + + fsm.Driver.Foo.Invoke(); + fsm.Driver.Bar.Invoke(5); + fsm.Driver.Baz.Invoke(6, 7); + + Assert.AreEqual(1, behaviour.oneFoo); + Assert.AreEqual(1, behaviour.oneBar); + Assert.AreEqual(1, behaviour.oneBaz); + Assert.AreEqual(5, behaviour.oneBarValue); + Assert.AreEqual(6, behaviour.oneBazValueA); + Assert.AreEqual(7, behaviour.oneBazValueB); + + Assert.AreEqual(0, behaviour.twoFoo); + Assert.AreEqual(0, behaviour.twoBar); + Assert.AreEqual(0, behaviour.twoBaz); + Assert.AreEqual(0, behaviour.twoBarValue); + Assert.AreEqual(0, behaviour.twoBazValueA); + Assert.AreEqual(0, behaviour.twoBazValueB); + + fsm.ChangeState(States.Two); + + fsm.Driver.Foo.Invoke(); + fsm.Driver.Bar.Invoke(8); + fsm.Driver.Baz.Invoke(9, 10); + + Assert.AreEqual(1, behaviour.oneFoo); + Assert.AreEqual(1, behaviour.oneBar); + Assert.AreEqual(1, behaviour.oneBaz); + Assert.AreEqual(5, behaviour.oneBarValue); + Assert.AreEqual(6, behaviour.oneBazValueA); + Assert.AreEqual(7, behaviour.oneBazValueB); + + Assert.AreEqual(1, behaviour.twoFoo); + Assert.AreEqual(1, behaviour.twoBar); + Assert.AreEqual(1, behaviour.twoBaz); + Assert.AreEqual(8, behaviour.twoBarValue); + Assert.AreEqual(9, behaviour.twoBazValueA); + Assert.AreEqual(10, behaviour.twoBazValueB); + } + + private class StateClass : MonoBehaviour + { + public int oneEnter; + public int oneFoo; + public int oneBar; + public int oneBaz; + public int oneExit; + + public int oneBarValue; + public int oneBazValueA; + public int oneBazValueB; + + public int twoEnter; + public int twoFoo; + public int twoBar; + public int twoBaz; + public int twoExit; + + public int twoBarValue; + public int twoBazValueA; + public int twoBazValueB; + + void One_Enter() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Enter", Time.frameCount); + oneEnter++; + } + + void One_Foo() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Foo", Time.frameCount); + oneFoo++; + } + + void One_Bar(int value) + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Bar", Time.frameCount); + oneBar++; + oneBarValue = value; + } + + void One_Baz(int valueA, int valueB) + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Baz", Time.frameCount); + oneBaz++; + oneBazValueA = valueA; + oneBazValueB = valueB; + } + + void One_Exit() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Exit", Time.frameCount); + oneExit++; + } + + void Two_Enter() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Enter", Time.frameCount); + twoEnter++; + } + + void Two_Foo() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Foo", Time.frameCount); + twoFoo++; + } + + void Two_Bar(int value) + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Bar", Time.frameCount); + twoBar++; + twoBarValue = value; + } + + void Two_Baz(int valueA, int valueB) + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Baz", Time.frameCount); + twoBaz++; + twoBazValueA = valueA; + twoBazValueB = valueB; + } + + void Two_Exit() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Exit", Time.frameCount); + twoExit++; + } + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestCustomDriver.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Editor/TestCustomDriver.cs.meta new file mode 100644 index 0000000..066db87 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestCustomDriver.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9ac0e8e3b6264af6ad5122d174f3e4b5 +timeCreated: 1567780312 \ No newline at end of file diff --git a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestDerivedFromSuperClass.cs b/StateMachine/Assets/MonsterLove/Tests/Editor/TestDerivedFromSuperClass.cs similarity index 53% rename from example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestDerivedFromSuperClass.cs rename to StateMachine/Assets/MonsterLove/Tests/Editor/TestDerivedFromSuperClass.cs index 2020019..879b07d 100644 --- a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestDerivedFromSuperClass.cs +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestDerivedFromSuperClass.cs @@ -39,38 +39,21 @@ public void Kill() [Test] public void InitialTransition() { - //This is an odd request by a user, where they wanted to use methods declared in a super class. By default we expect this to fail, but we can enable this behaivour - //by removing BindingFlags.DeclaredOnly from the reflection routine in StateMachine.cs - fsm = engine.Initialize(behaviour, States.One); fsm.ChangeState(States.Two); //Test for when we want to include superclass methods - //Assert.AreEqual(1, behaviour.oneStats.enterCount); - //Assert.AreEqual(0, behaviour.oneStats.updateCount); - //Assert.AreEqual(0, behaviour.oneStats.lateUpdateCount); - //Assert.AreEqual(1, behaviour.oneStats.exitCount); - //Assert.AreEqual(1, behaviour.oneStats.finallyCount); - - //Assert.AreEqual(1, behaviour.twoStats.enterCount); - //Assert.AreEqual(0, behaviour.twoStats.updateCount); - //Assert.AreEqual(0, behaviour.twoStats.lateUpdateCount); - //Assert.AreEqual(0, behaviour.twoStats.exitCount); - //Assert.AreEqual(0, behaviour.twoStats.finallyCount); - - //Test for no superclass methods - Assert.AreEqual(0, behaviour.oneStats.enterCount); + Assert.AreEqual(1, behaviour.oneStats.enterCount); Assert.AreEqual(0, behaviour.oneStats.updateCount); Assert.AreEqual(0, behaviour.oneStats.lateUpdateCount); - Assert.AreEqual(0, behaviour.oneStats.exitCount); - Assert.AreEqual(0, behaviour.oneStats.finallyCount); + Assert.AreEqual(1, behaviour.oneStats.exitCount); + Assert.AreEqual(1, behaviour.oneStats.finallyCount); - Assert.AreEqual(0, behaviour.twoStats.enterCount); + Assert.AreEqual(1, behaviour.twoStats.enterCount); Assert.AreEqual(0, behaviour.twoStats.updateCount); Assert.AreEqual(0, behaviour.twoStats.lateUpdateCount); Assert.AreEqual(0, behaviour.twoStats.exitCount); Assert.AreEqual(0, behaviour.twoStats.finallyCount); - } } diff --git a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestDerivedFromSuperClass.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Editor/TestDerivedFromSuperClass.cs.meta similarity index 100% rename from example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestDerivedFromSuperClass.cs.meta rename to StateMachine/Assets/MonsterLove/Tests/Editor/TestDerivedFromSuperClass.cs.meta diff --git a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestDisabledComponent.cs b/StateMachine/Assets/MonsterLove/Tests/Editor/TestDisabledComponent.cs similarity index 100% rename from example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestDisabledComponent.cs rename to StateMachine/Assets/MonsterLove/Tests/Editor/TestDisabledComponent.cs diff --git a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestDisabledComponent.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Editor/TestDisabledComponent.cs.meta similarity index 100% rename from example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestDisabledComponent.cs.meta rename to StateMachine/Assets/MonsterLove/Tests/Editor/TestDisabledComponent.cs.meta diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestDriverLifecycle.cs b/StateMachine/Assets/MonsterLove/Tests/Editor/TestDriverLifecycle.cs new file mode 100644 index 0000000..c09a20a --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestDriverLifecycle.cs @@ -0,0 +1,145 @@ +using System.Collections; +using MonsterLove.StateMachine; +using NUnit.Framework; +using UnityEditor; +using UnityEngine; +using UnityEngine.PlayerLoop; +using UnityEngine.TestTools; + +public class TestDriverLifecycle +{ + public enum States + { + One, + Two, + Three, + Four, + } + + public class Driver + { + public StateEvent Foo; + } + + private GameObject go; + private StateClass behaviour; + private StateMachine fsm; + + [SetUp] + public void Init() + { + go = new GameObject(); + behaviour = go.AddComponent(); + + fsm = new StateMachine(behaviour); + } + + [TearDown] + public void Kill() + { + Object.DestroyImmediate(go); + } + + [Test] + public void TestDriverEventDoesntFireBeforeStateSet() + { + fsm.Driver.Foo.Invoke(); + + Assert.AreEqual(0, behaviour.oneFoo); + + fsm.ChangeState(States.One); + + fsm.Driver.Foo.Invoke(); + + Assert.AreEqual(1, behaviour.oneFoo); + } + + private class StateClass : MonoBehaviour + { + public int oneEnter; + public int oneFoo; + public int oneBar; + public int oneBaz; + public int oneExit; + + public int oneBarValue; + public int oneBazValueA; + public int oneBazValueB; + + public int twoEnter; + public int twoFoo; + public int twoBar; + public int twoBaz; + public int twoExit; + + public int twoBarValue; + public int twoBazValueA; + public int twoBazValueB; + + void One_Enter() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Enter", Time.frameCount); + oneEnter++; + } + + void One_Foo() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Foo", Time.frameCount); + oneFoo++; + } + + void One_Bar(int value) + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Bar", Time.frameCount); + oneBar++; + oneBarValue = value; + } + + void One_Baz(int valueA, int valueB) + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Baz", Time.frameCount); + oneBaz++; + oneBazValueA = valueA; + oneBazValueB = valueB; + } + + void One_Exit() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Exit", Time.frameCount); + oneExit++; + } + + void Two_Enter() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Enter", Time.frameCount); + twoEnter++; + } + + void Two_Foo() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Foo", Time.frameCount); + twoFoo++; + } + + void Two_Bar(int value) + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Bar", Time.frameCount); + twoBar++; + twoBarValue = value; + } + + void Two_Baz(int valueA, int valueB) + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Baz", Time.frameCount); + twoBaz++; + twoBazValueA = valueA; + twoBazValueB = valueB; + } + + void Two_Exit() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Exit", Time.frameCount); + twoExit++; + } + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestDriverLifecycle.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Editor/TestDriverLifecycle.cs.meta new file mode 100644 index 0000000..a2f30a9 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestDriverLifecycle.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1ef0a3dffdbf4a6e8c8ff686a0b6efa3 +timeCreated: 1616931919 \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestEmptyDriver.cs b/StateMachine/Assets/MonsterLove/Tests/Editor/TestEmptyDriver.cs new file mode 100644 index 0000000..288c8a9 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestEmptyDriver.cs @@ -0,0 +1,147 @@ +using MonsterLove.StateMachine; +using NUnit.Framework; +using UnityEngine; + +public class TestEmptyDriver +{ + public enum States + { + One, + Two, + Three, + Four, + } + + public class Driver + { + } + + private GameObject go; + private StateClass behaviour; + private StateMachine fsm; + + [SetUp] + public void Init() + { + go = new GameObject(); + behaviour = go.AddComponent(); + + fsm = new StateMachine(behaviour); + } + + [TearDown] + public void Kill() + { + Object.DestroyImmediate(go); + } + + + [Test] + public void TestEmptyDriverUpdate() + { + fsm.ChangeState(States.One); + + Assert.AreEqual(1, behaviour.oneEnter); + Assert.AreEqual(0, behaviour.oneExit); + + Assert.AreEqual(0, behaviour.twoEnter); + Assert.AreEqual(0, behaviour.twoExit); + + fsm.ChangeState(States.Two); + + Assert.AreEqual(1, behaviour.oneEnter); + Assert.AreEqual(1, behaviour.oneExit); + + Assert.AreEqual(1, behaviour.twoEnter); + Assert.AreEqual(0, behaviour.twoExit); + } + + private class StateClass : MonoBehaviour + { + public int oneEnter; + public int oneFoo; + public int oneBar; + public int oneBaz; + public int oneExit; + + public int oneBarValue; + public int oneBazValueA; + public int oneBazValueB; + + public int twoEnter; + public int twoFoo; + public int twoBar; + public int twoBaz; + public int twoExit; + + public int twoBarValue; + public int twoBazValueA; + public int twoBazValueB; + + void One_Enter() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Enter", Time.frameCount); + oneEnter++; + } + + void One_Foo() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Foo", Time.frameCount); + oneFoo++; + } + + void One_Bar(int value) + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Bar", Time.frameCount); + oneBar++; + oneBarValue = value; + } + + void One_Baz(int valueA, int valueB) + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Baz", Time.frameCount); + oneBaz++; + oneBazValueA = valueA; + oneBazValueB = valueB; + } + + void One_Exit() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Exit", Time.frameCount); + oneExit++; + } + + void Two_Enter() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Enter", Time.frameCount); + twoEnter++; + } + + void Two_Foo() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Foo", Time.frameCount); + twoFoo++; + } + + void Two_Bar(int value) + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Bar", Time.frameCount); + twoBar++; + twoBarValue = value; + } + + void Two_Baz(int valueA, int valueB) + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Baz", Time.frameCount); + twoBaz++; + twoBazValueA = valueA; + twoBazValueB = valueB; + } + + void Two_Exit() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Exit", Time.frameCount); + twoExit++; + } + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestEmptyDriver.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Editor/TestEmptyDriver.cs.meta new file mode 100644 index 0000000..ccd4d91 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestEmptyDriver.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d6391192757a422793fc48ab8a3fd5b7 +timeCreated: 1568191151 \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestInheritedDriver.cs b/StateMachine/Assets/MonsterLove/Tests/Editor/TestInheritedDriver.cs new file mode 100644 index 0000000..f37dff9 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestInheritedDriver.cs @@ -0,0 +1,129 @@ +using MonsterLove.StateMachine; +using NUnit.Framework; +using UnityEngine; + +public class TestInheritedDriver +{ + public enum States + { + One, + Two, + Three, + Four, + } + + public class Driver : StateDriverUnity + { + public StateEvent Foo; + } + + private GameObject go; + private StateClass behaviour; + private StateMachine fsm; + + [SetUp] + public void Init() + { + go = new GameObject(); + behaviour = go.AddComponent(); + + fsm = new StateMachine(behaviour); + } + + [TearDown] + public void Kill() + { + Object.DestroyImmediate(go); + } + + [Test] + public void TestDriverNotNull() + { + Assert.NotNull(fsm.Driver); + } + + [Test] + public void TestCustomEvents() + { + fsm.ChangeState(States.One); + + fsm.Driver.Foo.Invoke(); + fsm.Driver.Update.Invoke(); + + Assert.AreEqual(1, behaviour.oneFoo); + Assert.AreEqual(1, behaviour.oneUpdate); + + Assert.AreEqual(0, behaviour.twoFoo); + Assert.AreEqual(0, behaviour.twoUpdate); + + fsm.ChangeState(States.Two); + + fsm.Driver.Foo.Invoke(); + fsm.Driver.Update.Invoke(); + + Assert.AreEqual(1, behaviour.oneFoo); + Assert.AreEqual(1, behaviour.oneUpdate); + + Assert.AreEqual(1, behaviour.twoFoo); + Assert.AreEqual(1, behaviour.twoUpdate); + } + + private class StateClass : MonoBehaviour + { + public int oneEnter; + public int oneFoo; + public int oneUpdate; + public int oneExit; + + public int twoEnter; + public int twoFoo; + public int twoUpdate; + public int twoExit; + + void One_Enter() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Enter", Time.frameCount); + oneEnter++; + } + + void One_Foo() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Foo", Time.frameCount); + oneFoo++; + } + + void One_Update() + { + oneUpdate++; + } + + void One_Exit() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Exit", Time.frameCount); + oneExit++; + } + + void Two_Enter() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Enter", Time.frameCount); + twoEnter++; + } + + void Two_Foo() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Foo", Time.frameCount); + twoFoo++; + } + + void Two_Update() + { + twoUpdate++; + } + + void Two_Exit() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Exit", Time.frameCount); + twoExit++; + } + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestInheritedDriver.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Editor/TestInheritedDriver.cs.meta new file mode 100644 index 0000000..449bdad --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestInheritedDriver.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7fe6b2aed376482ab4ab9842c0e791b3 +timeCreated: 1568136312 \ No newline at end of file diff --git a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestMultipleSubscribers.cs b/StateMachine/Assets/MonsterLove/Tests/Editor/TestMultipleSubscribers.cs similarity index 100% rename from example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestMultipleSubscribers.cs rename to StateMachine/Assets/MonsterLove/Tests/Editor/TestMultipleSubscribers.cs diff --git a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestMultipleSubscribers.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Editor/TestMultipleSubscribers.cs.meta similarity index 100% rename from example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestMultipleSubscribers.cs.meta rename to StateMachine/Assets/MonsterLove/Tests/Editor/TestMultipleSubscribers.cs.meta diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestNonStandardEnums.cs b/StateMachine/Assets/MonsterLove/Tests/Editor/TestNonStandardEnums.cs new file mode 100644 index 0000000..c623321 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestNonStandardEnums.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections; +using MonsterLove.StateMachine; +using NUnit.Framework; +using UnityEditor; +using UnityEngine; +using UnityEngine.TestTools; +using Object = UnityEngine.Object; + +public class TestNonStandardEnums +{ + private enum StatesUlong : ulong + { + Foo = ulong.MaxValue, + } + + private GameObject go; + private StateClass behaviour; + private StateMachine fsm; + + [SetUp] + public void Init() + { + go = new GameObject(); + behaviour = go.AddComponent(); + } + + [TearDown] + public void Kill() + { + Object.DestroyImmediate(go); + } + + [Test] + public void TestNonIntEnumErrors() + { + Assert.Catch(typeof(ArgumentException), () => + { + fsm = new StateMachine(behaviour); + }); + } + + private class StateClass : MonoBehaviour + { + + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestNonStandardEnums.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Editor/TestNonStandardEnums.cs.meta new file mode 100644 index 0000000..42240eb --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestNonStandardEnums.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 58f27538abe6462f9ed6996603c5017b +timeCreated: 1616936058 \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestStateClassTypesMismatchDriver.cs b/StateMachine/Assets/MonsterLove/Tests/Editor/TestStateClassTypesMismatchDriver.cs new file mode 100644 index 0000000..0e39a2d --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestStateClassTypesMismatchDriver.cs @@ -0,0 +1,109 @@ +using System; +using MonsterLove.StateMachine; +using NUnit.Framework; +using UnityEngine; +using Object = UnityEngine.Object; + +public class TestStateClassTypesMismatchDriver +{ + public enum States + { + One, + Two, + Three, + Four, + } + + public class Driver + { + public StateEvent Foo; + public StateEvent Bar; + public StateEvent Baz; + } + + private GameObject go; + private StateClass behaviour; + private StateMachine fsm; + + [SetUp] + public void Init() + { + go = new GameObject(); + behaviour = go.AddComponent(); + } + + [TearDown] + public void Kill() + { + Object.DestroyImmediate(go); + } + + [Test] + public void TestMismatchedEvents() + { + Assert.Throws(() => + new StateMachine(behaviour) + ); + } + + private class StateClass : MonoBehaviour + { + public int oneEnter; + public int oneFoo; + public int oneBar; + public int oneBaz; + public int oneExit; + + public int oneBarValue; + public int oneBazValueA; + public int oneBazValueB; + + public int twoEnter; + public int twoExit; + + void One_Enter() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Enter", Time.frameCount); + oneEnter++; + } + + void One_Baz() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Foo", Time.frameCount); + oneFoo++; + } + + void One_Foo(int value) + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Bar", Time.frameCount); + oneBar++; + oneBarValue = value; + } + + void One_Bar(int valueA, int valueB) + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Baz", Time.frameCount); + oneBaz++; + oneBazValueA = valueA; + oneBazValueB = valueB; + } + + void One_Exit() + { + //Debug.LogFormat("State:{0} Frame:{1}", "One Exit", Time.frameCount); + oneExit++; + } + + void Two_Enter() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Enter", Time.frameCount); + twoEnter++; + } + + void Two_Exit() + { + //Debug.LogFormat("State:{0} Frame:{1}", "Two Exit", Time.frameCount); + twoExit++; + } + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestStateClassTypesMismatchDriver.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Editor/TestStateClassTypesMismatchDriver.cs.meta new file mode 100644 index 0000000..1110a99 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestStateClassTypesMismatchDriver.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ac06595e9bcd40348af830ec6a29a7a5 +timeCreated: 1568133089 \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Editor/TestStateEngineInitialization.cs b/StateMachine/Assets/MonsterLove/Tests/Editor/TestStateEngineInitialization.cs new file mode 100644 index 0000000..18ddb7c --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Editor/TestStateEngineInitialization.cs @@ -0,0 +1,101 @@ +using System; +using MonsterLove.StateMachine; +using NUnit.Framework; +using UnityEngine; +using Object = UnityEngine.Object; + +[TestFixture] +[Category("State Machine Tests")] +public class TestStateEngineInitialization +{ + + public enum TestStates + { + StateInit, + StatePlay, + StateEnd, + } + + public enum TestNoDefines + { + } + + private GameObject go; + private ClassWithBasicStates behaviour; + private StateMachineRunner engine; + + [SetUp] + public void Init() + { + go = new GameObject("stateTest"); + behaviour = go.AddComponent(); + engine = go.AddComponent(); + } + + [TearDown] + public void Kill() + { + Object.DestroyImmediate(go); + } + + [Test] + public void TestInitializedTwice() + { + //Should this throw an error? I'm not sure? + var fsm = engine.Initialize(behaviour); + fsm = engine.Initialize(behaviour); + } + + [Test] + public void TestStatesDefined() + { + Assert.Throws( + () => { engine.Initialize(behaviour); } + ); + } + + [Test] + public void TestStatePropBeforeChange() + { + var fsm = new StateMachine(behaviour); + + Assert.Throws(() => + { + TestStates state = fsm.State; + }); + + fsm.ChangeState(TestStates.StateInit); + + Assert.AreEqual(TestStates.StateInit, fsm.State); + } + + [Test] + public void TestLastStatePropBeforeChange() + { + var fsm = new StateMachine(behaviour); + + Assert.Throws(() => + { + TestStates state = fsm.LastState; + }); + Assert.IsFalse(fsm.LastStateExists); + + + fsm.ChangeState(TestStates.StateInit); + + //Conflicted about this. Prefer to return default values, or the current state + //but that would undermine correctness + Assert.Throws(() => + { + TestStates state = fsm.LastState; + }); + Assert.IsFalse(fsm.LastStateExists); + + fsm.ChangeState(TestStates.StatePlay); + + Assert.AreEqual(TestStates.StateInit, fsm.LastState); + Assert.IsTrue(fsm.LastStateExists); + } +} + + diff --git a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestStateEngineInitialization.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Editor/TestStateEngineInitialization.cs.meta similarity index 100% rename from example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestStateEngineInitialization.cs.meta rename to StateMachine/Assets/MonsterLove/Tests/Editor/TestStateEngineInitialization.cs.meta diff --git a/StateMachine/Assets/MonsterLove/Tests/Runtime.meta b/StateMachine/Assets/MonsterLove/Tests/Runtime.meta new file mode 100644 index 0000000..2eb1903 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4f46855213027aa4c83ef9e551448ea5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/example_project/Assets/TestCases/ClassDerivedFromSuperClass.cs b/StateMachine/Assets/MonsterLove/Tests/Runtime/ClassDerivedFromSuperClass.cs similarity index 100% rename from example_project/Assets/TestCases/ClassDerivedFromSuperClass.cs rename to StateMachine/Assets/MonsterLove/Tests/Runtime/ClassDerivedFromSuperClass.cs diff --git a/example_project/Assets/TestCases/ClassDerivedFromSuperClass.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Runtime/ClassDerivedFromSuperClass.cs.meta similarity index 100% rename from example_project/Assets/TestCases/ClassDerivedFromSuperClass.cs.meta rename to StateMachine/Assets/MonsterLove/Tests/Runtime/ClassDerivedFromSuperClass.cs.meta diff --git a/example_project/Assets/TestCases/ClassWithBasicStates.cs b/StateMachine/Assets/MonsterLove/Tests/Runtime/ClassWithBasicStates.cs similarity index 100% rename from example_project/Assets/TestCases/ClassWithBasicStates.cs rename to StateMachine/Assets/MonsterLove/Tests/Runtime/ClassWithBasicStates.cs diff --git a/example_project/Assets/TestCases/ClassWithBasicStates.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Runtime/ClassWithBasicStates.cs.meta similarity index 100% rename from example_project/Assets/TestCases/ClassWithBasicStates.cs.meta rename to StateMachine/Assets/MonsterLove/Tests/Runtime/ClassWithBasicStates.cs.meta diff --git a/StateMachine/Assets/MonsterLove/Tests/Runtime/MonsterLove.StateMachine.Tests.Runtime.asmdef b/StateMachine/Assets/MonsterLove/Tests/Runtime/MonsterLove.StateMachine.Tests.Runtime.asmdef new file mode 100644 index 0000000..46640fc --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime/MonsterLove.StateMachine.Tests.Runtime.asmdef @@ -0,0 +1,21 @@ +{ + "name": "MonsterLove.StateMachine.Tests.Runtime", + "references": [ + "MonsterLove.StateMachine.Runtime", + "UnityEngine.TestRunner", + "UnityEditor.TestRunner" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll" + ], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Runtime/MonsterLove.StateMachine.Tests.Runtime.asmdef.meta b/StateMachine/Assets/MonsterLove/Tests/Runtime/MonsterLove.StateMachine.Tests.Runtime.asmdef.meta new file mode 100644 index 0000000..8da6a69 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime/MonsterLove.StateMachine.Tests.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f9fb370cdd6625f4fb8a0dec85124b0c +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncCustomDriver.cs b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncCustomDriver.cs new file mode 100644 index 0000000..6be8377 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncCustomDriver.cs @@ -0,0 +1,199 @@ +using System.Collections; +using MonsterLove.StateMachine; +using NUnit.Framework; +using UnityEngine; +using UnityEngine.TestTools; + +namespace Tests +{ + public class TestAsyncCustomDriver + { + public enum States + { + One, + Two, + Three, + Four, + } + + private GameObject go; + private StateClass behaviour; + private StateMachine fsm; + + [SetUp] + public void Init() + { + go = new GameObject(); + behaviour = go.AddComponent(); + + fsm = new StateMachine(behaviour); + behaviour.fsm = fsm; + } + + [TearDown] + public void Kill() + { + Object.Destroy(go); + } + + [UnityTest] + public IEnumerator TestChange() + { + // /1 + fsm.ChangeState(States.One); + + yield return null; + + Assert.AreEqual(0, behaviour.oneEnter); + Assert.AreEqual(0, behaviour.oneUpdate); //Enter still running, no update called + + yield return null; + + Assert.AreEqual(1, behaviour.oneEnter); //Enter now complete + Assert.AreEqual(0, behaviour.oneUpdate); //Update executes before co-routine, therefore update not run yet + + yield return null; + + Assert.AreEqual(1, behaviour.oneEnter); + Assert.AreEqual(1, behaviour.oneUpdate); //Update has first chance to run + } + + private class StateClass : MonoBehaviour + { + public StateMachine fsm; + + public int oneEnter; + public int oneUpdate; + public int oneExit; + public int oneFinally; + + public int twoEnter; + public int twoUpdate; + public int twoExit; + public int twoFinally; + + public int threeEnter; + public int threeUpdate; + public int threeExit; + public int threeFinally; + + public int fourEnter; + public int fourUpdate; + public int fourExit; + public int fourFinally; + + void Update() + { + fsm.Driver.Update.Invoke(); + } + + IEnumerator One_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Enter Start", Time.frameCount); + + yield return null; + yield return null; + + Debug.LogFormat("State:{0} Frame:{1}", "One Enter End", Time.frameCount); + + oneEnter++; + } + + void One_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Update", Time.frameCount); + oneUpdate++; + } + + IEnumerator One_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Exit Start", Time.frameCount); + + yield return null; + yield return null; + + Debug.LogFormat("State:{0} Frame:{1}", "One Exit End", Time.frameCount); + + oneExit++; + } + + void One_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Finally", Time.frameCount); + oneFinally++; + } + + void Two_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Enter", Time.frameCount); + twoEnter++; + } + + void Two_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Update", Time.frameCount); + twoUpdate++; + } + + void Two_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Exit", Time.frameCount); + twoExit++; + } + + void Two_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Finally", Time.frameCount); + twoFinally++; + } + + void Three_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Enter", Time.frameCount); + threeEnter++; + } + + void Three_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Update", Time.frameCount); + threeUpdate++; + } + + void Three_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Exit", Time.frameCount); + threeExit++; + } + + void Three_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Finally", Time.frameCount); + threeFinally++; + } + + void Four_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Enter", Time.frameCount); + fourEnter++; + } + + void Four_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Update", Time.frameCount); + fourUpdate++; + } + + void Four_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Exit", Time.frameCount); + fourExit++; + } + + void Four_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Finally", Time.frameCount); + fourFinally++; + } + } + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncCustomDriver.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncCustomDriver.cs.meta new file mode 100644 index 0000000..ca6896d --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncCustomDriver.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7b734601d42952c488c972b05398a234 +timeCreated: 1567675903 \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncOverwrite.cs b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncOverwrite.cs new file mode 100644 index 0000000..81e77ed --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncOverwrite.cs @@ -0,0 +1,286 @@ +using System.Collections; +using MonsterLove.StateMachine; +using NUnit.Framework; +using UnityEngine; +using UnityEngine.TestTools; + +namespace Tests +{ + public class TestChangeAsyncOverwrite + { + public enum States + { + One, + Two, + Three, + Four, + } + + private GameObject go; + private StateClass behaviour; + private StateMachine fsm; + private float duration = 0.5f; + + [SetUp] + public void Init() + { + go = new GameObject(); + behaviour = go.AddComponent(); + behaviour.duration = duration; + + fsm = StateMachine.Initialize(behaviour); + } + + [TearDown] + public void Kill() + { + Object.Destroy(go); + } + + [UnityTest] + public IEnumerator TestAsyncEnterExit() + { + // 1 + fsm.ChangeState(States.One, StateTransition.Overwrite); + + // 1*__/2 + fsm.ChangeState(States.Two, StateTransition.Overwrite); + + Assert.AreEqual(States.One, fsm.LastState); + Assert.AreEqual(States.Two, fsm.State); + Assert.AreEqual(States.Two, fsm.NextState); + + yield return new WaitForSeconds(duration + 0.2f); + + Assert.AreEqual(1, behaviour.oneEnter); + Assert.AreEqual(0, behaviour.oneUpdate); + Assert.AreEqual(0, behaviour.oneExit); + Assert.AreEqual(1, behaviour.oneFinally); + + Assert.AreEqual(1, behaviour.twoEnter); + + Assert.AreEqual(States.One, fsm.LastState); + Assert.AreEqual(States.Two, fsm.State); + Assert.AreEqual(States.Two, fsm.NextState); + } + + [UnityTest] + public IEnumerator TestChangeDuringAsyncEnter() + { + // 1 + fsm.ChangeState(States.One, StateTransition.Overwrite); + + // 1\__/2 + fsm.ChangeState(States.Two, StateTransition.Safe); + + Assert.AreEqual(false, fsm.LastStateExists); + Assert.AreEqual(States.One, fsm.State); + Assert.AreEqual(States.Two, fsm.NextState); + + yield return new WaitForSeconds(duration + duration * 0.5f); + + Assert.AreEqual(1, behaviour.oneEnter); + Assert.AreEqual(0, behaviour.oneUpdate); + Assert.AreEqual(1, behaviour.oneExit); + Assert.AreEqual(1, behaviour.oneFinally); + + Assert.AreEqual(0, behaviour.twoEnter); + + Assert.AreEqual(0, behaviour.threeEnter); + + Assert.AreEqual(States.One, fsm.LastState); + Assert.AreEqual(States.Two, fsm.State); + Assert.AreEqual(States.Two, fsm.NextState); + + // 1\__*2__3 + fsm.ChangeState(States.Three, StateTransition.Overwrite); + + Assert.AreEqual(0, behaviour.twoEnter); //Intro never completes + Assert.AreEqual(1, behaviour.twoExit); //Single frame Exit still fires. Arguably more consistent that exit doesn't fire, instead relying on finally(), however this would be a breaking change + Assert.AreEqual(0, behaviour.twoUpdate); + Assert.AreEqual(1, behaviour.twoFinally); + + Assert.AreEqual(1, behaviour.threeEnter); + + Assert.AreEqual(States.Two, fsm.LastState); + Assert.AreEqual(States.Three, fsm.State); + Assert.AreEqual(States.Three, fsm.NextState); + } + + [UnityTest] + public IEnumerator TestChangeDuringAsyncExit() + { + // 1 + fsm.ChangeState(States.One, StateTransition.Overwrite); + + // 1\__/2 + fsm.ChangeState(States.Two, StateTransition.Safe); + + Assert.AreEqual(false, fsm.LastStateExists); + Assert.AreEqual(States.One, fsm.State); + Assert.AreEqual(States.Two, fsm.NextState); + + yield return new WaitForSeconds(duration * 0.5f); + + Assert.AreEqual(1, behaviour.oneEnter); + Assert.AreEqual(0, behaviour.oneUpdate); + Assert.AreEqual(0, behaviour.oneExit); + Assert.AreEqual(0, behaviour.oneFinally); + + Assert.AreEqual(0, behaviour.twoEnter); + + Assert.AreEqual(false, fsm.LastStateExists); + Assert.AreEqual(States.One, fsm.State); + Assert.AreEqual(States.Two, fsm.NextState); + + // 1*__/4 + fsm.ChangeState(States.Four, StateTransition.Overwrite); + + Assert.AreEqual(States.One, fsm.LastState); + Assert.AreEqual(States.Four, fsm.State); + Assert.AreEqual(States.Four, fsm.NextState); + + yield return new WaitForSeconds(duration + 0.2f); + + Assert.AreEqual(1, behaviour.oneEnter); + Assert.AreEqual(0, behaviour.oneUpdate); + Assert.AreEqual(0, behaviour.oneExit); //Cancelled - never completed + Assert.AreEqual(1, behaviour.oneFinally); + + Assert.AreEqual(0, behaviour.twoEnter); //Never entered + + Assert.AreEqual(1, behaviour.fourEnter); + + Assert.AreEqual(States.One, fsm.LastState); + Assert.AreEqual(States.Four, fsm.State); + Assert.AreEqual(States.Four, fsm.NextState); + } + + private class StateClass : MonoBehaviour + { + public float duration; + + public int oneEnter; + public int oneUpdate; + public int oneExit; + public int oneFinally; + + public int twoEnter; + public int twoUpdate; + public int twoExit; + public int twoFinally; + + public int threeEnter; + public int threeUpdate; + public int threeExit; + public int threeFinally; + + public int fourEnter; + public int fourUpdate; + public int fourExit; + public int fourFinally; + + void One_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Enter", Time.frameCount); + oneEnter++; + } + + void One_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Update", Time.frameCount); + oneUpdate++; + } + + IEnumerator One_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Exit Start", Time.frameCount); + yield return new WaitForSeconds(duration); + Debug.LogFormat("State:{0} Frame:{1}", "One Exit End", Time.frameCount); + oneExit++; + } + + void One_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Finally", Time.frameCount); + oneFinally++; + } + + IEnumerator Two_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Enter Start", Time.frameCount); + yield return new WaitForSeconds(duration); + Debug.LogFormat("State:{0} Frame:{1}", "Two Enter End", Time.frameCount); + twoEnter++; + } + + void Two_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Update", Time.frameCount); + twoUpdate++; + } + + void Two_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Exit", Time.frameCount); + twoExit++; + } + + void Two_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Finally", Time.frameCount); + twoFinally++; + } + + void Three_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Enter", Time.frameCount); + threeEnter++; + } + + void Three_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Update", Time.frameCount); + threeUpdate++; + } + + void Three_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Exit", Time.frameCount); + threeExit++; + } + + void Three_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Finally", Time.frameCount); + threeFinally++; + } + + IEnumerator Four_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Enter Start", Time.frameCount); + yield return new WaitForSeconds(duration); + Debug.LogFormat("State:{0} Frame:{1}", "Four Enter End", Time.frameCount); + fourEnter++; + } + + void Four_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Update", Time.frameCount); + fourUpdate++; + } + + void Four_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Exit", Time.frameCount); + fourExit++; + } + + void Four_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Finally", Time.frameCount); + fourFinally++; + } + } + } +} \ No newline at end of file diff --git a/example_project/Assets/TestCases/ClassDetectOnCollisionEnter.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncOverwrite.cs.meta similarity index 69% rename from example_project/Assets/TestCases/ClassDetectOnCollisionEnter.cs.meta rename to StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncOverwrite.cs.meta index c66689c..c72e9b2 100644 --- a/example_project/Assets/TestCases/ClassDetectOnCollisionEnter.cs.meta +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncOverwrite.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 3c3601912722ea442872ab32876d68a1 -timeCreated: 1455010010 -licenseType: Free +guid: 1a082dc9366ca784087bde0dde49a5ce MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncSafe.cs b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncSafe.cs new file mode 100644 index 0000000..82f1215 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncSafe.cs @@ -0,0 +1,302 @@ +using System.Collections; +using MonsterLove.StateMachine; +using NUnit.Framework; +using UnityEngine; +using UnityEngine.TestTools; + +namespace Tests +{ + public class TestChangeAsyncSafe + { + public enum States + { + One, + Two, + Three, + Four, + } + + private GameObject go; + private StateClass behaviour; + private StateMachine fsm; + private float duration = 0.5f; + + [SetUp] + public void Init() + { + go = new GameObject(); + behaviour = go.AddComponent(); + behaviour.duration = duration; + + fsm = StateMachine.Initialize(behaviour); + } + + [TearDown] + public void Kill() + { + Object.Destroy(go); + } + + [UnityTest] + public IEnumerator TestAsyncEnterExit() + { + // 1 + + fsm.ChangeState(States.One, StateTransition.Safe); + + Assert.AreEqual(1, behaviour.oneEnter); + Assert.AreEqual(0, behaviour.oneExit); + Assert.AreEqual(0, behaviour.twoEnter); + + // 1\__/2 + + fsm.ChangeState(States.Two, StateTransition.Safe); + + Assert.Catch(() => { var state = fsm.LastState;}); + Assert.AreEqual(States.One, fsm.State); + Assert.AreEqual(States.Two, fsm.NextState); + + Assert.AreEqual(1, behaviour.oneEnter); + Assert.AreEqual(0, behaviour.oneExit); + Assert.AreEqual(0, behaviour.twoEnter); + + yield return new WaitForSeconds(duration + duration + 0.2f); + + Assert.AreEqual(States.One, fsm.LastState); + Assert.AreEqual(States.Two, fsm.State); + Assert.AreEqual(States.Two, fsm.NextState); + + Assert.AreEqual(1, behaviour.oneEnter); + Assert.AreEqual(1, behaviour.oneExit); + Assert.AreEqual(1, behaviour.twoEnter); + } + + [UnityTest] + public IEnumerator TestChangeDuringAsyncEnter() + { + // 3 + fsm.ChangeState(States.Three, StateTransition.Safe); + + // 3__/2 + fsm.ChangeState(States.Two); + + Assert.AreEqual(1, behaviour.threeExit); + + Assert.AreEqual(0, behaviour.twoEnter); + + Assert.AreEqual(States.Three, fsm.LastState); + Assert.AreEqual(States.Two, fsm.State); + Assert.AreEqual(States.Two, fsm.NextState); + + yield return new WaitForSeconds(duration / 2f); + + // 3__/2\__4 //In safe mode, once a state is entered, both enter and exit are allowed to finish + fsm.ChangeState(States.Four); + + Assert.AreEqual(1, behaviour.threeExit); + + Assert.AreEqual(0, behaviour.twoEnter); + Assert.AreEqual(0, behaviour.twoUpdate); + Assert.AreEqual(0, behaviour.twoExit); + Assert.AreEqual(0, behaviour.twoFinally); + + Assert.AreEqual(0, behaviour.fourEnter); + + Assert.AreEqual(States.Three, fsm.LastState); + Assert.AreEqual(States.Two, fsm.State); + Assert.AreEqual(States.Four, fsm.NextState); + + yield return new WaitForSeconds(duration / 2f + duration + 0.2f); + + Assert.AreEqual(1, behaviour.threeExit); + + Assert.AreEqual(1, behaviour.twoEnter); + Assert.AreEqual(1, behaviour.twoUpdate); //Single frame update while changing from Enter To Exit Routines. Not sure this is desired behaviour (zero update frames is more consistent), but don't want to cause a breaking change + Assert.AreEqual(1, behaviour.twoExit); + Assert.AreEqual(1, behaviour.twoFinally); + + Assert.AreEqual(1, behaviour.fourEnter); + + Assert.AreEqual(States.Two, fsm.LastState); + Assert.AreEqual(States.Four, fsm.State); + Assert.AreEqual(States.Four, fsm.NextState); + } + + [UnityTest] + public IEnumerator TestChangeDuringAsyncExit() + { + // 1 + fsm.ChangeState(States.One, StateTransition.Safe); + + // 1\__3 + fsm.ChangeState(States.Three, StateTransition.Safe); + + yield return new WaitForSeconds(duration / 2f); + + Assert.AreEqual(0, behaviour.oneExit); + + Assert.AreEqual(0, behaviour.threeEnter); + Assert.AreEqual(0, behaviour.threeExit); + + Assert.AreEqual(0, behaviour.fourEnter); + + Assert.Catch(() => { var state = fsm.LastState;}); + Assert.AreEqual(States.One, fsm.State); + Assert.AreEqual(States.Three, fsm.NextState); + + // 1\__4 //In safe mode, before state is entered, newer state will supersede queued state + fsm.ChangeState(States.Four); + + Assert.AreEqual(0, behaviour.oneExit); + + Assert.AreEqual(0, behaviour.threeEnter); + Assert.AreEqual(0, behaviour.threeExit); + + Assert.AreEqual(0, behaviour.fourEnter); + + Assert.Catch(() => { var state = fsm.LastState;}); + Assert.AreEqual(States.One, fsm.State); + Assert.AreEqual(States.Four, fsm.NextState); + + yield return new WaitForSeconds(duration / 2f + 0.2f); + + Assert.AreEqual(1, behaviour.oneExit); + + Assert.AreEqual(0, behaviour.threeEnter); //Three never runs + Assert.AreEqual(0, behaviour.threeExit); + + Assert.AreEqual(1, behaviour.fourEnter); + + Assert.AreEqual(States.One, fsm.LastState); + Assert.AreEqual(States.Four, fsm.State); + Assert.AreEqual(States.Four, fsm.NextState); + } + + private class StateClass : MonoBehaviour + { + public float duration; + + public int oneEnter; + public int oneUpdate; + public int oneExit; + public int oneFinally; + + public int twoEnter; + public int twoUpdate; + public int twoExit; + public int twoFinally; + + public int threeEnter; + public int threeUpdate; + public int threeExit; + public int threeFinally; + + public int fourEnter; + public int fourUpdate; + public int fourExit; + public int fourFinally; + + void One_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Enter", Time.frameCount); + oneEnter++; + } + + void One_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Update", Time.frameCount); + oneUpdate++; + } + + IEnumerator One_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Exit Start", Time.frameCount); + yield return new WaitForSeconds(duration); + Debug.LogFormat("State:{0} Frame:{1}", "One Exit End", Time.frameCount); + oneExit++; + } + + void One_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Finally", Time.frameCount); + oneFinally++; + } + + IEnumerator Two_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Enter Start", Time.frameCount); + yield return new WaitForSeconds(duration); + Debug.LogFormat("State:{0} Frame:{1}", "Two Enter End", Time.frameCount); + twoEnter++; + } + + void Two_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Update", Time.frameCount); + twoUpdate++; + } + + IEnumerator Two_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Exit Start", Time.frameCount); + twoExit++; + yield return new WaitForSeconds(duration); + Debug.LogFormat("State:{0} Frame:{1}", "Two Exit End", Time.frameCount); + } + + void Two_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Finally", Time.frameCount); + twoFinally++; + } + + void Three_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Enter", Time.frameCount); + threeEnter++; + } + + void Three_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Update", Time.frameCount); + threeUpdate++; + } + + void Three_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Exit", Time.frameCount); + threeExit++; + } + + void Three_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Finally", Time.frameCount); + threeFinally++; + } + + void Four_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Enter", Time.frameCount); + fourEnter++; + } + + void Four_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Update", Time.frameCount); + fourUpdate++; + } + + void Four_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Exit", Time.frameCount); + fourExit++; + } + + void Four_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Finally", Time.frameCount); + fourFinally++; + } + } + } +} \ No newline at end of file diff --git a/example_project/Assets/TestCases/ClassDisabled.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncSafe.cs.meta similarity index 69% rename from example_project/Assets/TestCases/ClassDisabled.cs.meta rename to StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncSafe.cs.meta index 2a3d473..4f22c7b 100644 --- a/example_project/Assets/TestCases/ClassDisabled.cs.meta +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeAsyncSafe.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: a57b4763d53c79c4c94034be0abbcd0d -timeCreated: 1457611275 -licenseType: Free +guid: 6ba617b22bb510241b31b54b32315873 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeFromTransition.cs b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeFromTransition.cs new file mode 100644 index 0000000..3afc65c --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeFromTransition.cs @@ -0,0 +1,220 @@ +using System; +using System.Collections; +using MonsterLove.StateMachine; +using NUnit.Framework; +using UnityEngine; +using UnityEngine.Analytics; +using UnityEngine.TestTools; +using Object = UnityEngine.Object; + +namespace Tests +{ + // TEST DESCRIPTION + // + // Coverage for the scenario where state transition is aborted based on a flag evaluated within transition Enter and Exit methods + public class TestChangeFromTransition + { + public enum States + { + One, + Two, + Three, + Four, + } + + private GameObject go; + private StateClass behaviour; + private StateMachine fsm; + + [SetUp] + public void Init() + { + go = new GameObject(); + behaviour = go.AddComponent(); + + fsm = StateMachine.Initialize(behaviour); + behaviour.fsm = fsm; + } + + [TearDown] + public void Kill() + { + Object.Destroy(go); + } + + [Test] + public void TestChangeFromExit() + { + //TODO stack overflow is not the expected behaviour - also seems to be periodically crashing test suite. Disable for now + + // // 1 + // fsm.ChangeState(States.One); + // + // + // + // // 1-__3 //One_Exit contains change to 3 + // Assert.Throws( + // ()=> fsm.ChangeState(States.Two) + // ); + // + // + // + // // Assert.AreEqual(1, behaviour.oneEnter); + // // Assert.AreEqual(0, behaviour.oneUpdate); + // // Assert.AreEqual(1, behaviour.oneExit); + // // Assert.AreEqual(1, behaviour.oneFinally); + // // + // // Assert.AreEqual(0, behaviour.twoEnter); + // // Assert.AreEqual(0, behaviour.twoUpdate); + // // Assert.AreEqual(0, behaviour.twoFinally); + // // + // // Assert.AreEqual(1, behaviour.threeEnter); + } + + + [Test] + public void TestChangeFromEnter() + { + fsm.ChangeState(States.Two); + + // -4__3 //Four_Enter contains change to 3 + fsm.ChangeState(States.Four); + + Assert.AreEqual(1, behaviour.fourEnter); //This will complete after Exit and Finally. Not sure how to make this subtle side effect more obvious + Assert.AreEqual(0, behaviour.fourUpdate); + Assert.AreEqual(1, behaviour.fourExit); + Assert.AreEqual(1, behaviour.fourFinally); + + Assert.AreEqual(1, behaviour.threeEnter); + + Assert.AreEqual(States.Four, fsm.LastState); + Assert.AreEqual(States.Three, fsm.State); + Assert.AreEqual(States.Three, fsm.NextState); + } + + private class StateClass : MonoBehaviour + { + public StateMachine fsm; + + public int oneEnter; + public int oneUpdate; + public int oneExit; + public int oneFinally; + + public int twoEnter; + public int twoUpdate; + public int twoExit; + public int twoFinally; + + public int threeEnter; + public int threeUpdate; + public int threeExit; + public int threeFinally; + + public int fourEnter; + public int fourUpdate; + public int fourExit; + public int fourFinally; + + + void One_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Enter", Time.frameCount); + oneEnter++; + } + + void One_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Update", Time.frameCount); + oneUpdate++; + } + + void One_Exit() + { + fsm.ChangeState(States.Three); + + Debug.LogFormat("State:{0} Frame:{1}", "One Exit", Time.frameCount); + oneExit++; + } + + void One_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Finally", Time.frameCount); + oneFinally++; + } + + void Two_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Enter", Time.frameCount); + twoEnter++; + } + + void Two_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Update", Time.frameCount); + twoUpdate++; + } + + void Two_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Exit", Time.frameCount); + twoExit++; + } + + void Two_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Finally", Time.frameCount); + twoFinally++; + } + + void Three_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Enter", Time.frameCount); + threeEnter++; + } + + void Three_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Update", Time.frameCount); + threeUpdate++; + } + + void Three_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Exit", Time.frameCount); + threeExit++; + } + + void Three_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Finally", Time.frameCount); + threeFinally++; + } + + void Four_Enter() + { + fsm.ChangeState(States.Three); + Debug.LogFormat("State:{0} Frame:{1}", "Four Enter", Time.frameCount); + fourEnter++; + } + + void Four_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Update", Time.frameCount); + fourUpdate++; + } + + void Four_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Exit", Time.frameCount); + fourExit++; + } + + void Four_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Finally", Time.frameCount); + fourFinally++; + } + } + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeFromTransition.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeFromTransition.cs.meta new file mode 100644 index 0000000..1af2b86 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeFromTransition.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: edc9ab4afa17406b8cdfe574960c6177 +timeCreated: 1567694365 \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeState.cs b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeState.cs new file mode 100644 index 0000000..1768b1d --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeState.cs @@ -0,0 +1,213 @@ +using System.Collections; +using MonsterLove.StateMachine; +using NUnit.Framework; +using UnityEngine; +using UnityEngine.TestTools; + +namespace Tests +{ + public class TestChangeState + { + public enum States + { + One, + Two, + Three, + Four, + } + + private GameObject go; + private StateClass behaviour; + private StateMachine fsm; + + [SetUp] + public void Init() + { + go = new GameObject(); + behaviour = go.AddComponent(); + + fsm = StateMachine.Initialize(behaviour); + } + + [TearDown] + public void Kill() + { + Object.Destroy(go); + } + + [UnityTest] + public IEnumerator TestChange() + { + fsm.ChangeState(States.One); + + Assert.Catch(()=> + { + var last = fsm.LastState; + }); + Assert.AreEqual(States.One, fsm.State); + Assert.AreEqual(States.One, fsm.NextState); + + yield return null; + + fsm.ChangeState(States.Two); + + Assert.AreEqual(1, behaviour.oneEnter); + Assert.AreEqual(1, behaviour.oneUpdate); + Assert.AreEqual(1, behaviour.oneExit); + Assert.AreEqual(1, behaviour.oneFinally); + Assert.AreEqual(1, behaviour.twoEnter); + Assert.AreEqual(0, behaviour.twoUpdate); //Only changed this frame, hasn't had a chance to update yet + + Assert.AreEqual(States.One, fsm.LastState); + Assert.AreEqual(States.Two, fsm.State); + Assert.AreEqual(States.Two, fsm.NextState); + + yield return null; + + Assert.AreEqual(1, behaviour.twoUpdate); //First update runs a frame later + } + + [UnityTest] + public IEnumerator TestChangeSameFrame() + { + fsm.ChangeState(States.One); + fsm.ChangeState(States.Two); + + Assert.AreEqual(1, behaviour.oneEnter); + Assert.AreEqual(0, behaviour.oneUpdate); //Update never has chance to fire during same frame change + Assert.AreEqual(1, behaviour.oneExit); + Assert.AreEqual(1, behaviour.oneFinally); + Assert.AreEqual(1, behaviour.twoEnter); + Assert.AreEqual(0, behaviour.twoUpdate); + + Assert.AreEqual(States.One, fsm.LastState); + Assert.AreEqual(States.Two, fsm.State); + Assert.AreEqual(States.Two, fsm.NextState); + + + yield return null; + + Assert.AreEqual(0, behaviour.oneUpdate); + Assert.AreEqual(1, behaviour.twoUpdate); //First frame runs in state two + } + + private class StateClass : MonoBehaviour + { + public int oneEnter; + public int oneUpdate; + public int oneExit; + public int oneFinally; + + public int twoEnter; + public int twoUpdate; + public int twoExit; + public int twoFinally; + + public int threeEnter; + public int threeUpdate; + public int threeExit; + public int threeFinally; + + public int fourEnter; + public int fourUpdate; + public int fourExit; + public int fourFinally; + + void One_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Enter", Time.frameCount); + oneEnter++; + } + + void One_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Update", Time.frameCount); + oneUpdate++; + } + + void One_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Exit", Time.frameCount); + oneExit++; + } + + void One_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Finally", Time.frameCount); + oneFinally++; + } + + void Two_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Enter", Time.frameCount); + twoEnter++; + } + + void Two_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Update", Time.frameCount); + twoUpdate++; + } + + void Two_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Exit", Time.frameCount); + twoExit++; + } + + void Two_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Two Finally", Time.frameCount); + twoFinally++; + } + + void Three_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Enter", Time.frameCount); + threeEnter++; + } + + void Three_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Update", Time.frameCount); + threeUpdate++; + } + + void Three_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Exit", Time.frameCount); + threeExit++; + } + + void Three_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Three Finally", Time.frameCount); + threeFinally++; + } + + void Four_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Enter", Time.frameCount); + fourEnter++; + } + + void Four_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Update", Time.frameCount); + fourUpdate++; + } + + void Four_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Exit", Time.frameCount); + fourExit++; + } + + void Four_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "Four Finally", Time.frameCount); + fourFinally++; + } + } + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeState.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeState.cs.meta new file mode 100644 index 0000000..5aeba4c --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestChangeState.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4306d2f2aa71459c9ea87a83001fd117 +timeCreated: 1567675903 \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Runtime/TestMonoBehaviourUpdates.cs b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestMonoBehaviourUpdates.cs new file mode 100644 index 0000000..c7d2d66 --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestMonoBehaviourUpdates.cs @@ -0,0 +1,100 @@ +using System.Collections; +using MonsterLove.StateMachine; +using NUnit.Framework; +using UnityEngine; +using UnityEngine.TestTools; + +namespace Tests +{ + public class TestMonoBehaviourUpdates + { + public enum States + { + One, + Two, + Three, + Four, + } + + private GameObject go; + private StateClass behaviour; + private StateMachine fsm; + + [SetUp] + public void Init() + { + go = new GameObject(); + behaviour = go.AddComponent(); + + fsm = StateMachine.Initialize(behaviour); + } + + [TearDown] + public void Kill() + { + Object.Destroy(go); + } + + [UnityTest] + public IEnumerator TestUpdate() + { + fsm.ChangeState(States.One); + + yield return null; + + Assert.AreEqual(1, behaviour.oneEnter); + Assert.AreEqual(1, behaviour.oneUpdate); + Assert.AreEqual(1, behaviour.oneLateUpdate); + + yield return new WaitForSeconds(Time.fixedDeltaTime); + + Assert.GreaterOrEqual(behaviour.oneFixedUpdate, 1); + } + + private class StateClass : MonoBehaviour + { + public int oneEnter; + public int oneUpdate; + public int oneFixedUpdate; + public int oneLateUpdate; + public int oneExit; + public int oneFinally; + + void One_Enter() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Enter", Time.frameCount); + oneEnter++; + } + + void One_FixedUpdate() + { + Debug.LogFormat("State:{0} Frame:{1}", "One FixedUpdate", Time.frameCount); + oneFixedUpdate++; + } + + void One_Update() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Update", Time.frameCount); + oneUpdate++; + } + + void One_LateUpdate() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Late Update", Time.frameCount); + oneLateUpdate++; + } + + void One_Exit() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Exit", Time.frameCount); + oneExit++; + } + + void One_Finally() + { + Debug.LogFormat("State:{0} Frame:{1}", "One Finally", Time.frameCount); + oneFinally++; + } + } + } +} \ No newline at end of file diff --git a/StateMachine/Assets/MonsterLove/Tests/Runtime/TestMonoBehaviourUpdates.cs.meta b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestMonoBehaviourUpdates.cs.meta new file mode 100644 index 0000000..d3ba7da --- /dev/null +++ b/StateMachine/Assets/MonsterLove/Tests/Runtime/TestMonoBehaviourUpdates.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 87d1cfcf5f33f2441b2b848c6053dbcf +timeCreated: 1567675903 \ No newline at end of file diff --git a/StateMachine/Packages/manifest.json b/StateMachine/Packages/manifest.json new file mode 100644 index 0000000..fabe451 --- /dev/null +++ b/StateMachine/Packages/manifest.json @@ -0,0 +1,49 @@ +{ + "dependencies": { + "com.unity.2d.sprite": "1.0.0", + "com.unity.2d.tilemap": "1.0.0", + "com.unity.ads": "3.6.1", + "com.unity.analytics": "3.3.5", + "com.unity.collab-proxy": "1.2.16", + "com.unity.ide.rider": "1.1.4", + "com.unity.ide.vscode": "1.2.3", + "com.unity.multiplayer-hlapi": "1.0.8", + "com.unity.purchasing": "2.2.1", + "com.unity.test-framework": "1.1.20", + "com.unity.textmeshpro": "2.0.1", + "com.unity.timeline": "1.2.6", + "com.unity.ugui": "1.0.0", + "com.unity.xr.legacyinputhelpers": "2.1.7", + "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", + "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/StateMachine/Packages/packages-lock.json b/StateMachine/Packages/packages-lock.json new file mode 100644 index 0000000..924cfb3 --- /dev/null +++ b/StateMachine/Packages/packages-lock.json @@ -0,0 +1,377 @@ +{ + "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.ads": { + "version": "3.6.1", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "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.2.16", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.ext.nunit": { + "version": "1.0.6", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.ide.rider": { + "version": "1.1.4", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.1" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ide.vscode": { + "version": "1.2.3", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.multiplayer-hlapi": { + "version": "1.0.8", + "depth": 0, + "source": "registry", + "dependencies": { + "nuget.mono-cecil": "0.1.6-preview" + }, + "url": "https://packages.unity.com" + }, + "com.unity.purchasing": { + "version": "2.2.1", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.test-framework": { + "version": "1.1.20", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.6", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.textmeshpro": { + "version": "2.0.1", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.timeline": { + "version": "1.2.6", + "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.modules.imgui": "1.0.0" + } + }, + "com.unity.xr.legacyinputhelpers": { + "version": "2.1.7", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.xr": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "nuget.mono-cecil": { + "version": "0.1.6-preview", + "depth": 1, + "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.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/StateMachine/ProjectSettings/AudioManager.asset b/StateMachine/ProjectSettings/AudioManager.asset new file mode 100644 index 0000000..4f31e74 --- /dev/null +++ b/StateMachine/ProjectSettings/AudioManager.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!11 &1 +AudioManager: + m_ObjectHideFlags: 0 + m_Volume: 1 + Rolloff Scale: 1 + Doppler Factor: 1 + Default Speaker Mode: 2 + m_SampleRate: 0 + m_DSPBufferSize: 1024 + m_VirtualVoiceCount: 512 + m_RealVoiceCount: 32 + m_SpatializerPlugin: + m_AmbisonicDecoderPlugin: + m_DisableAudio: 0 + m_VirtualizeEffects: 1 diff --git a/StateMachine/ProjectSettings/ClusterInputManager.asset b/StateMachine/ProjectSettings/ClusterInputManager.asset new file mode 100644 index 0000000..e7886b2 --- /dev/null +++ b/StateMachine/ProjectSettings/ClusterInputManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!236 &1 +ClusterInputManager: + m_ObjectHideFlags: 0 + m_Inputs: [] diff --git a/StateMachine/ProjectSettings/DynamicsManager.asset b/StateMachine/ProjectSettings/DynamicsManager.asset new file mode 100644 index 0000000..f7ec7c9 --- /dev/null +++ b/StateMachine/ProjectSettings/DynamicsManager.asset @@ -0,0 +1,33 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!55 &1 +PhysicsManager: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Gravity: {x: 0, y: -9.81, z: 0} + m_DefaultMaterial: {fileID: 0} + m_BounceThreshold: 2 + m_SleepThreshold: 0.005 + m_DefaultContactOffset: 0.01 + m_DefaultSolverIterations: 6 + m_DefaultSolverVelocityIterations: 1 + m_QueriesHitBackfaces: 0 + m_QueriesHitTriggers: 1 + m_EnableAdaptiveForce: 0 + m_ClothInterCollisionDistance: 0 + m_ClothInterCollisionStiffness: 0 + m_ContactsGeneration: 1 + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_AutoSimulation: 1 + m_AutoSyncTransforms: 1 + m_ReuseCollisionCallbacks: 0 + m_ClothInterCollisionSettingsToggle: 0 + m_ContactPairsMode: 0 + m_BroadphaseType: 0 + m_WorldBounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 250, y: 250, z: 250} + m_WorldSubdivisions: 8 + m_FrictionType: 0 + m_EnableEnhancedDeterminism: 0 + m_EnableUnifiedHeightmaps: 1 diff --git a/StateMachine/ProjectSettings/EditorBuildSettings.asset b/StateMachine/ProjectSettings/EditorBuildSettings.asset new file mode 100644 index 0000000..fb75e3b --- /dev/null +++ b/StateMachine/ProjectSettings/EditorBuildSettings.asset @@ -0,0 +1,11 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1045 &1 +EditorBuildSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Scenes: + - enabled: 1 + path: Assets/MonsterLove/Samples/StateMachine_Advanced.unity + guid: fa60728e35284674e88aa2ae6df84576 + m_configObjects: {} diff --git a/StateMachine/ProjectSettings/EditorSettings.asset b/StateMachine/ProjectSettings/EditorSettings.asset new file mode 100644 index 0000000..28daa4a --- /dev/null +++ b/StateMachine/ProjectSettings/EditorSettings.asset @@ -0,0 +1,23 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!159 &1 +EditorSettings: + m_ObjectHideFlags: 0 + serializedVersion: 7 + m_ExternalVersionControlSupport: Visible Meta Files + m_SerializationMode: 2 + m_LineEndingsForNewScripts: 1 + m_DefaultBehaviorMode: 0 + m_PrefabRegularEnvironment: {fileID: 0} + m_PrefabUIEnvironment: {fileID: 0} + m_SpritePackerMode: 2 + m_SpritePackerPaddingPower: 1 + m_EtcTextureCompressorBehavior: 0 + m_EtcTextureFastCompressor: 2 + m_EtcTextureNormalCompressor: 2 + m_EtcTextureBestCompressor: 5 + m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp + m_ProjectGenerationRootNamespace: + m_CollabEditorSettings: + inProgressEnabled: 1 + m_EnableTextureStreamingInPlayMode: 1 diff --git a/StateMachine/ProjectSettings/GraphicsSettings.asset b/StateMachine/ProjectSettings/GraphicsSettings.asset new file mode 100644 index 0000000..000234a --- /dev/null +++ b/StateMachine/ProjectSettings/GraphicsSettings.asset @@ -0,0 +1,66 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!30 &1 +GraphicsSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_Deferred: + m_Mode: 1 + m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} + m_DeferredReflections: + m_Mode: 1 + m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} + m_ScreenSpaceShadows: + m_Mode: 1 + m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} + m_LegacyDeferred: + m_Mode: 1 + m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} + m_DepthNormals: + m_Mode: 1 + m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} + m_MotionVectors: + m_Mode: 1 + m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} + m_LightHalo: + m_Mode: 1 + m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} + m_LensFlare: + m_Mode: 1 + m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} + m_AlwaysIncludedShaders: + - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} + m_PreloadedShaders: [] + m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, + type: 0} + m_CustomRenderPipeline: {fileID: 0} + m_TransparencySortMode: 0 + m_TransparencySortAxis: {x: 0, y: 0, z: 1} + m_DefaultRenderingPath: 1 + m_DefaultMobileRenderingPath: 1 + m_TierSettings: [] + m_LightmapStripping: 0 + m_FogStripping: 0 + m_InstancingStripping: 0 + m_LightmapKeepPlain: 1 + m_LightmapKeepDirCombined: 1 + m_LightmapKeepDynamicPlain: 1 + m_LightmapKeepDynamicDirCombined: 1 + m_LightmapKeepShadowMask: 1 + m_LightmapKeepSubtractive: 1 + m_FogKeepLinear: 1 + m_FogKeepExp: 1 + m_FogKeepExp2: 1 + m_AlbedoSwatchInfos: [] + m_LightsUseLinearIntensity: 0 + m_LightsUseColorTemperature: 0 + m_LogWhenShaderIsCompiled: 0 + m_AllowEnlightenSupportForUpgradedProject: 1 diff --git a/StateMachine/ProjectSettings/InputManager.asset b/StateMachine/ProjectSettings/InputManager.asset new file mode 100644 index 0000000..9e606dc --- /dev/null +++ b/StateMachine/ProjectSettings/InputManager.asset @@ -0,0 +1,295 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!13 &1 +InputManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Axes: + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: a + altPositiveButton: d + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: s + altPositiveButton: w + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left ctrl + altNegativeButton: + altPositiveButton: mouse 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left alt + altNegativeButton: + altPositiveButton: mouse 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left cmd + altNegativeButton: + altPositiveButton: mouse 2 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: space + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse X + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse Y + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse ScrollWheel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 2 + joyNum: 0 + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 1 + type: 2 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 0 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 1 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 2 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 3 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: return + altNegativeButton: + altPositiveButton: joystick button 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: enter + altNegativeButton: + altPositiveButton: space + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Cancel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: escape + altNegativeButton: + altPositiveButton: joystick button 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 diff --git a/StateMachine/ProjectSettings/NavMeshAreas.asset b/StateMachine/ProjectSettings/NavMeshAreas.asset new file mode 100644 index 0000000..3b0b7c3 --- /dev/null +++ b/StateMachine/ProjectSettings/NavMeshAreas.asset @@ -0,0 +1,91 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!126 &1 +NavMeshProjectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + areas: + - name: Walkable + cost: 1 + - name: Not Walkable + cost: 1 + - name: Jump + cost: 2 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + m_LastAgentTypeID: -887442657 + m_Settings: + - serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.75 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_SettingNames: + - Humanoid diff --git a/example_project/ProjectSettings/NavMeshLayers.asset b/StateMachine/ProjectSettings/NavMeshLayers.asset similarity index 100% rename from example_project/ProjectSettings/NavMeshLayers.asset rename to StateMachine/ProjectSettings/NavMeshLayers.asset diff --git a/example_project/ProjectSettings/NetworkManager.asset b/StateMachine/ProjectSettings/NetworkManager.asset similarity index 100% rename from example_project/ProjectSettings/NetworkManager.asset rename to StateMachine/ProjectSettings/NetworkManager.asset diff --git a/StateMachine/ProjectSettings/PackageManagerSettings.asset b/StateMachine/ProjectSettings/PackageManagerSettings.asset new file mode 100644 index 0000000..6920e3a --- /dev/null +++ b/StateMachine/ProjectSettings/PackageManagerSettings.asset @@ -0,0 +1,38 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + 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: 13964, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_ScopedRegistriesSettingsExpanded: 1 + oneTimeWarningShown: 0 + m_Registries: + - m_Id: main + m_Name: + m_Url: https://packages.unity.com + m_Scopes: [] + m_IsDefault: 1 + m_UserSelectedRegistryName: + m_UserAddingNewScopedRegistry: 0 + m_RegistryInfoDraft: + m_ErrorMessage: + m_Original: + m_Id: + m_Name: + m_Url: + m_Scopes: [] + m_IsDefault: 0 + m_Modified: 0 + m_Name: + m_Url: + m_Scopes: + - + m_SelectedScopeIndex: 0 diff --git a/StateMachine/ProjectSettings/Physics2DSettings.asset b/StateMachine/ProjectSettings/Physics2DSettings.asset new file mode 100644 index 0000000..417ef45 --- /dev/null +++ b/StateMachine/ProjectSettings/Physics2DSettings.asset @@ -0,0 +1,56 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!19 &1 +Physics2DSettings: + m_ObjectHideFlags: 0 + serializedVersion: 4 + m_Gravity: {x: 0, y: -9.81} + m_DefaultMaterial: {fileID: 0} + m_VelocityIterations: 8 + m_PositionIterations: 3 + m_VelocityThreshold: 1 + m_MaxLinearCorrection: 0.2 + m_MaxAngularCorrection: 8 + m_MaxTranslationSpeed: 100 + m_MaxRotationSpeed: 360 + m_BaumgarteScale: 0.2 + m_BaumgarteTimeOfImpactScale: 0.75 + m_TimeToSleep: 0.5 + m_LinearSleepTolerance: 0.01 + m_AngularSleepTolerance: 2 + m_DefaultContactOffset: 0.01 + m_JobOptions: + serializedVersion: 2 + useMultithreading: 0 + useConsistencySorting: 0 + m_InterpolationPosesPerJob: 100 + m_NewContactsPerJob: 30 + m_CollideContactsPerJob: 100 + m_ClearFlagsPerJob: 200 + m_ClearBodyForcesPerJob: 200 + m_SyncDiscreteFixturesPerJob: 50 + m_SyncContinuousFixturesPerJob: 50 + m_FindNearestContactsPerJob: 100 + m_UpdateTriggerContactsPerJob: 100 + m_IslandSolverCostThreshold: 100 + m_IslandSolverBodyCostScale: 1 + m_IslandSolverContactCostScale: 10 + m_IslandSolverJointCostScale: 10 + m_IslandSolverBodiesPerJob: 50 + m_IslandSolverContactsPerJob: 50 + m_AutoSimulation: 1 + m_QueriesHitTriggers: 1 + m_QueriesStartInColliders: 1 + m_CallbacksOnDisable: 1 + m_ReuseCollisionCallbacks: 0 + m_AutoSyncTransforms: 1 + m_AlwaysShowColliders: 0 + m_ShowColliderSleep: 1 + m_ShowColliderContacts: 0 + m_ShowColliderAABB: 0 + m_ContactArrowScale: 0.2 + m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} + m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} + m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} + m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/StateMachine/ProjectSettings/PresetManager.asset b/StateMachine/ProjectSettings/PresetManager.asset new file mode 100644 index 0000000..636a595 --- /dev/null +++ b/StateMachine/ProjectSettings/PresetManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1386491679 &1 +PresetManager: + m_ObjectHideFlags: 0 + m_DefaultList: [] diff --git a/StateMachine/ProjectSettings/ProjectSettings.asset b/StateMachine/ProjectSettings/ProjectSettings.asset new file mode 100644 index 0000000..8b974df --- /dev/null +++ b/StateMachine/ProjectSettings/ProjectSettings.asset @@ -0,0 +1,658 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!129 &1 +PlayerSettings: + m_ObjectHideFlags: 0 + serializedVersion: 20 + productGUID: cf430c7cc81a764429ccff277c605624 + AndroidProfiler: 0 + AndroidFilterTouchesWhenObscured: 0 + AndroidEnableSustainedPerformanceMode: 0 + defaultScreenOrientation: 4 + targetDevice: 2 + useOnDemandResources: 0 + accelerometerFrequency: 60 + companyName: Made With Monster Love + productName: example_project + defaultCursor: {fileID: 0} + cursorHotspot: {x: 0, y: 0} + m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} + m_ShowUnitySplashScreen: 1 + m_ShowUnitySplashLogo: 1 + m_SplashScreenOverlayOpacity: 1 + m_SplashScreenAnimation: 1 + m_SplashScreenLogoStyle: 1 + m_SplashScreenDrawMode: 0 + m_SplashScreenBackgroundAnimationZoom: 1 + m_SplashScreenLogoAnimationZoom: 1 + m_SplashScreenBackgroundLandscapeAspect: 1 + m_SplashScreenBackgroundPortraitAspect: 1 + m_SplashScreenBackgroundLandscapeUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenBackgroundPortraitUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenLogos: [] + m_VirtualRealitySplashScreen: {fileID: 0} + m_HolographicTrackingLossScreen: {fileID: 0} + defaultScreenWidth: 1024 + defaultScreenHeight: 768 + defaultScreenWidthWeb: 960 + defaultScreenHeightWeb: 600 + m_StereoRenderingPath: 0 + m_ActiveColorSpace: 0 + m_MTRendering: 1 + m_StackTraceTypes: 010000000100000001000000010000000100000001000000 + iosShowActivityIndicatorOnLoading: -1 + androidShowActivityIndicatorOnLoading: -1 + iosUseCustomAppBackgroundBehavior: 0 + iosAllowHTTPDownload: 1 + allowedAutorotateToPortrait: 1 + allowedAutorotateToPortraitUpsideDown: 1 + allowedAutorotateToLandscapeRight: 1 + allowedAutorotateToLandscapeLeft: 1 + useOSAutorotation: 1 + use32BitDisplayBuffer: 1 + preserveFramebufferAlpha: 0 + disableDepthAndStencilBuffers: 0 + androidStartInFullscreen: 1 + androidRenderOutsideSafeArea: 0 + androidUseSwappy: 0 + androidBlitType: 0 + defaultIsNativeResolution: 1 + macRetinaSupport: 1 + runInBackground: 1 + captureSingleScreen: 0 + muteOtherAudioSources: 0 + Prepare IOS For Recording: 0 + Force IOS Speakers When Recording: 0 + deferSystemGesturesMode: 0 + hideHomeButton: 0 + submitAnalytics: 1 + usePlayerLog: 1 + bakeCollisionMeshes: 0 + forceSingleInstance: 0 + useFlipModelSwapchain: 1 + resizableWindow: 0 + useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games + gpuSkinning: 0 + xboxPIXTextureCapture: 0 + xboxEnableAvatar: 0 + xboxEnableKinect: 0 + xboxEnableKinectAutoTracking: 0 + xboxEnableFitness: 0 + visibleInBackground: 0 + allowFullscreenSwitch: 1 + fullscreenMode: 1 + xboxSpeechDB: 0 + xboxEnableHeadOrientation: 0 + xboxEnableGuest: 0 + xboxEnablePIXSampling: 0 + metalFramebufferOnly: 0 + xboxOneResolution: 0 + xboxOneSResolution: 0 + xboxOneXResolution: 3 + xboxOneMonoLoggingLevel: 0 + xboxOneLoggingLevel: 1 + xboxOneDisableEsram: 0 + xboxOneEnableTypeOptimization: 0 + xboxOnePresentImmediateThreshold: 0 + switchQueueCommandMemory: 1048576 + switchQueueControlMemory: 16384 + switchQueueComputeMemory: 262144 + switchNVNShaderPoolsGranularity: 33554432 + switchNVNDefaultPoolsGranularity: 16777216 + switchNVNOtherPoolsGranularity: 16777216 + switchNVNMaxPublicTextureIDCount: 0 + switchNVNMaxPublicSamplerIDCount: 0 + stadiaPresentMode: 0 + stadiaTargetFramerate: 0 + vulkanNumSwapchainBuffers: 3 + vulkanEnableSetSRGBWrite: 0 + vulkanEnableLateAcquireNextImage: 0 + m_SupportedAspectRatios: + 4:3: 1 + 5:4: 1 + 16:10: 1 + 16:9: 1 + Others: 1 + bundleVersion: 1.0 + preloadedAssets: [] + metroInputSource: 0 + wsaTransparentSwapchain: 0 + m_HolographicPauseOnTrackingLoss: 1 + xboxOneDisableKinectGpuReservation: 0 + xboxOneEnable7thCore: 1 + vrSettings: + cardboard: + depthFormat: 0 + enableTransitionView: 0 + daydream: + depthFormat: 0 + useSustainedPerformanceMode: 0 + enableVideoLayer: 0 + useProtectedVideoMemory: 0 + minimumSupportedHeadTracking: 0 + maximumSupportedHeadTracking: 1 + hololens: + depthFormat: 1 + depthBufferSharingEnabled: 0 + lumin: + depthFormat: 0 + frameTiming: 2 + enableGLCache: 0 + glCacheMaxBlobSize: 524288 + glCacheMaxFileSize: 8388608 + oculus: + sharedDepthBuffer: 1 + dashSupport: 1 + lowOverheadMode: 0 + protectedContext: 0 + v2Signing: 1 + enable360StereoCapture: 0 + isWsaHolographicRemotingEnabled: 0 + enableFrameTimingStats: 0 + useHDRDisplay: 0 + D3DHDRBitDepth: 0 + m_ColorGamuts: 00000000 + targetPixelDensity: 30 + resolutionScalingMode: 0 + androidSupportedAspectRatio: 1 + androidMaxAspectRatio: 2.1 + applicationIdentifier: + Android: com.Company.ProductName + Standalone: unity.DefaultCompany.example_project + iPhone: com.Company.ProductName + tvOS: com.Company.ProductName + buildNumber: + iPhone: 0 + AndroidBundleVersionCode: 1 + AndroidMinSdkVersion: 19 + AndroidTargetSdkVersion: 0 + AndroidPreferredInstallLocation: 1 + aotOptions: + stripEngineCode: 1 + iPhoneStrippingLevel: 0 + iPhoneScriptCallOptimization: 0 + ForceInternetPermission: 0 + ForceSDCardPermission: 0 + CreateWallpaper: 0 + APKExpansionFiles: 0 + keepLoadedShadersAlive: 0 + StripUnusedMeshComponents: 0 + VertexChannelCompressionMask: 214 + iPhoneSdkVersion: 988 + iOSTargetOSVersionString: 10.0 + tvOSSdkVersion: 0 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 10.0 + uIPrerenderedIcon: 0 + uIRequiresPersistentWiFi: 0 + uIRequiresFullScreen: 1 + uIStatusBarHidden: 1 + uIExitOnSuspend: 0 + uIStatusBarStyle: 0 + appleTVSplashScreen: {fileID: 0} + appleTVSplashScreen2x: {fileID: 0} + tvOSSmallIconLayers: [] + tvOSSmallIconLayers2x: [] + tvOSLargeIconLayers: [] + tvOSLargeIconLayers2x: [] + tvOSTopShelfImageLayers: [] + tvOSTopShelfImageLayers2x: [] + tvOSTopShelfImageWideLayers: [] + tvOSTopShelfImageWideLayers2x: [] + iOSLaunchScreenType: 0 + iOSLaunchScreenPortrait: {fileID: 0} + iOSLaunchScreenLandscape: {fileID: 0} + iOSLaunchScreenBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreenFillPct: 1 + iOSLaunchScreenSize: 100 + iOSLaunchScreenCustomXibPath: + iOSLaunchScreeniPadType: 0 + iOSLaunchScreeniPadImage: {fileID: 0} + iOSLaunchScreeniPadBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreeniPadFillPct: 100 + iOSLaunchScreeniPadSize: 100 + iOSLaunchScreeniPadCustomXibPath: + iOSUseLaunchScreenStoryboard: 0 + iOSLaunchScreenCustomStoryboardPath: + iOSDeviceRequirements: [] + iOSURLSchemes: [] + iOSBackgroundModes: 0 + iOSMetalForceHardShadows: 0 + metalEditorSupport: 1 + metalAPIValidation: 1 + iOSRenderExtraFrameOnPause: 1 + iosCopyPluginsCodeInsteadOfSymlink: 0 + appleDeveloperTeamID: + iOSManualSigningProvisioningProfileID: + tvOSManualSigningProvisioningProfileID: + iOSManualSigningProvisioningProfileType: 0 + tvOSManualSigningProvisioningProfileType: 0 + appleEnableAutomaticSigning: 0 + iOSRequireARKit: 0 + iOSAutomaticallyDetectAndAddCapabilities: 1 + appleEnableProMotion: 0 + clonedFromGUID: 00000000000000000000000000000000 + templatePackageId: + templateDefaultScene: + AndroidTargetArchitectures: 5 + AndroidSplashScreenScale: 0 + androidSplashScreen: {fileID: 0} + AndroidKeystoreName: '{inproject}: ' + AndroidKeyaliasName: + AndroidBuildApkPerCpuArchitecture: 0 + AndroidTVCompatibility: 1 + AndroidIsGame: 1 + AndroidEnableTango: 0 + androidEnableBanner: 1 + androidUseLowAccuracyLocation: 0 + androidUseCustomKeystore: 0 + m_AndroidBanners: + - width: 320 + height: 180 + banner: {fileID: 0} + androidGamepadSupportLevel: 0 + AndroidValidateAppBundleSize: 1 + AndroidAppBundleSizeToValidate: 150 + m_BuildTargetIcons: [] + m_BuildTargetPlatformIcons: [] + m_BuildTargetBatching: [] + m_BuildTargetGraphicsJobs: + - m_BuildTarget: MacStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: Switch + m_GraphicsJobs: 0 + - m_BuildTarget: MetroSupport + m_GraphicsJobs: 0 + - m_BuildTarget: AppleTVSupport + m_GraphicsJobs: 0 + - m_BuildTarget: BJMSupport + m_GraphicsJobs: 0 + - m_BuildTarget: LinuxStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: PS4Player + m_GraphicsJobs: 0 + - m_BuildTarget: iOSSupport + m_GraphicsJobs: 0 + - m_BuildTarget: WindowsStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobs: 0 + - m_BuildTarget: LuminSupport + m_GraphicsJobs: 0 + - m_BuildTarget: CloudRendering + m_GraphicsJobs: 0 + - m_BuildTarget: AndroidPlayer + m_GraphicsJobs: 0 + - m_BuildTarget: WebGLSupport + m_GraphicsJobs: 0 + m_BuildTargetGraphicsJobMode: + - m_BuildTarget: PS4Player + m_GraphicsJobMode: 0 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobMode: 0 + m_BuildTargetGraphicsAPIs: + - m_BuildTarget: AndroidPlayer + m_APIs: 08000000 + m_Automatic: 0 + m_BuildTargetVRSettings: [] + openGLRequireES31: 0 + openGLRequireES31AEP: 0 + openGLRequireES32: 0 + m_TemplateCustomTags: {} + mobileMTRendering: + iPhone: 1 + tvOS: 1 + m_BuildTargetGroupLightmapEncodingQuality: + - m_BuildTarget: Standalone + m_EncodingQuality: 1 + - m_BuildTarget: XboxOne + m_EncodingQuality: 1 + - m_BuildTarget: PS4 + m_EncodingQuality: 1 + m_BuildTargetGroupLightmapSettings: [] + playModeTestRunnerEnabled: 0 + runPlayModeTestAsEditModeTest: 0 + actionOnDotNetUnhandledException: 1 + enableInternalProfiler: 0 + logObjCUncaughtExceptions: 1 + enableCrashReportAPI: 0 + cameraUsageDescription: + locationUsageDescription: + microphoneUsageDescription: + switchNetLibKey: + switchSocketMemoryPoolSize: 6144 + switchSocketAllocatorPoolSize: 128 + switchSocketConcurrencyLimit: 14 + switchScreenResolutionBehavior: 2 + switchUseCPUProfiler: 0 + switchApplicationID: 0x01004b9000490000 + switchNSODependencies: + switchTitleNames_0: + switchTitleNames_1: + switchTitleNames_2: + switchTitleNames_3: + switchTitleNames_4: + switchTitleNames_5: + switchTitleNames_6: + switchTitleNames_7: + switchTitleNames_8: + switchTitleNames_9: + switchTitleNames_10: + switchTitleNames_11: + switchTitleNames_12: + switchTitleNames_13: + switchTitleNames_14: + switchPublisherNames_0: + switchPublisherNames_1: + switchPublisherNames_2: + switchPublisherNames_3: + switchPublisherNames_4: + switchPublisherNames_5: + switchPublisherNames_6: + switchPublisherNames_7: + switchPublisherNames_8: + switchPublisherNames_9: + switchPublisherNames_10: + switchPublisherNames_11: + switchPublisherNames_12: + switchPublisherNames_13: + switchPublisherNames_14: + switchIcons_0: {fileID: 0} + switchIcons_1: {fileID: 0} + switchIcons_2: {fileID: 0} + switchIcons_3: {fileID: 0} + switchIcons_4: {fileID: 0} + switchIcons_5: {fileID: 0} + switchIcons_6: {fileID: 0} + switchIcons_7: {fileID: 0} + switchIcons_8: {fileID: 0} + switchIcons_9: {fileID: 0} + switchIcons_10: {fileID: 0} + switchIcons_11: {fileID: 0} + switchIcons_12: {fileID: 0} + switchIcons_13: {fileID: 0} + switchIcons_14: {fileID: 0} + switchSmallIcons_0: {fileID: 0} + switchSmallIcons_1: {fileID: 0} + switchSmallIcons_2: {fileID: 0} + switchSmallIcons_3: {fileID: 0} + switchSmallIcons_4: {fileID: 0} + switchSmallIcons_5: {fileID: 0} + switchSmallIcons_6: {fileID: 0} + switchSmallIcons_7: {fileID: 0} + switchSmallIcons_8: {fileID: 0} + switchSmallIcons_9: {fileID: 0} + switchSmallIcons_10: {fileID: 0} + switchSmallIcons_11: {fileID: 0} + switchSmallIcons_12: {fileID: 0} + switchSmallIcons_13: {fileID: 0} + switchSmallIcons_14: {fileID: 0} + switchManualHTML: + switchAccessibleURLs: + switchLegalInformation: + switchMainThreadStackSize: 1048576 + switchPresenceGroupId: + switchLogoHandling: 0 + switchReleaseVersion: 0 + switchDisplayVersion: 1.0.0 + switchStartupUserAccount: 0 + switchTouchScreenUsage: 0 + switchSupportedLanguagesMask: 0 + switchLogoType: 0 + switchApplicationErrorCodeCategory: + switchUserAccountSaveDataSize: 0 + switchUserAccountSaveDataJournalSize: 0 + switchApplicationAttribute: 0 + switchCardSpecSize: -1 + switchCardSpecClock: -1 + switchRatingsMask: 0 + switchRatingsInt_0: 0 + switchRatingsInt_1: 0 + switchRatingsInt_2: 0 + switchRatingsInt_3: 0 + switchRatingsInt_4: 0 + switchRatingsInt_5: 0 + switchRatingsInt_6: 0 + switchRatingsInt_7: 0 + switchRatingsInt_8: 0 + switchRatingsInt_9: 0 + switchRatingsInt_10: 0 + switchRatingsInt_11: 0 + switchRatingsInt_12: 0 + switchLocalCommunicationIds_0: + switchLocalCommunicationIds_1: + switchLocalCommunicationIds_2: + switchLocalCommunicationIds_3: + switchLocalCommunicationIds_4: + switchLocalCommunicationIds_5: + switchLocalCommunicationIds_6: + switchLocalCommunicationIds_7: + switchParentalControl: 0 + switchAllowsScreenshot: 1 + switchAllowsVideoCapturing: 1 + switchAllowsRuntimeAddOnContentInstall: 0 + switchDataLossConfirmation: 0 + switchUserAccountLockEnabled: 0 + switchSystemResourceMemory: 16777216 + switchSupportedNpadStyles: 6 + switchNativeFsCacheSize: 32 + switchIsHoldTypeHorizontal: 0 + switchSupportedNpadCount: 8 + switchSocketConfigEnabled: 0 + switchTcpInitialSendBufferSize: 32 + switchTcpInitialReceiveBufferSize: 64 + switchTcpAutoSendBufferSizeMax: 256 + switchTcpAutoReceiveBufferSizeMax: 256 + switchUdpSendBufferSize: 9 + switchUdpReceiveBufferSize: 42 + switchSocketBufferEfficiency: 4 + switchSocketInitializeEnabled: 1 + switchNetworkInterfaceManagerInitializeEnabled: 1 + switchPlayerConnectionEnabled: 1 + ps4NPAgeRating: 12 + ps4NPTitleSecret: + ps4NPTrophyPackPath: + ps4ParentalLevel: 1 + ps4ContentID: ED1633-NPXX51362_00-0000000000000000 + ps4Category: 0 + ps4MasterVersion: 01.00 + ps4AppVersion: 01.00 + ps4AppType: 0 + ps4ParamSfxPath: + ps4VideoOutPixelFormat: 0 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 60 + ps4PronunciationXMLPath: + ps4PronunciationSIGPath: + ps4BackgroundImagePath: + ps4StartupImagePath: + ps4StartupImagesFolder: + ps4IconImagesFolder: + ps4SaveDataImagePath: + ps4SdkOverride: + ps4BGMPath: + ps4ShareFilePath: + ps4ShareOverlayImagePath: + ps4PrivacyGuardImagePath: + ps4ExtraSceSysFile: + ps4NPtitleDatPath: + ps4RemotePlayKeyAssignment: -1 + ps4RemotePlayKeyMappingDir: + ps4PlayTogetherPlayerCount: 0 + ps4EnterButtonAssignment: 1 + ps4ApplicationParam1: 0 + ps4ApplicationParam2: 0 + ps4ApplicationParam3: 0 + ps4ApplicationParam4: 0 + ps4DownloadDataSize: 0 + ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 + playerPrefsMaxSize: 32768 + ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ + ps4pnSessions: 1 + ps4pnPresence: 1 + ps4pnFriends: 1 + ps4pnGameCustomData: 1 + playerPrefsSupport: 0 + enableApplicationExit: 0 + resetTempFolder: 1 + restrictedAudioUsageRights: 0 + ps4UseResolutionFallback: 0 + ps4ReprojectionSupport: 0 + ps4UseAudio3dBackend: 0 + ps4UseLowGarlicFragmentationMode: 1 + ps4SocialScreenEnabled: 0 + ps4ScriptOptimizationLevel: 2 + ps4Audio3dVirtualSpeakerCount: 14 + ps4attribCpuUsage: 0 + ps4PatchPkgPath: + ps4PatchLatestPkgPath: + ps4PatchChangeinfoPath: + ps4PatchDayOne: 0 + ps4attribUserManagement: 0 + ps4attribMoveSupport: 0 + ps4attrib3DSupport: 0 + ps4attribShareSupport: 0 + ps4attribExclusiveVR: 0 + ps4disableAutoHideSplash: 0 + ps4videoRecordingFeaturesUsed: 0 + ps4contentSearchFeaturesUsed: 0 + ps4CompatibilityPS5: 0 + ps4GPU800MHz: 1 + ps4attribEyeToEyeDistanceSettingVR: 0 + ps4IncludedModules: [] + ps4attribVROutputEnabled: 0 + monoEnv: + splashScreenBackgroundSourceLandscape: {fileID: 0} + splashScreenBackgroundSourcePortrait: {fileID: 0} + blurSplashScreenBackground: 1 + spritePackerPolicy: + webGLMemorySize: 256 + webGLExceptionSupport: 0 + webGLNameFilesAsHashes: 0 + webGLDataCaching: 0 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: + webGLModulesDirectory: + webGLTemplate: APPLICATION:Default + webGLAnalyzeBuildSize: 0 + webGLUseEmbeddedResources: 0 + webGLCompressionFormat: 1 + webGLLinkerTarget: 1 + webGLThreadsSupport: 0 + webGLWasmStreaming: 0 + scriptingDefineSymbols: {} + platformArchitecture: + iPhone: 2 + scriptingBackend: + Standalone: 1 + WP8: 2 + WebGL: 1 + Windows Store Apps: 2 + iPhone: 0 + il2cppCompilerConfiguration: {} + managedStrippingLevel: {} + incrementalIl2cppBuild: {} + allowUnsafeCode: 0 + additionalIl2CppArgs: + scriptingRuntimeVersion: 1 + gcIncremental: 0 + assemblyVersionValidation: 1 + gcWBarrierValidation: 0 + apiCompatibilityLevelPerPlatform: {} + m_RenderingPath: 1 + m_MobileRenderingPath: 1 + metroPackageName: example_project + metroPackageVersion: + metroCertificatePath: + metroCertificatePassword: + metroCertificateSubject: + metroCertificateIssuer: + metroCertificateNotAfter: 0000000000000000 + metroApplicationDescription: example_project + wsaImages: {} + metroTileShortName: + metroTileShowName: 0 + metroMediumTileShowName: 0 + metroLargeTileShowName: 0 + metroWideTileShowName: 0 + metroSupportStreamingInstall: 0 + metroLastRequiredScene: 0 + metroDefaultTileSize: 1 + metroTileForegroundText: 1 + metroTileBackgroundColor: {r: 0, g: 0, b: 0, a: 1} + metroSplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1} + metroSplashScreenUseBackgroundColor: 0 + platformCapabilities: {} + metroTargetDeviceFamilies: {} + metroFTAName: + metroFTAFileTypes: [] + metroProtocolName: + XboxOneProductId: + XboxOneUpdateKey: + XboxOneSandboxId: + XboxOneContentId: + XboxOneTitleId: + XboxOneSCId: + XboxOneGameOsOverridePath: + XboxOnePackagingOverridePath: + XboxOneAppManifestOverridePath: + XboxOneVersion: 1.0.0.0 + XboxOnePackageEncryption: 0 + XboxOnePackageUpdateGranularity: 2 + XboxOneDescription: + XboxOneLanguage: + - enus + XboxOneCapability: [] + XboxOneGameRating: {} + XboxOneIsContentPackage: 0 + XboxOneEnhancedXboxCompatibilityMode: 0 + XboxOneEnableGPUVariability: 0 + XboxOneSockets: {} + XboxOneSplashScreen: {fileID: 0} + XboxOneAllowedProductIds: [] + XboxOnePersistentLocalStorageSize: 0 + XboxOneXTitleMemory: 8 + XboxOneOverrideIdentityName: + XboxOneOverrideIdentityPublisher: + vrEditorSettings: + daydream: + daydreamIconForeground: {fileID: 0} + daydreamIconBackground: {fileID: 0} + cloudServicesEnabled: {} + luminIcon: + m_Name: + m_ModelFolderPath: + m_PortalFolderPath: + luminCert: + m_CertPath: + m_SignPackage: 1 + luminIsChannelApp: 0 + luminVersion: + m_VersionCode: 1 + m_VersionName: + apiCompatibilityLevel: 6 + cloudProjectId: + framebufferDepthMemorylessMode: 0 + projectName: + organizationId: + cloudEnabled: 0 + enableNativePlatformBackendsForNewInputSystem: 0 + disableOldInputManagerSupport: 0 + legacyClampBlendShapeWeights: 1 diff --git a/StateMachine/ProjectSettings/ProjectVersion.txt b/StateMachine/ProjectSettings/ProjectVersion.txt new file mode 100644 index 0000000..acbe3fd --- /dev/null +++ b/StateMachine/ProjectSettings/ProjectVersion.txt @@ -0,0 +1,2 @@ +m_EditorVersion: 2019.4.19f1 +m_EditorVersionWithRevision: 2019.4.19f1 (ca5b14067cec) diff --git a/StateMachine/ProjectSettings/QualitySettings.asset b/StateMachine/ProjectSettings/QualitySettings.asset new file mode 100644 index 0000000..67e5ab8 --- /dev/null +++ b/StateMachine/ProjectSettings/QualitySettings.asset @@ -0,0 +1,219 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!47 &1 +QualitySettings: + m_ObjectHideFlags: 0 + serializedVersion: 5 + m_CurrentQuality: 3 + m_QualitySettings: + - serializedVersion: 2 + name: Fastest + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 15 + shadowNearPlaneOffset: 2 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 1 + textureQuality: 1 + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + 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 + name: Fast + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 2 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + 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 + name: Simple + pixelLightCount: 1 + shadows: 1 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 2 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 0 + 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 + name: Good + pixelLightCount: 2 + shadows: 2 + shadowResolution: 1 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 40 + shadowNearPlaneOffset: 2 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + 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 + name: Beautiful + pixelLightCount: 3 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 70 + shadowNearPlaneOffset: 2 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 4 + textureQuality: 0 + anisotropicTextures: 2 + antiAliasing: 2 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + 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 + name: Fantastic + pixelLightCount: 4 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 4 + shadowDistance: 150 + shadowNearPlaneOffset: 2 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 4 + textureQuality: 0 + anisotropicTextures: 2 + antiAliasing: 2 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + 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: {} diff --git a/StateMachine/ProjectSettings/TagManager.asset b/StateMachine/ProjectSettings/TagManager.asset new file mode 100644 index 0000000..1c92a78 --- /dev/null +++ b/StateMachine/ProjectSettings/TagManager.asset @@ -0,0 +1,43 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!78 &1 +TagManager: + serializedVersion: 2 + tags: [] + layers: + - Default + - TransparentFX + - Ignore Raycast + - + - Water + - UI + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + m_SortingLayers: + - name: Default + uniqueID: 0 + locked: 0 diff --git a/StateMachine/ProjectSettings/TimeManager.asset b/StateMachine/ProjectSettings/TimeManager.asset new file mode 100644 index 0000000..558a017 --- /dev/null +++ b/StateMachine/ProjectSettings/TimeManager.asset @@ -0,0 +1,9 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!5 &1 +TimeManager: + m_ObjectHideFlags: 0 + Fixed Timestep: 0.02 + Maximum Allowed Timestep: 0.33333334 + m_TimeScale: 1 + Maximum Particle Timestep: 0.03 diff --git a/StateMachine/ProjectSettings/UnityConnectSettings.asset b/StateMachine/ProjectSettings/UnityConnectSettings.asset new file mode 100644 index 0000000..fa0b146 --- /dev/null +++ b/StateMachine/ProjectSettings/UnityConnectSettings.asset @@ -0,0 +1,34 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!310 &1 +UnityConnectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 1 + m_Enabled: 0 + m_TestMode: 0 + 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 + m_Enabled: 0 + m_LogBufferSize: 10 + m_CaptureEditorExceptions: 1 + UnityPurchasingSettings: + m_Enabled: 0 + m_TestMode: 0 + UnityAnalyticsSettings: + m_Enabled: 0 + m_TestMode: 0 + m_InitializeOnStartup: 1 + UnityAdsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_IosGameId: + m_AndroidGameId: + m_GameIds: {} + m_GameId: + PerformanceReportingSettings: + m_Enabled: 0 diff --git a/StateMachine/ProjectSettings/VFXManager.asset b/StateMachine/ProjectSettings/VFXManager.asset new file mode 100644 index 0000000..6e0eaca --- /dev/null +++ b/StateMachine/ProjectSettings/VFXManager.asset @@ -0,0 +1,11 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!937362698 &1 +VFXManager: + m_ObjectHideFlags: 0 + m_IndirectShader: {fileID: 0} + m_CopyBufferShader: {fileID: 0} + m_SortShader: {fileID: 0} + m_RenderPipeSettingsPath: + m_FixedTimeStep: 0.016666668 + m_MaxDeltaTime: 0.05 diff --git a/StateMachine/ProjectSettings/XRSettings.asset b/StateMachine/ProjectSettings/XRSettings.asset new file mode 100644 index 0000000..482590c --- /dev/null +++ b/StateMachine/ProjectSettings/XRSettings.asset @@ -0,0 +1,10 @@ +{ + "m_SettingKeys": [ + "VR Device Disabled", + "VR Device User Alert" + ], + "m_SettingValues": [ + "False", + "False" + ] +} \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index e950cc0..bbd1ae3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,24 @@ +v4.0 April 2021 + *StateMachine now accepts a Driver class, a powerful convention for data driven state events that provides explicit control of the State Machine lifecycle. + *Added `LastState` property + *Added `NextState` property + *Added `reenter` flag to allow transitions back into the same state + *Fixed AOT imcompatibility preventing release of v4.0 + *Added new example showing Driver implementation + *Modernised unit tests for Unity Test Runner + *Components deriving from a super class will now also search super classes for state methods + *Upgraded project to Unity 2019.4.19 + + ### Upgrade Notes: + The layout of the library has changed. To avoid issues delete the existing `MonsterLove` folder containing `StateMachine.cs` and related files, before reimporting the Unity package. The API however remains backwards compatible with prior versions. This means your client code does not need to be upgraded. + +v4.0-rc1 August 2019 + *Created StateMachine Driver concept + *Added `LastState` property to StateMachine class + *Modernised unit tests for Unity Test Runner + *Compenents deriving from a super class will now also search super classes for state methods + *Upgraded project to Unity 2018.3.7 + v3.1 March 2016 *Fixing edge cases where non coroutine Exit fucntions wouldn't be called if StateTrasition.Overwrite used diff --git a/example_project/Assets/Editor.meta b/example_project/Assets/Editor.meta deleted file mode 100644 index 3d59f78..0000000 --- a/example_project/Assets/Editor.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 781c6af83d4652b41aea86f6c439eaa0 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/Editor/MonsterLove.meta b/example_project/Assets/Editor/MonsterLove.meta deleted file mode 100644 index 856f7bc..0000000 --- a/example_project/Assets/Editor/MonsterLove.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: be75c3f1c5147984baab7eb7a961b39a -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/Editor/MonsterLove/Tests.meta b/example_project/Assets/Editor/MonsterLove/Tests.meta deleted file mode 100644 index a74def9..0000000 --- a/example_project/Assets/Editor/MonsterLove/Tests.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: bfa73f678735457448327da4b52cfd77 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestMethodNameWarnings.cs b/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestMethodNameWarnings.cs deleted file mode 100644 index d398be1..0000000 --- a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestMethodNameWarnings.cs +++ /dev/null @@ -1,35 +0,0 @@ -using NUnit.Framework; -using UnityEngine; -using UnityEditor; -using System.Collections; - -[TestFixture] -[Category("State Machine Tests")] -internal class TestMethodNameWarnings -{ - private GameObject go; - private ClassWithHiddenMethods behaviour; - - [SetUp] - public void Init() - { - go = new GameObject("ClassWithHiddenNames"); - behaviour = go.AddComponent(); - } - - [TearDown] - public void Kill() - { - Object.DestroyImmediate(go); - } - - [Test] - public void TestMisspelledFoundAndNoHiddenMehtodsFound() - { - //This is bad unit test in that it will always pass, but I'm can't see anyway to assert for warnings instead of exceptions - //Have a look in the console to make sure expected warnings are thrown or not thrown. - behaviour.TestInit(); - } -} - - diff --git a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestMethodNameWarnings.cs.meta b/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestMethodNameWarnings.cs.meta deleted file mode 100644 index 7610d51..0000000 --- a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestMethodNameWarnings.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4e2adcecad6b3fd4dafc220e82332a9f -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestStateEngineInitialization.cs b/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestStateEngineInitialization.cs deleted file mode 100644 index 1d92d5f..0000000 --- a/example_project/Assets/Editor/MonsterLove/Tests/StateMachine/TestStateEngineInitialization.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using MonsterLove.StateMachine; -using NUnit.Framework; -using UnityEngine; -using UnityEditor; -using System.Collections; -using UnityTest; -using Object = UnityEngine.Object; - -[TestFixture] -[Category("State Machine Tests")] -internal class TestStateEngineInitialization -{ - - public enum TestStates - { - StateInit, - StatePlay, - StateEnd, - } - - public enum TestNoDefines - { - } - - private GameObject go; - private MonoBehaviour behaviour; - private StateMachineRunner engine; - - [SetUp] - public void Init() - { - go = new GameObject("stateTest"); - behaviour = go.AddComponent(); - engine = go.AddComponent(); - - } - - [TearDown] - public void Kill() - { - Object.DestroyImmediate(go); - } - - [Test] - //[ExpectedException] - public void TestInitializedTwice() - { - //Should this throw an error? I'm not sure? - var fsm = engine.Initialize(behaviour); - fsm = engine.Initialize(behaviour); - } - - [Test] - [ExpectedException] - public void TestStatesDefined() - { - var fsm = engine.Initialize(behaviour); - } -} - - diff --git a/example_project/Assets/MonsterLove/StateMachine.meta b/example_project/Assets/MonsterLove/StateMachine.meta deleted file mode 100644 index 48f77d5..0000000 --- a/example_project/Assets/MonsterLove/StateMachine.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 2adeccb6bb7676a40b2ac291f96ed397 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/MonsterLove/StateMachine/StateMachine.cs b/example_project/Assets/MonsterLove/StateMachine/StateMachine.cs deleted file mode 100644 index 832cd77..0000000 --- a/example_project/Assets/MonsterLove/StateMachine/StateMachine.cs +++ /dev/null @@ -1,407 +0,0 @@ -/* - * Copyright (c) 2016 Made With Monster Love (Pty) Ltd - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; -using System.Runtime.CompilerServices; -using UnityEngine; -using Object = System.Object; - -namespace MonsterLove.StateMachine -{ - public enum StateTransition - { - Safe, - Overwrite, - } - - public interface IStateMachine - { - MonoBehaviour Component { get; } - StateMapping CurrentStateMap { get; } - bool IsInTransition { get; } - } - - public class StateMachine : IStateMachine where T : struct, IConvertible, IComparable - { - public event Action Changed; - - private StateMachineRunner engine; - private MonoBehaviour component; - - private StateMapping lastState; - private StateMapping currentState; - private StateMapping destinationState; - - private Dictionary stateLookup; - - private readonly string[] ignoredNames = new[] { "add", "remove", "get", "set" }; - - private bool isInTransition = false; - private IEnumerator currentTransition; - private IEnumerator exitRoutine; - private IEnumerator enterRoutine; - private IEnumerator queuedChange; - - public StateMachine(StateMachineRunner engine, MonoBehaviour component) - { - this.engine = engine; - this.component = component; - - //Define States - var values = Enum.GetValues(typeof(T)); - if (values.Length < 1) { throw new ArgumentException("Enum provided to Initialize must have at least 1 visible definition"); } - - stateLookup = new Dictionary(); - for (int i = 0; i < values.Length; i++) - { - var mapping = new StateMapping((Enum) values.GetValue(i)); - stateLookup.Add(mapping.state, mapping); - } - - //Reflect methods - var methods = component.GetType().GetMethods(BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public | - BindingFlags.NonPublic); - - //Bind methods to states - var separator = "_".ToCharArray(); - for (int i = 0; i < methods.Length; i++) - { - if (methods[i].GetCustomAttributes(typeof(CompilerGeneratedAttribute), true).Length != 0) - { - continue; - } - - var names = methods[i].Name.Split(separator); - - //Ignore functions without an underscore - if (names.Length <= 1) - { - continue; - } - - Enum key; - try - { - key = (Enum) Enum.Parse(typeof(T), names[0]); - } - catch (ArgumentException) - { - //Not an method as listed in the state enum - continue; - } - - var targetState = stateLookup[key]; - - switch (names[1]) - { - case "Enter": - if (methods[i].ReturnType == typeof(IEnumerator)) - { - targetState.hasEnterRoutine = true; - targetState.EnterRoutine = CreateDelegate>(methods[i], component); - } - else - { - targetState.hasEnterRoutine = false; - targetState.EnterCall = CreateDelegate(methods[i], component); - } - break; - case "Exit": - if (methods[i].ReturnType == typeof(IEnumerator)) - { - targetState.hasExitRoutine = true; - targetState.ExitRoutine = CreateDelegate>(methods[i], component); - } - else - { - targetState.hasExitRoutine = false; - targetState.ExitCall = CreateDelegate(methods[i], component); - } - break; - case "Finally": - targetState.Finally = CreateDelegate(methods[i], component); - break; - case "Update": - targetState.Update = CreateDelegate(methods[i], component); - break; - case "LateUpdate": - targetState.LateUpdate = CreateDelegate(methods[i], component); - break; - case "FixedUpdate": - targetState.FixedUpdate = CreateDelegate(methods[i], component); - break; - case "OnCollisionEnter": - targetState.OnCollisionEnter = CreateDelegate>(methods[i], component); - break; - } - } - - //Create nil state mapping - currentState = new StateMapping(null); - } - - private V CreateDelegate(MethodInfo method, Object target) where V : class - { - var ret = (Delegate.CreateDelegate(typeof(V), target, method) as V); - - if (ret == null) - { - throw new ArgumentException("Unabled to create delegate for method called " + method.Name); - } - return ret; - - } - - public void ChangeState(T newState) - { - ChangeState(newState, StateTransition.Safe); - } - - public void ChangeState(T newState, StateTransition transition) - { - if (stateLookup == null) - { - throw new Exception("States have not been configured, please call initialized before trying to set state"); - } - - if (!stateLookup.ContainsKey(newState)) - { - throw new Exception("No state with the name " + newState.ToString() + " can be found. Please make sure you are called the correct type the statemachine was initialized with"); - } - - var nextState = stateLookup[newState]; - - if (currentState == nextState) return; - - //Cancel any queued changes. - if (queuedChange != null) - { - engine.StopCoroutine(queuedChange); - queuedChange = null; - } - - switch (transition) - { - //case StateMachineTransition.Blend: - //Do nothing - allows the state transitions to overlap each other. This is a dumb idea, as previous state might trigger new changes. - //A better way would be to start the two couroutines at the same time. IE don't wait for exit before starting start. - //How does this work in terms of overwrite? - //Is there a way to make this safe, I don't think so? - //break; - case StateTransition.Safe: - if (isInTransition) - { - if (exitRoutine != null) //We are already exiting current state on our way to our previous target state - { - //Overwrite with our new target - destinationState = nextState; - return; - } - - if (enterRoutine != null) //We are already entering our previous target state. Need to wait for that to finish and call the exit routine. - { - //Damn, I need to test this hard - queuedChange = WaitForPreviousTransition(nextState); - engine.StartCoroutine(queuedChange); - return; - } - } - break; - case StateTransition.Overwrite: - if (currentTransition != null) - { - engine.StopCoroutine(currentTransition); - } - if (exitRoutine != null) - { - engine.StopCoroutine(exitRoutine); - } - if (enterRoutine != null) - { - engine.StopCoroutine(enterRoutine); - } - - //Note: if we are currently in an EnterRoutine and Exit is also a routine, this will be skipped in ChangeToNewStateRoutine() - break; - } - - - if ((currentState != null && currentState.hasExitRoutine) || nextState.hasEnterRoutine) - { - isInTransition = true; - currentTransition = ChangeToNewStateRoutine(nextState, transition); - engine.StartCoroutine(currentTransition); - } - else //Same frame transition, no coroutines are present - { - if (currentState != null) - { - currentState.ExitCall(); - currentState.Finally(); - } - - lastState = currentState; - currentState = nextState; - if (currentState != null) - { - currentState.EnterCall(); - if (Changed != null) - { - Changed((T) currentState.state); - } - } - isInTransition = false; - } - } - - private IEnumerator ChangeToNewStateRoutine(StateMapping newState, StateTransition transition) - { - destinationState = newState; //Chache this so that we can overwrite it and hijack a transition - - if (currentState != null) - { - if (currentState.hasExitRoutine) - { - exitRoutine = currentState.ExitRoutine(); - - if (exitRoutine != null && transition != StateTransition.Overwrite) //Don't wait for exit if we are overwriting - { - yield return engine.StartCoroutine(exitRoutine); - } - - exitRoutine = null; - } - else - { - currentState.ExitCall(); - } - - currentState.Finally(); - } - - lastState = currentState; - currentState = destinationState; - - if (currentState != null) - { - if (currentState.hasEnterRoutine) - { - enterRoutine = currentState.EnterRoutine(); - - if (enterRoutine != null) - { - yield return engine.StartCoroutine(enterRoutine); - } - - enterRoutine = null; - } - else - { - currentState.EnterCall(); - } - - //Broadcast change only after enter transition has begun. - if (Changed != null) - { - Changed((T) currentState.state); - } - } - - isInTransition = false; - } - - IEnumerator WaitForPreviousTransition(StateMapping nextState) - { - while (isInTransition) - { - yield return null; - } - - ChangeState((T) nextState.state); - } - - public T LastState - { - get - { - if (lastState == null) return default(T); - - return (T) lastState.state; - } - } - - public T State - { - get { return (T) currentState.state; } - } - - public bool IsInTransition - { - get { return isInTransition; } - } - - public StateMapping CurrentStateMap - { - get { return currentState; } - } - - public MonoBehaviour Component - { - get { return component; } - } - - //Static Methods - - /// - /// Inspects a MonoBehaviour for state methods as definied by the supplied Enum, and returns a stateMachine instance used to trasition states. - /// - /// The component with defined state methods - /// A valid stateMachine instance to manage MonoBehaviour state transitions - public static StateMachine Initialize(MonoBehaviour component) - { - var engine = component.GetComponent(); - if (engine == null) engine = component.gameObject.AddComponent(); - - return engine.Initialize(component); - } - - /// - /// Inspects a MonoBehaviour for state methods as definied by the supplied Enum, and returns a stateMachine instance used to trasition states. - /// - /// The component with defined state methods - /// The default starting state - /// A valid stateMachine instance to manage MonoBehaviour state transitions - public static StateMachine Initialize(MonoBehaviour component, T startState) - { - var engine = component.GetComponent(); - if (engine == null) engine = component.gameObject.AddComponent(); - - return engine.Initialize(component, startState); - } - - } - -} diff --git a/example_project/Assets/Scripts.meta b/example_project/Assets/Scripts.meta deleted file mode 100644 index 42ae812..0000000 --- a/example_project/Assets/Scripts.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 20119a9e8beefc643818bbaa53a2f7db diff --git a/example_project/Assets/StateMachineExample.unity b/example_project/Assets/StateMachineExample.unity deleted file mode 100644 index a857fae..0000000 Binary files a/example_project/Assets/StateMachineExample.unity and /dev/null differ diff --git a/example_project/Assets/TestCases.meta b/example_project/Assets/TestCases.meta deleted file mode 100644 index 515dd4c..0000000 --- a/example_project/Assets/TestCases.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 5ab81c3d82b707545a9a4d559d265920 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/TestCases/ClassChangeDuringLongEnter.cs b/example_project/Assets/TestCases/ClassChangeDuringLongEnter.cs deleted file mode 100644 index ec00c28..0000000 --- a/example_project/Assets/TestCases/ClassChangeDuringLongEnter.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using UnityEngine; -using System.Collections; -using MonsterLove.StateMachine; - -/// TEST DESCRIPTION -/// -/// Make sure that the exit function only happens after the enter funciton is completed, else it throws an error. The test passes when a period of time -/// has elapsed without throwing an error. -/// -/// Testing the correctness of this method of updating is done in ClassChangeDuringMonoUpdate -public class ClassChangeDuringLongEnter : MonoBehaviour -{ - public enum States - { - One, - Two, - Three - } - - public float oneDuration = 1f; - - public int oneEnter; - public int oneUpdate; - public int oneExit; - public int twoEnter; - - private float oneStartTime; - private bool oneEntered = false; - - private StateMachine fsm; - - void Awake() - { - fsm = GetComponent().Initialize(this, States.One); - } - - - IEnumerator One_Enter() - { - Debug.Log("One Enter " + Time.time); - - oneStartTime = Time.time; - - oneEnter++; - - int count = 1; - while (count++ < 120) // Two secs - { - yield return null; - } - - Debug.Log("One Complete " + Time.time); - - oneEntered = true; - } - - //Use the mono behaviour update function to change our states outside the state convention - void Update() - { - var state = fsm.State; - - if (state == States.One) - { - if (Time.time - oneStartTime > oneDuration) - { - Debug.Log("Changing to Two : " + Time.time); - fsm.ChangeState(States.Two); - } - } - } - - void One_Exit() - { - oneExit++; - Debug.Log("One Exit " + Time.time); - - if(!oneEntered) - { - throw new Exception("One exit started before enter is complete"); - } - - } - - void Two_Enter() - { - Debug.Log("Two Enter " + Time.time ); - twoEnter++; - } -} diff --git a/example_project/Assets/TestCases/ClassChangeDuringLongEnter.cs.meta b/example_project/Assets/TestCases/ClassChangeDuringLongEnter.cs.meta deleted file mode 100644 index c9edda7..0000000 --- a/example_project/Assets/TestCases/ClassChangeDuringLongEnter.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 670d43ae4212efb42a436c0dedce8272 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/TestCases/ClassChangeDuringLongExit.cs b/example_project/Assets/TestCases/ClassChangeDuringLongExit.cs deleted file mode 100644 index 12ddd4f..0000000 --- a/example_project/Assets/TestCases/ClassChangeDuringLongExit.cs +++ /dev/null @@ -1,91 +0,0 @@ -using UnityEngine; -using System.Collections; -using MonsterLove.StateMachine; - -public class ClassChangeDuringLongExit : MonoBehaviour -{ - public enum States - { - One, - Two, - Three - } - - public int oneEnter; - public int oneUpdate; - public int oneExit; - public int oneFinally; - public int twoEnter; - - private StateMachine fsm; - - void Awake() - { - fsm = GetComponent().Initialize(this, States.One); - } - - private float oneStartTime; - private float oneDuration = 1f; - - IEnumerator One_Enter() - { - Debug.Log("One Enter " + Time.time); - - oneStartTime = Time.time; - - oneEnter++; - - int count = 1; - while (count++ < 120) // Two secs - { - yield return null; - } - - Debug.Log("One Complete " + Time.time); - } - - void One_Update() - { - oneUpdate++; - - if(Time.time - oneStartTime > oneDuration) - { - Debug.Log("Changing to two " + Time.time); - fsm.ChangeState(States.Two); - } - - } - - IEnumerator One_Exit() - { - oneExit++; - Debug.Log("One Exit " + Time.time); - - //This should not cause the fsm.ChangeState() from update to double fire - yield return null; - - //This should not cause it to triple fire - yield return null; - - Debug.Log("One Exit Complete " + Time.time); - } - - void One_Finally() - { - oneFinally++; - } - - IEnumerator Two_Enter() - { - Debug.Log("Two Enter " + Time.time ); - twoEnter++; - - int count = 0; - while(count++ < 120) //2 secs - { - yield return null; - } - - Debug.Log("Two Enter Complete " + Time.time); - } -} diff --git a/example_project/Assets/TestCases/ClassChangeDuringLongExit.cs.meta b/example_project/Assets/TestCases/ClassChangeDuringLongExit.cs.meta deleted file mode 100644 index 204f391..0000000 --- a/example_project/Assets/TestCases/ClassChangeDuringLongExit.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 46c46b3e22fd94349812a79635b868c6 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/TestCases/ClassChangeDuringMonoUpdate.cs b/example_project/Assets/TestCases/ClassChangeDuringMonoUpdate.cs deleted file mode 100644 index fed0cc5..0000000 --- a/example_project/Assets/TestCases/ClassChangeDuringMonoUpdate.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.Collections.Generic; -using MonsterLove.StateMachine; -using UnityEngine; -using System.Collections; -using UnityEngine.UI; - -/// TEST DESCRIPTION -/// -/// Make sure that when we change during a monobehvaiour function call (ie Update) that we aren't double triggering changes to other states. Two_Enter is called once and only once. -public class ClassChangeDuringMonoUpdate : MonoBehaviour -{ - public enum States - { - NotUsed, - AlsoNotUsed, - One, - Two - } - - public float oneDuration = 1f; - - private float oneStartTime; - - public int oneEnter = 0; - public int twoEnter = 0; - - private StateMachine fsm; - - void Awake() - { - fsm = GetComponent().Initialize(this, States.One); - } - - //Unverified assumption: Use timer here in stead of couroutines to prevent the stack depth getting too deeps, as these couroutines will cycle into each other - void One_Enter() - { - Debug.Log("One: Entered " + Time.time); - - oneStartTime = Time.time; - - oneEnter++; - } - - //Use the mono behaviour update function to change our states. - void Update() - { - var state = fsm.State; - - if(state == States.One) - { - if (Time.time - oneStartTime > oneDuration) - { - Debug.Log("Changing to Two : " + Time.time); - fsm.ChangeState(States.Two); - } - } - } - - IEnumerator Two_Enter() - { - Debug.Log("Two Entered " + Time.time ); - twoEnter++; - - yield return null; - } -} diff --git a/example_project/Assets/TestCases/ClassChangeDuringMonoUpdate.cs.meta b/example_project/Assets/TestCases/ClassChangeDuringMonoUpdate.cs.meta deleted file mode 100644 index e5d73e6..0000000 --- a/example_project/Assets/TestCases/ClassChangeDuringMonoUpdate.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ec27dda91250b0b48ab188ed7c55377f -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/TestCases/ClassChangeDuringUpdate.cs b/example_project/Assets/TestCases/ClassChangeDuringUpdate.cs deleted file mode 100644 index 13b1aaf..0000000 --- a/example_project/Assets/TestCases/ClassChangeDuringUpdate.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Collections.Generic; -using MonsterLove.StateMachine; -using UnityEngine; -using System.Collections; -using UnityEngine.UI; - -public class ClassChangeDuringUpdate : MonoBehaviour -{ - public enum States - { - NotUsed, - AlsoNotUsed, - One, - Two - } - - public float oneDuration = 1f; - - private float oneStartTime; - - public int oneEnter = 0; - public int twoEnter = 0; - - public StateMachine fsm; - - void Awake() - { - fsm = StateMachine.Initialize(this, States.One); - } - - //Use timer here in stead of couroutines to prevent the stack depth getting too deeps, as these couroutines will cycle into each other - void One_Enter() - { - Debug.Log("One: Entered " + Time.time); - - oneStartTime = Time.time; - - oneEnter++; - } - - void One_Update() - { - if(Time.time - oneStartTime > oneDuration) - { - Debug.Log("Changing to Two : " + Time.time); - fsm.ChangeState(States.Two); - } - } - - - IEnumerator Two_Enter() - { - Debug.Log("Two Entered " + Time.time ); - twoEnter++; - - yield return null; - - } - - - - -} diff --git a/example_project/Assets/TestCases/ClassChangeDuringUpdate.cs.meta b/example_project/Assets/TestCases/ClassChangeDuringUpdate.cs.meta deleted file mode 100644 index 7786b8e..0000000 --- a/example_project/Assets/TestCases/ClassChangeDuringUpdate.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 591d459ce5eff0c4894a7f5109d2a813 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/TestCases/ClassChangeFromLongExit.cs b/example_project/Assets/TestCases/ClassChangeFromLongExit.cs deleted file mode 100644 index 2651f89..0000000 --- a/example_project/Assets/TestCases/ClassChangeFromLongExit.cs +++ /dev/null @@ -1,88 +0,0 @@ -using UnityEngine; -using System.Collections; -using MonsterLove.StateMachine; - -public class ClassChangeFromLongExit : MonoBehaviour -{ - public enum States - { - One, - Two, - Three - } - - public int oneEnter; - public int oneUpdate; - public int oneExit; - public int twoEnter; - public bool exitComplete; - - private StateMachine fsm; - - void Awake() - { - fsm = GetComponent().Initialize(this, States.One); - } - - private float oneStartTime; - private float oneDuration = 1f; - - void One_Enter() - { - Debug.Log("One Enter " + Time.time); - - oneStartTime = Time.time; - - oneEnter++; - } - - void One_Update() - { - oneUpdate++; - - if(Time.time - oneStartTime > oneDuration) - { - Debug.Log("Changing to two " + Time.time); - fsm.ChangeState(States.Two); - } - - } - - IEnumerator One_Exit() - { - oneExit++; - Debug.Log("One Exit " + Time.time); - - StartCoroutine(DelayedChange()); - - int count = 1; - while (count++ < 120) // Two secs - { - yield return null; - } - - exitComplete = true; - Debug.Log("One Exit Complete " + Time.time); - } - - //Mimic change from external source while we happen to be exiting - IEnumerator DelayedChange() - { - yield return new WaitForSeconds(oneDuration); - fsm.ChangeState(States.Two); - } - - IEnumerator Two_Enter() - { - Debug.Log("Two Enter " + Time.time ); - twoEnter++; - - int count = 0; - while(count++ < 120) //2 secs - { - yield return null; - } - - Debug.Log("Two Enter Complete " + Time.time); - } -} diff --git a/example_project/Assets/TestCases/ClassChangeFromLongExit.cs.meta b/example_project/Assets/TestCases/ClassChangeFromLongExit.cs.meta deleted file mode 100644 index 69b2fdd..0000000 --- a/example_project/Assets/TestCases/ClassChangeFromLongExit.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d066619c5827e9d47be58566aec8d0db -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/TestCases/ClassDeactivateDuringChange.cs b/example_project/Assets/TestCases/ClassDeactivateDuringChange.cs deleted file mode 100644 index cd54000..0000000 --- a/example_project/Assets/TestCases/ClassDeactivateDuringChange.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using UnityEngine; -using System.Collections; -using MonsterLove.StateMachine; - -/// TEST DESCRIPTION -/// -/// Test to make sure that when a game object reactivates itself after being set to inactive during a state transition, -/// We don't stall when we try and call the next state. -/// -public class ClassDeactivateDuringChange : MonoBehaviour -{ - public enum States - { - One, - Two, - Three - } - - public TimeoutHelper helper; - - public int oneEnter; - public int oneExit; - public int oneExitComplete; - public int oneFinally; - public int twoEnter; - public int threeEnter; - - private StateMachine fsm; - - void Awake() - { - fsm = GetComponent().Initialize(this, States.One); - } - - - IEnumerator One_Enter() - { - Debug.Log("One Enter " + Time.time); - - oneEnter++; - - yield return new WaitForSeconds(0.5f); - - fsm.ChangeState(States.Two); - - Debug.Log("One Complete " + Time.time); - } - - IEnumerator One_Exit() - { - oneExit++; - Debug.Log("One Exit " + Time.time); - - yield return new WaitForSeconds(0.5f); - - helper.SetTimeout(ChangeToThree, 0.5f); - // This might be breaking the test runner. Need to try figure this out - gameObject.SetActive(false); - - oneExitComplete++; - Debug.Log("One Exit Complete" + Time.time); - } - - void One_Finally() - { - oneFinally++; - } - - void Two_Enter() - { - Debug.Log("Two Enter " + Time.time ); - twoEnter++; - } - - void Three_Enter() - { - Debug.Log("Three Enter" + Time.time); - threeEnter++; - } - - public void ChangeToThree() - { - gameObject.SetActive(true); - fsm.ChangeState(States.Three); - } -} diff --git a/example_project/Assets/TestCases/ClassDetectOnCollisionEnter.cs b/example_project/Assets/TestCases/ClassDetectOnCollisionEnter.cs deleted file mode 100644 index 9476d44..0000000 --- a/example_project/Assets/TestCases/ClassDetectOnCollisionEnter.cs +++ /dev/null @@ -1,35 +0,0 @@ -using UnityEngine; -using System; -using System.Collections; -using System.Collections.Generic; -using MonsterLove.StateMachine; - -public class ClassDetectOnCollisionEnter : MonoBehaviour -{ - public enum States - { - One, - Two, - } - - public bool oneHasCollision = false; - public bool twoHasCollision = false; - - private StateMachine fsm; - - void Awake() - { - fsm = GetComponent().Initialize(this, States.One); - } - - void OnCollisionEnter(Collision collision) - { - Debug.Log(collision.collider); - } - - void One_OnCollisionEnter(Collision collision) - { - oneHasCollision = true; - Debug.Log("one has on colliision " + collision.collider); - } -} diff --git a/example_project/Assets/TestCases/ClassDisabled.cs b/example_project/Assets/TestCases/ClassDisabled.cs deleted file mode 100644 index ea005de..0000000 --- a/example_project/Assets/TestCases/ClassDisabled.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using UnityEngine; -using System.Collections; -using MonsterLove.StateMachine; - -/// TEST DESCRIPTION -/// -/// Test to make sure that when a game object reactivates itself after being set to inactive during a state transition, -/// We don't stall when we try and call the next state. -/// -public class ClassDisabled : MonoBehaviour -{ - public enum States - { - One, - Two, - Three - } - - - public int oneUpdate; - public int twoUpdate; - - public TimeoutHelper helper; - - private StateMachine fsm; - - void Awake() - { - fsm = GetComponent().Initialize(this, States.One); - } - - void One_Enter() - { - helper.SetTimeout(() => fsm.ChangeState(States.Two), 0.4f); - } - - void One_Update() - { - oneUpdate++; - - } - - void Two_Enter() - { - enabled = false; - - helper.SetTimeout(() => fsm.ChangeState(States.Three), 0.4f); - } - - void Two_Update() - { - twoUpdate++; - } -} diff --git a/example_project/Assets/TestCases/ClassOverwriteLongEnter.cs b/example_project/Assets/TestCases/ClassOverwriteLongEnter.cs deleted file mode 100644 index 0cd1c41..0000000 --- a/example_project/Assets/TestCases/ClassOverwriteLongEnter.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using UnityEngine; -using System.Collections; -using MonsterLove.StateMachine; - -/// TEST DESCRIPTION -/// -/// Make sure that when we call overwrite during a long enter routine, Enter is cancelled and the next state is called immediately -/// without calling the exit function. -public class ClassOverwriteLongEnter : MonoBehaviour -{ - public enum States - { - One, - Two, - Three - } - - public float oneDuration = 1f; - - public int oneEnter; - public int oneUpdate; - public int oneExit; - public int oneFinally; - public int twoEnter; - public bool oneEntered = false; - public bool twoEntered = true; - - private float oneStartTime; - - private StateMachine fsm; - - void Awake() - { - fsm = GetComponent().Initialize(this, States.One); - } - - IEnumerator One_Enter() - { - Debug.Log("One Enter " + Time.time); - - oneStartTime = Time.time; - - oneEnter++; - - yield return new WaitForSeconds(oneDuration * 2); - - Debug.Log("One Enter Complete " + Time.time); - - oneEntered = true; - } - - //Use the mono behaviour update function to change our states outside the state convention - void Update() - { - var state = fsm.State; - - if (state == States.One) - { - if (Time.time - oneStartTime > oneDuration) - { - Debug.Log("Changing to Two : " + Time.time); - fsm.ChangeState(States.Two, StateTransition.Overwrite); - } - } - } - - void One_Exit() - { - oneExit++; - Debug.Log("One Exit " + Time.time); - } - - - void One_Finally() - { - oneFinally++; - Debug.Log("One Finally " + Time.time); - } - - IEnumerator Two_Enter() - { - Debug.Log("Two Enter " + Time.time ); - twoEnter++; - - yield return new WaitForSeconds(oneDuration*0.5f); - - Debug.Log("Two Enter Complete " + Time.time); - twoEntered = true; - } -} diff --git a/example_project/Assets/TestCases/ClassOverwriteLongEnter.cs.meta b/example_project/Assets/TestCases/ClassOverwriteLongEnter.cs.meta deleted file mode 100644 index 079519b..0000000 --- a/example_project/Assets/TestCases/ClassOverwriteLongEnter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2bf3e88c7e710594aa300123c71bf5de -timeCreated: 1430720804 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/example_project/Assets/TestCases/ClassOverwriteLongExitToLongEnter.cs b/example_project/Assets/TestCases/ClassOverwriteLongExitToLongEnter.cs deleted file mode 100644 index 5b77847..0000000 --- a/example_project/Assets/TestCases/ClassOverwriteLongExitToLongEnter.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using UnityEngine; -using System.Collections; -using MonsterLove.StateMachine; - -/// TEST DESCRIPTION -/// -/// What happens when IEnumerator Exit is overwritten by IEnumerator Enter -public class ClassOverwriteLongExitToLongEnter : MonoBehaviour -{ - public enum States - { - One, - Two, - Three - } - - public float oneDuration = 1f; - - public int oneEnter; - public int oneUpdate; - public int oneExit; - public int oneFinally; - public int twoEnter; - public bool oneEntered = false; - public bool oneExited = false; - public bool twoEntered = true; - - private float oneStartTime; - - private StateMachine fsm; - - void Awake() - { - fsm = GetComponent().Initialize(this, States.One); - } - - IEnumerator One_Enter() - { - Debug.Log("One Enter " + Time.time); - - oneStartTime = Time.time; - - oneEnter++; - - yield return new WaitForSeconds(oneDuration * 2); - - Debug.Log("One Enter Complete " + Time.time); - - oneEntered = true; - } - - //Use the mono behaviour update function to change our states outside the state convention - void Update() - { - var state = fsm.State; - - if (state == States.One) - { - if (Time.time - oneStartTime > oneDuration) - { - Debug.Log("Changing to Two : " + Time.time); - fsm.ChangeState(States.Two, StateTransition.Overwrite); - } - } - } - - IEnumerator One_Exit() - { - Debug.Log("One Exit " + Time.time); - oneExit++; - - yield return new WaitForSeconds(oneDuration * 2); - - oneExited = true; - Debug.Log("One Exit Complete" + Time.time); - } - - - void One_Finally() - { - oneFinally++; - Debug.Log("One Finally " + Time.time); - } - - IEnumerator Two_Enter() - { - Debug.Log("Two Enter " + Time.time ); - twoEnter++; - - yield return new WaitForSeconds(oneDuration*0.5f); - - Debug.Log("Two Enter Complete " + Time.time); - twoEntered = true; - } -} diff --git a/example_project/Assets/TestCases/ClassOverwriteLongExitToLongEnter.cs.meta b/example_project/Assets/TestCases/ClassOverwriteLongExitToLongEnter.cs.meta deleted file mode 100644 index 38774f5..0000000 --- a/example_project/Assets/TestCases/ClassOverwriteLongExitToLongEnter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ff3769d05f1596a439438599c50c2c6a -timeCreated: 1457691119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/example_project/Assets/TestCases/ClassOverwriteLongExitToShortEnter.cs b/example_project/Assets/TestCases/ClassOverwriteLongExitToShortEnter.cs deleted file mode 100644 index 68e76b7..0000000 --- a/example_project/Assets/TestCases/ClassOverwriteLongExitToShortEnter.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using UnityEngine; -using System.Collections; -using MonsterLove.StateMachine; - -/// TEST DESCRIPTION -/// -/// What happens when IEnumerator Exit is overwritten by void Enter -public class ClassOverwriteLongExitToShortEnter : MonoBehaviour -{ - public enum States - { - One, - Two, - Three - } - - public float oneDuration = 1f; - - public int oneEnter; - public int oneUpdate; - public int oneExit; - public int oneFinally; - public int twoEnter; - public bool oneEntered = false; - public bool oneExited = false; - public bool twoEntered = true; - - private float oneStartTime; - - private StateMachine fsm; - - void Awake() - { - fsm = GetComponent().Initialize(this, States.One); - } - - IEnumerator One_Enter() - { - Debug.Log("One Enter " + Time.time); - - oneStartTime = Time.time; - - oneEnter++; - - yield return new WaitForSeconds(oneDuration * 2); - - Debug.Log("One Enter Complete " + Time.time); - - oneEntered = true; - } - - //Use the mono behaviour update function to change our states outside the state convention - void Update() - { - var state = fsm.State; - - if (state == States.One) - { - if (Time.time - oneStartTime > oneDuration) - { - Debug.Log("Changing to Two : " + Time.time); - fsm.ChangeState(States.Two, StateTransition.Overwrite); - } - } - } - - IEnumerator One_Exit() - { - Debug.Log("One Exit " + Time.time); - oneExit++; - - yield return new WaitForSeconds(oneDuration * 2); - - oneExited = true; - Debug.Log("One Exit Complete" + Time.time); - } - - - void One_Finally() - { - oneFinally++; - Debug.Log("One Finally " + Time.time); - } - - void Two_Enter() - { - Debug.Log("Two Enter " + Time.time ); - twoEnter++; - - //yield return new WaitForSeconds(oneDuration*0.5f); - //Debug.Log("Two Enter Complete " + Time.time); - twoEntered = true; - } -} diff --git a/example_project/Assets/TestCases/ClassOverwriteLongExitToShortEnter.cs.meta b/example_project/Assets/TestCases/ClassOverwriteLongExitToShortEnter.cs.meta deleted file mode 100644 index cf646c7..0000000 --- a/example_project/Assets/TestCases/ClassOverwriteLongExitToShortEnter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2a78c2f4fa52e5d4fbe8543ea1839c64 -timeCreated: 1457691119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/example_project/Assets/TestCases/ClassOverwriteShortExitToLongEnter.cs b/example_project/Assets/TestCases/ClassOverwriteShortExitToLongEnter.cs deleted file mode 100644 index 91cd06f..0000000 --- a/example_project/Assets/TestCases/ClassOverwriteShortExitToLongEnter.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using UnityEngine; -using System.Collections; -using MonsterLove.StateMachine; - -/// TEST DESCRIPTION -/// -/// What happens when void Exit is overwritten by IEnumerator Enter -public class ClassOverwriteShortExitToLongEnter : MonoBehaviour -{ - public enum States - { - One, - Two, - Three - } - - public float oneDuration = 1f; - - public int oneEnter; - public int oneUpdate; - public int oneExit; - public int oneFinally; - public int twoEnter; - public bool oneEntered = false; - public bool oneExited = false; - public bool twoEntered = true; - - private float oneStartTime; - - private StateMachine fsm; - - void Awake() - { - fsm = GetComponent().Initialize(this, States.One); - } - - IEnumerator One_Enter() - { - Debug.Log("One Enter " + Time.time); - - oneStartTime = Time.time; - - oneEnter++; - - yield return new WaitForSeconds(oneDuration * 2); - - Debug.Log("One Enter Complete " + Time.time); - - oneEntered = true; - } - - //Use the mono behaviour update function to change our states outside the state convention - void Update() - { - var state = fsm.State; - - if (state == States.One) - { - if (Time.time - oneStartTime > oneDuration) - { - Debug.Log("Changing to Two : " + Time.time); - fsm.ChangeState(States.Two, StateTransition.Overwrite); - } - } - } - - void One_Exit() - { - Debug.Log("One Exit " + Time.time); - oneExit++; - - //yield return new WaitForSeconds(oneDuration * 2); - - oneExited = true; - //Debug.Log("One Exit Complete" + Time.time); - } - - - void One_Finally() - { - oneFinally++; - Debug.Log("One Finally " + Time.time); - } - - IEnumerator Two_Enter() - { - Debug.Log("Two Enter " + Time.time ); - twoEnter++; - - yield return new WaitForSeconds(oneDuration*0.5f); - - Debug.Log("Two Enter Complete " + Time.time); - twoEntered = true; - } -} diff --git a/example_project/Assets/TestCases/ClassOverwriteShortExitToLongEnter.cs.meta b/example_project/Assets/TestCases/ClassOverwriteShortExitToLongEnter.cs.meta deleted file mode 100644 index c637800..0000000 --- a/example_project/Assets/TestCases/ClassOverwriteShortExitToLongEnter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 01c886a16af10b74b8cb19905d03818c -timeCreated: 1457691119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/example_project/Assets/TestCases/ClassOverwriteShortExitToShortEnter.cs b/example_project/Assets/TestCases/ClassOverwriteShortExitToShortEnter.cs deleted file mode 100644 index 4dea48d..0000000 --- a/example_project/Assets/TestCases/ClassOverwriteShortExitToShortEnter.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using UnityEngine; -using System.Collections; -using MonsterLove.StateMachine; - -/// TEST DESCRIPTION -/// -/// What happens when void Exit is overwritten by void Enter -public class ClassOverwriteShortExitToShortEnter : MonoBehaviour -{ - public enum States - { - One, - Two, - Three - } - - public float oneDuration = 1f; - - public int oneEnter; - public int oneUpdate; - public int oneExit; - public int oneFinally; - public int twoEnter; - public bool oneEntered = false; - public bool oneExited = false; - public bool twoEntered = true; - - private float oneStartTime; - - private StateMachine fsm; - - void Awake() - { - fsm = GetComponent().Initialize(this, States.One); - } - - IEnumerator One_Enter() - { - Debug.Log("One Enter " + Time.time); - - oneStartTime = Time.time; - - oneEnter++; - - yield return new WaitForSeconds(oneDuration * 2); - - Debug.Log("One Enter Complete " + Time.time); - - oneEntered = true; - } - - //Use the mono behaviour update function to change our states outside the state convention - void Update() - { - var state = fsm.State; - - if (state == States.One) - { - if (Time.time - oneStartTime > oneDuration) - { - Debug.Log("Changing to Two : " + Time.time); - fsm.ChangeState(States.Two, StateTransition.Overwrite); - } - } - } - - void One_Exit() - { - Debug.Log("One Exit " + Time.time); - oneExit++; - oneExited = true; - } - - - void One_Finally() - { - oneFinally++; - Debug.Log("One Finally " + Time.time); - } - - void Two_Enter() - { - Debug.Log("Two Enter " + Time.time ); - twoEnter++; - twoEntered = true; - } -} diff --git a/example_project/Assets/TestCases/ClassOverwriteShortExitToShortEnter.cs.meta b/example_project/Assets/TestCases/ClassOverwriteShortExitToShortEnter.cs.meta deleted file mode 100644 index 4e7f81c..0000000 --- a/example_project/Assets/TestCases/ClassOverwriteShortExitToShortEnter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 1e841708d8b88714383e14838d586a38 -timeCreated: 1457691119 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/example_project/Assets/TestCases/ClassWithHiddenMethods.cs b/example_project/Assets/TestCases/ClassWithHiddenMethods.cs deleted file mode 100644 index 72954e2..0000000 --- a/example_project/Assets/TestCases/ClassWithHiddenMethods.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using UnityEngine; -using System.Collections; -using MonsterLove.StateMachine; - -public class ClassWithHiddenMethods : MonoBehaviour -{ - //Causes add_MyEvent & remove_MyEvent hidden method names - public event Action MyEvent; - - public enum States - { - One, - Two, - Three, - } - - void Awake() - { - TestInit(); - } - - string oneTest; - public void One_Enter() - { - //Spawns anon functions m__80 - System.Action anonFunc = (str) => { oneTest = str; }; - } - - //Now that warning code has been removed this will no longer cause an error - public void Twoo_Enter() - { - - } - - //Double Underscors mimics unity hidden metadata functions, should be ignored - public void Two__Ignore() - { - - } - - public void Two_DoSomethingElse() - { - - } - - public void TestInit () - { - var fsm = StateMachine.Initialize(this); - } - - //Causes get_TestProperty & set_TestProperty hidden method names - public float TestProperty - { - get; - set; - } - - public void Broadcast () - { - if (MyEvent != null) MyEvent(); - } -} diff --git a/example_project/Assets/TestCases/ClassWithHiddenMethods.cs.meta b/example_project/Assets/TestCases/ClassWithHiddenMethods.cs.meta deleted file mode 100644 index ac0e217..0000000 --- a/example_project/Assets/TestCases/ClassWithHiddenMethods.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d4aa1b977f131694b83b26c5a20fbea7 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/TestCases/Helper/TimeoutHelper.cs b/example_project/Assets/TestCases/Helper/TimeoutHelper.cs deleted file mode 100644 index bbdb193..0000000 --- a/example_project/Assets/TestCases/Helper/TimeoutHelper.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using UnityEngine; -using System.Collections; -using System.Collections.Generic; - -public class TimeoutHelper : MonoBehaviour -{ - - void Awake() - { - - } - - //We call this on separate game object so that the active state of the caller has no bearing. - public void SetTimeout(Action callback, float duration) - { - StartCoroutine(DoTimeout(callback, duration)); - } - - public IEnumerator DoTimeout(Action callback, float duration) - { - Debug.Log("Starting timeout " + Time.time ); - yield return new WaitForSeconds(duration); - - Debug.Log("Ending timeout " + Time.time); - if (callback != null) callback(); - } -} diff --git a/example_project/Assets/TestCases/Helper/TimeoutHelper.cs.meta b/example_project/Assets/TestCases/Helper/TimeoutHelper.cs.meta deleted file mode 100644 index 6df89ee..0000000 --- a/example_project/Assets/TestCases/Helper/TimeoutHelper.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d2d5e43bbe3380c4f8a743a7c4d63ea0 -timeCreated: 1433410915 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/example_project/Assets/TestCases/IntegrationTests.unity b/example_project/Assets/TestCases/IntegrationTests.unity deleted file mode 100644 index 354e9e8..0000000 Binary files a/example_project/Assets/TestCases/IntegrationTests.unity and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Assertions.meta b/example_project/Assets/UnityTestTools/Assertions.meta deleted file mode 100644 index 229b8b8..0000000 --- a/example_project/Assets/UnityTestTools/Assertions.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: b27b28700d3365146808b6e082748201 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/AssertionComponent.cs b/example_project/Assets/UnityTestTools/Assertions/AssertionComponent.cs deleted file mode 100644 index fa40d48..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/AssertionComponent.cs +++ /dev/null @@ -1,379 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using UnityEngine; -using Debug = UnityEngine.Debug; -using Object = UnityEngine.Object; - -namespace UnityTest -{ - [Serializable] - public class AssertionComponent : MonoBehaviour, IAssertionComponentConfigurator - { - [SerializeField] public float checkAfterTime = 1f; - [SerializeField] public bool repeatCheckTime = true; - [SerializeField] public float repeatEveryTime = 1f; - [SerializeField] public int checkAfterFrames = 1; - [SerializeField] public bool repeatCheckFrame = true; - [SerializeField] public int repeatEveryFrame = 1; - [SerializeField] public bool hasFailed; - - [SerializeField] public CheckMethod checkMethods = CheckMethod.Start; - [SerializeField] private ActionBase m_ActionBase; - - [SerializeField] public int checksPerformed = 0; - - private int m_CheckOnFrame; - - private string m_CreatedInFilePath = ""; - private int m_CreatedInFileLine = -1; - - public ActionBase Action - { - get { return m_ActionBase; } - set - { - m_ActionBase = value; - m_ActionBase.go = gameObject; - } - } - - public Object GetFailureReferenceObject() - { - #if UNITY_EDITOR - if (!string.IsNullOrEmpty(m_CreatedInFilePath)) - { - return UnityEditor.AssetDatabase.LoadAssetAtPath(m_CreatedInFilePath, typeof(Object)); - } - #endif - return this; - } - - public string GetCreationLocation() - { - if (!string.IsNullOrEmpty(m_CreatedInFilePath)) - { - var idx = m_CreatedInFilePath.LastIndexOf("\\") + 1; - return string.Format("{0}, line {1} ({2})", m_CreatedInFilePath.Substring(idx), m_CreatedInFileLine, m_CreatedInFilePath); - } - return ""; - } - - public void Awake() - { - if (!Debug.isDebugBuild) - Destroy(this); - OnComponentCopy(); - } - - public void OnValidate() - { - if (Application.isEditor) - OnComponentCopy(); - } - - private void OnComponentCopy() - { - if (m_ActionBase == null) return; - var oldActionList = Resources.FindObjectsOfTypeAll(typeof(AssertionComponent)).Where(o => ((AssertionComponent)o).m_ActionBase == m_ActionBase && o != this); - - // if it's not a copy but a new component don't do anything - if (!oldActionList.Any()) return; - if (oldActionList.Count() > 1) - Debug.LogWarning("More than one refence to comparer found. This shouldn't happen"); - - var oldAction = oldActionList.First() as AssertionComponent; - m_ActionBase = oldAction.m_ActionBase.CreateCopy(oldAction.gameObject, gameObject); - } - - public void Start() - { - CheckAssertionFor(CheckMethod.Start); - - if (IsCheckMethodSelected(CheckMethod.AfterPeriodOfTime)) - { - StartCoroutine("CheckPeriodically"); - } - if (IsCheckMethodSelected(CheckMethod.Update)) - { - m_CheckOnFrame = Time.frameCount + checkAfterFrames; - } - } - - public IEnumerator CheckPeriodically() - { - yield return new WaitForSeconds(checkAfterTime); - CheckAssertionFor(CheckMethod.AfterPeriodOfTime); - while (repeatCheckTime) - { - yield return new WaitForSeconds(repeatEveryTime); - CheckAssertionFor(CheckMethod.AfterPeriodOfTime); - } - } - - public bool ShouldCheckOnFrame() - { - if (Time.frameCount > m_CheckOnFrame) - { - if (repeatCheckFrame) - m_CheckOnFrame += repeatEveryFrame; - else - m_CheckOnFrame = Int32.MaxValue; - return true; - } - return false; - } - - public void OnDisable() - { - CheckAssertionFor(CheckMethod.OnDisable); - } - - public void OnEnable() - { - CheckAssertionFor(CheckMethod.OnEnable); - } - - public void OnDestroy() - { - CheckAssertionFor(CheckMethod.OnDestroy); - } - - public void Update() - { - if (IsCheckMethodSelected(CheckMethod.Update) && ShouldCheckOnFrame()) - { - CheckAssertionFor(CheckMethod.Update); - } - } - - public void FixedUpdate() - { - CheckAssertionFor(CheckMethod.FixedUpdate); - } - - public void LateUpdate() - { - CheckAssertionFor(CheckMethod.LateUpdate); - } - - public void OnControllerColliderHit() - { - CheckAssertionFor(CheckMethod.OnControllerColliderHit); - } - - public void OnParticleCollision() - { - CheckAssertionFor(CheckMethod.OnParticleCollision); - } - - public void OnJointBreak() - { - CheckAssertionFor(CheckMethod.OnJointBreak); - } - - public void OnBecameInvisible() - { - CheckAssertionFor(CheckMethod.OnBecameInvisible); - } - - public void OnBecameVisible() - { - CheckAssertionFor(CheckMethod.OnBecameVisible); - } - - public void OnTriggerEnter() - { - CheckAssertionFor(CheckMethod.OnTriggerEnter); - } - - public void OnTriggerExit() - { - CheckAssertionFor(CheckMethod.OnTriggerExit); - } - - public void OnTriggerStay() - { - CheckAssertionFor(CheckMethod.OnTriggerStay); - } - - public void OnCollisionEnter() - { - CheckAssertionFor(CheckMethod.OnCollisionEnter); - } - - public void OnCollisionExit() - { - CheckAssertionFor(CheckMethod.OnCollisionExit); - } - - public void OnCollisionStay() - { - CheckAssertionFor(CheckMethod.OnCollisionStay); - } - - public void OnTriggerEnter2D() - { - CheckAssertionFor(CheckMethod.OnTriggerEnter2D); - } - - public void OnTriggerExit2D() - { - CheckAssertionFor(CheckMethod.OnTriggerExit2D); - } - - public void OnTriggerStay2D() - { - CheckAssertionFor(CheckMethod.OnTriggerStay2D); - } - - public void OnCollisionEnter2D() - { - CheckAssertionFor(CheckMethod.OnCollisionEnter2D); - } - - public void OnCollisionExit2D() - { - CheckAssertionFor(CheckMethod.OnCollisionExit2D); - } - - public void OnCollisionStay2D() - { - CheckAssertionFor(CheckMethod.OnCollisionStay2D); - } - - private void CheckAssertionFor(CheckMethod checkMethod) - { - if (IsCheckMethodSelected(checkMethod)) - { - Assertions.CheckAssertions(this); - } - } - - public bool IsCheckMethodSelected(CheckMethod method) - { - return method == (checkMethods & method); - } - - - #region Assertion Component create methods - - public static T Create(CheckMethod checkOnMethods, GameObject gameObject, string propertyPath) where T : ActionBase - { - IAssertionComponentConfigurator configurator; - return Create(out configurator, checkOnMethods, gameObject, propertyPath); - } - - public static T Create(out IAssertionComponentConfigurator configurator, CheckMethod checkOnMethods, GameObject gameObject, string propertyPath) where T : ActionBase - { - return CreateAssertionComponent(out configurator, checkOnMethods, gameObject, propertyPath); - } - - public static T Create(CheckMethod checkOnMethods, GameObject gameObject, string propertyPath, GameObject gameObject2, string propertyPath2) where T : ComparerBase - { - IAssertionComponentConfigurator configurator; - return Create(out configurator, checkOnMethods, gameObject, propertyPath, gameObject2, propertyPath2); - } - - public static T Create(out IAssertionComponentConfigurator configurator, CheckMethod checkOnMethods, GameObject gameObject, string propertyPath, GameObject gameObject2, string propertyPath2) where T : ComparerBase - { - var comparer = CreateAssertionComponent(out configurator, checkOnMethods, gameObject, propertyPath); - comparer.compareToType = ComparerBase.CompareToType.CompareToObject; - comparer.other = gameObject2; - comparer.otherPropertyPath = propertyPath2; - return comparer; - } - - public static T Create(CheckMethod checkOnMethods, GameObject gameObject, string propertyPath, object constValue) where T : ComparerBase - { - IAssertionComponentConfigurator configurator; - return Create(out configurator, checkOnMethods, gameObject, propertyPath, constValue); - } - - public static T Create(out IAssertionComponentConfigurator configurator, CheckMethod checkOnMethods, GameObject gameObject, string propertyPath, object constValue) where T : ComparerBase - { - var comparer = CreateAssertionComponent(out configurator, checkOnMethods, gameObject, propertyPath); - if (constValue == null) - { - comparer.compareToType = ComparerBase.CompareToType.CompareToNull; - return comparer; - } - comparer.compareToType = ComparerBase.CompareToType.CompareToConstantValue; - comparer.ConstValue = constValue; - return comparer; - } - - private static T CreateAssertionComponent(out IAssertionComponentConfigurator configurator, CheckMethod checkOnMethods, GameObject gameObject, string propertyPath) where T : ActionBase - { - var ac = gameObject.AddComponent(); - ac.checkMethods = checkOnMethods; - var comparer = ScriptableObject.CreateInstance(); - ac.Action = comparer; - ac.Action.go = gameObject; - ac.Action.thisPropertyPath = propertyPath; - configurator = ac; - -#if !UNITY_METRO - var stackTrace = new StackTrace(true); - var thisFileName = stackTrace.GetFrame(0).GetFileName(); - for (int i = 1; i < stackTrace.FrameCount; i++) - { - var stackFrame = stackTrace.GetFrame(i); - if (stackFrame.GetFileName() != thisFileName) - { - string filePath = stackFrame.GetFileName().Substring(Application.dataPath.Length - "Assets".Length); - ac.m_CreatedInFilePath = filePath; - ac.m_CreatedInFileLine = stackFrame.GetFileLineNumber(); - break; - } - } -#endif // if !UNITY_METRO - return comparer; - } - - #endregion - - #region AssertionComponentConfigurator - public int UpdateCheckStartOnFrame { set { checkAfterFrames = value; } } - public int UpdateCheckRepeatFrequency { set { repeatEveryFrame = value; } } - public bool UpdateCheckRepeat { set { repeatCheckFrame = value; } } - public float TimeCheckStartAfter { set { checkAfterTime = value; } } - public float TimeCheckRepeatFrequency { set { repeatEveryTime = value; } } - public bool TimeCheckRepeat { set { repeatCheckTime = value; } } - public AssertionComponent Component { get { return this; } } - #endregion - } - - public interface IAssertionComponentConfigurator - { - /// - /// If the assertion is evaluated in Update, after how many frame should the evaluation start. Deafult is 1 (first frame) - /// - int UpdateCheckStartOnFrame { set; } - /// - /// If the assertion is evaluated in Update and UpdateCheckRepeat is true, how many frame should pass between evaluations - /// - int UpdateCheckRepeatFrequency { set; } - /// - /// If the assertion is evaluated in Update, should the evaluation be repeated after UpdateCheckRepeatFrequency frames - /// - bool UpdateCheckRepeat { set; } - - /// - /// If the assertion is evaluated after a period of time, after how many seconds the first evaluation should be done - /// - float TimeCheckStartAfter { set; } - /// - /// If the assertion is evaluated after a period of time and TimeCheckRepeat is true, after how many seconds should the next evaluation happen - /// - float TimeCheckRepeatFrequency { set; } - /// - /// If the assertion is evaluated after a period, should the evaluation happen again after TimeCheckRepeatFrequency seconds - /// - bool TimeCheckRepeat { set; } - - AssertionComponent Component { get; } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/AssertionComponent.cs.meta b/example_project/Assets/UnityTestTools/Assertions/AssertionComponent.cs.meta deleted file mode 100644 index 26f9ab4..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/AssertionComponent.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 8bafa54482a87ac4cbd7ff1bfd1ac93a -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/AssertionException.cs b/example_project/Assets/UnityTestTools/Assertions/AssertionException.cs deleted file mode 100644 index 00c6d58..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/AssertionException.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class AssertionException : Exception - { - private readonly AssertionComponent m_Assertion; - - public AssertionException(AssertionComponent assertion) : base(assertion.Action.GetFailureMessage()) - { - m_Assertion = assertion; - } - - public override string StackTrace - { - get - { - return "Created in " + m_Assertion.GetCreationLocation(); - } - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/AssertionException.cs.meta b/example_project/Assets/UnityTestTools/Assertions/AssertionException.cs.meta deleted file mode 100644 index 9605bf0..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/AssertionException.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ef3769ab00d50bc4fbb05a9a91c741d9 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Assertions.cs b/example_project/Assets/UnityTestTools/Assertions/Assertions.cs deleted file mode 100644 index 14b3fd6..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Assertions.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using Object = UnityEngine.Object; - -namespace UnityTest -{ - public static class Assertions - { - public static void CheckAssertions() - { - var assertions = Object.FindObjectsOfType(typeof(AssertionComponent)) as AssertionComponent[]; - CheckAssertions(assertions); - } - - public static void CheckAssertions(AssertionComponent assertion) - { - CheckAssertions(new[] {assertion}); - } - - public static void CheckAssertions(GameObject gameObject) - { - CheckAssertions(gameObject.GetComponents()); - } - - public static void CheckAssertions(AssertionComponent[] assertions) - { - if (!Debug.isDebugBuild) - return; - foreach (var assertion in assertions) - { - assertion.checksPerformed++; - var result = assertion.Action.Compare(); - if (!result) - { - assertion.hasFailed = true; - assertion.Action.Fail(assertion); - } - } - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Assertions.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Assertions.cs.meta deleted file mode 100644 index 00878a4..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Assertions.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 85280dad1e618c143bd3fb07a197b469 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/CheckMethod.cs b/example_project/Assets/UnityTestTools/Assertions/CheckMethod.cs deleted file mode 100644 index 07583dd..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/CheckMethod.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - [Flags] - public enum CheckMethod - { - AfterPeriodOfTime = 1 << 0, - Start = 1 << 1, - Update = 1 << 2, - FixedUpdate = 1 << 3, - LateUpdate = 1 << 4, - OnDestroy = 1 << 5, - OnEnable = 1 << 6, - OnDisable = 1 << 7, - OnControllerColliderHit = 1 << 8, - OnParticleCollision = 1 << 9, - OnJointBreak = 1 << 10, - OnBecameInvisible = 1 << 11, - OnBecameVisible = 1 << 12, - OnTriggerEnter = 1 << 13, - OnTriggerExit = 1 << 14, - OnTriggerStay = 1 << 15, - OnCollisionEnter = 1 << 16, - OnCollisionExit = 1 << 17, - OnCollisionStay = 1 << 18, - OnTriggerEnter2D = 1 << 19, - OnTriggerExit2D = 1 << 20, - OnTriggerStay2D = 1 << 21, - OnCollisionEnter2D = 1 << 22, - OnCollisionExit2D = 1 << 23, - OnCollisionStay2D = 1 << 24, - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/CheckMethod.cs.meta b/example_project/Assets/UnityTestTools/Assertions/CheckMethod.cs.meta deleted file mode 100644 index d3f6ec9..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/CheckMethod.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: cbb75d1643c5a55439f8861a827f411b -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers.meta deleted file mode 100644 index 15d3a92..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: bb9e10c25f478c84f826ea85b03ec179 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/ActionBase.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/ActionBase.cs deleted file mode 100644 index a73e0e2..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/ActionBase.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using UnityEngine; - -namespace UnityTest -{ - public abstract class ActionBase : ScriptableObject - { - public GameObject go; - protected object m_ObjVal; - - private MemberResolver m_MemberResolver; - - public string thisPropertyPath = ""; - public virtual Type[] GetAccepatbleTypesForA() - { - return null; - } - public virtual int GetDepthOfSearch() { return 2; } - - public virtual string[] GetExcludedFieldNames() - { - return new string[] { }; - } - - public bool Compare() - { - if (m_MemberResolver == null) - m_MemberResolver = new MemberResolver(go, thisPropertyPath); - m_ObjVal = m_MemberResolver.GetValue(UseCache); - var result = Compare(m_ObjVal); - return result; - } - - protected abstract bool Compare(object objVal); - - virtual protected bool UseCache { get { return false; } } - - public virtual Type GetParameterType() { return typeof(object); } - - public virtual string GetConfigurationDescription() - { - string result = ""; -#if !UNITY_METRO - foreach (var prop in GetType().GetFields(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly) - .Where(info => info.FieldType.IsSerializable)) - { - var value = prop.GetValue(this); - if (value is double) - value = ((double)value).ToString("0.########"); - if (value is float) - value = ((float)value).ToString("0.########"); - result += value + " "; - } -#endif // if !UNITY_METRO - return result; - } - - IEnumerable GetFields(Type type) - { -#if !UNITY_METRO - return type.GetFields(BindingFlags.Public | BindingFlags.Instance); -#else - return null; -#endif - } - - public ActionBase CreateCopy(GameObject oldGameObject, GameObject newGameObject) - { -#if !UNITY_METRO - var newObj = CreateInstance(GetType()) as ActionBase; -#else - var newObj = (ActionBase) this.MemberwiseClone(); -#endif - var fields = GetFields(GetType()); - foreach (var field in fields) - { - var value = field.GetValue(this); - if (value is GameObject) - { - if (value as GameObject == oldGameObject) - value = newGameObject; - } - field.SetValue(newObj, value); - } - return newObj; - } - - public virtual void Fail(AssertionComponent assertion) - { - Debug.LogException(new AssertionException(assertion), assertion.GetFailureReferenceObject()); - } - - public virtual string GetFailureMessage() - { - return GetType().Name + " assertion failed.\n(" + go + ")." + thisPropertyPath + " failed. Value: " + m_ObjVal; - } - } - - public abstract class ActionBaseGeneric : ActionBase - { - protected override bool Compare(object objVal) - { - return Compare((T)objVal); - } - protected abstract bool Compare(T objVal); - - public override Type[] GetAccepatbleTypesForA() - { - return new[] { typeof(T) }; - } - - public override Type GetParameterType() - { - return typeof(T); - } - protected override bool UseCache { get { return true; } } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/ActionBase.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/ActionBase.cs.meta deleted file mode 100644 index 6d4c3ab..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/ActionBase.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b4995756bd539804e8143ff1e730f806 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/BoolComparer.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/BoolComparer.cs deleted file mode 100644 index 3987cc2..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/BoolComparer.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class BoolComparer : ComparerBaseGeneric - { - protected override bool Compare(bool a, bool b) - { - return a == b; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/BoolComparer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/BoolComparer.cs.meta deleted file mode 100644 index 7ee21b6..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/BoolComparer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2586c8e41f35d2f4fadde53020bf4207 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/ColliderComparer.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/ColliderComparer.cs deleted file mode 100644 index cfca05d..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/ColliderComparer.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class ColliderComparer : ComparerBaseGeneric - { - public enum CompareType - { - Intersects, - DoesNotIntersect - }; - - public CompareType compareType; - - protected override bool Compare(Bounds a, Bounds b) - { - switch (compareType) - { - case CompareType.Intersects: - return a.Intersects(b); - case CompareType.DoesNotIntersect: - return !a.Intersects(b); - } - throw new Exception(); - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/ColliderComparer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/ColliderComparer.cs.meta deleted file mode 100644 index ab3aa47..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/ColliderComparer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4eff45b2ac4067b469d7994298341db6 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/ComparerBase.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/ComparerBase.cs deleted file mode 100644 index db90211..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/ComparerBase.cs +++ /dev/null @@ -1,145 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using Object = System.Object; - -namespace UnityTest -{ - public abstract class ComparerBase : ActionBase - { - public enum CompareToType - { - CompareToObject, - CompareToConstantValue, - CompareToNull - } - - public CompareToType compareToType = CompareToType.CompareToObject; - - public GameObject other; - protected object m_ObjOtherVal; - public string otherPropertyPath = ""; - private MemberResolver m_MemberResolverB; - - protected abstract bool Compare(object a, object b); - - protected override bool Compare(object objValue) - { - if (compareToType == CompareToType.CompareToConstantValue) - { - m_ObjOtherVal = ConstValue; - } - else if (compareToType == CompareToType.CompareToNull) - { - m_ObjOtherVal = null; - } - else - { - if (other == null) - m_ObjOtherVal = null; - else - { - if (m_MemberResolverB == null) - m_MemberResolverB = new MemberResolver(other, otherPropertyPath); - m_ObjOtherVal = m_MemberResolverB.GetValue(UseCache); - } - } - return Compare(objValue, m_ObjOtherVal); - } - - public virtual Type[] GetAccepatbleTypesForB() - { - return null; - } - - #region Const value - - public virtual object ConstValue { get; set; } - public virtual object GetDefaultConstValue() - { - throw new NotImplementedException(); - } - - #endregion - - public override string GetFailureMessage() - { - var message = GetType().Name + " assertion failed.\n" + go.name + "." + thisPropertyPath + " " + compareToType; - switch (compareToType) - { - case CompareToType.CompareToObject: - message += " (" + other + ")." + otherPropertyPath + " failed."; - break; - case CompareToType.CompareToConstantValue: - message += " " + ConstValue + " failed."; - break; - case CompareToType.CompareToNull: - message += " failed."; - break; - } - message += " Expected: " + m_ObjOtherVal + " Actual: " + m_ObjVal; - return message; - } - } - - [Serializable] - public abstract class ComparerBaseGeneric : ComparerBaseGeneric - { - } - - [Serializable] - public abstract class ComparerBaseGeneric : ComparerBase - { - public T2 constantValueGeneric = default(T2); - - public override Object ConstValue - { - get - { - return constantValueGeneric; - } - set - { - constantValueGeneric = (T2)value; - } - } - - public override Object GetDefaultConstValue() - { - return default(T2); - } - - static bool IsValueType(Type type) - { -#if !UNITY_METRO - return type.IsValueType; -#else - return false; -#endif - } - - protected override bool Compare(object a, object b) - { - var type = typeof(T2); - if (b == null && IsValueType(type)) - { - throw new ArgumentException("Null was passed to a value-type argument"); - } - return Compare((T1)a, (T2)b); - } - - protected abstract bool Compare(T1 a, T2 b); - - public override Type[] GetAccepatbleTypesForA() - { - return new[] { typeof(T1) }; - } - - public override Type[] GetAccepatbleTypesForB() - { - return new[] {typeof(T2)}; - } - - protected override bool UseCache { get { return true; } } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/ComparerBase.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/ComparerBase.cs.meta deleted file mode 100644 index 65909eb..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/ComparerBase.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c86508f389d643b40b6e1d7dcc1d4df2 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/FloatComparer.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/FloatComparer.cs deleted file mode 100644 index ce0a2c2..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/FloatComparer.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class FloatComparer : ComparerBaseGeneric - { - public enum CompareTypes - { - Equal, - NotEqual, - Greater, - Less - } - - public CompareTypes compareTypes; - public double floatingPointError = 0.0001f; - - protected override bool Compare(float a, float b) - { - switch (compareTypes) - { - case CompareTypes.Equal: - return Math.Abs(a - b) < floatingPointError; - case CompareTypes.NotEqual: - return Math.Abs(a - b) > floatingPointError; - case CompareTypes.Greater: - return a > b; - case CompareTypes.Less: - return a < b; - } - throw new Exception(); - } - public override int GetDepthOfSearch() - { - return 3; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/FloatComparer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/FloatComparer.cs.meta deleted file mode 100644 index 07353ad..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/FloatComparer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a4928c6c2b973874c8d4e6c9a69bb5b4 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/GeneralComparer.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/GeneralComparer.cs deleted file mode 100644 index 96892aa..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/GeneralComparer.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class GeneralComparer : ComparerBase - { - public enum CompareType { AEqualsB, ANotEqualsB } - - public CompareType compareType; - - protected override bool Compare(object a, object b) - { - if (compareType == CompareType.AEqualsB) - return a.Equals(b); - if (compareType == CompareType.ANotEqualsB) - return !a.Equals(b); - throw new Exception(); - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/GeneralComparer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/GeneralComparer.cs.meta deleted file mode 100644 index 6b7edb3..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/GeneralComparer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 902961c69f102f4409c29b9e54258701 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/IntComparer.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/IntComparer.cs deleted file mode 100644 index 25c43aa..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/IntComparer.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class IntComparer : ComparerBaseGeneric - { - public enum CompareType - { - Equal, - NotEqual, - Greater, - GreaterOrEqual, - Less, - LessOrEqual - }; - - public CompareType compareType; - - protected override bool Compare(int a, int b) - { - switch (compareType) - { - case CompareType.Equal: - return a == b; - case CompareType.NotEqual: - return a != b; - case CompareType.Greater: - return a > b; - case CompareType.GreaterOrEqual: - return a >= b; - case CompareType.Less: - return a < b; - case CompareType.LessOrEqual: - return a <= b; - } - throw new Exception(); - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/IntComparer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/IntComparer.cs.meta deleted file mode 100644 index 64f4fc3..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/IntComparer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: da4a3a521c5c1494aae123742ca5c8f5 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/IsRenderedByCamera.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/IsRenderedByCamera.cs deleted file mode 100644 index bc5d370..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/IsRenderedByCamera.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class IsRenderedByCamera : ComparerBaseGeneric - { - public enum CompareType - { - IsVisible, - IsNotVisible, - }; - - public CompareType compareType; - - protected override bool Compare(Renderer renderer, Camera camera) - { - var planes = GeometryUtility.CalculateFrustumPlanes(camera); - var isVisible = GeometryUtility.TestPlanesAABB(planes, renderer.bounds); - switch (compareType) - { - case CompareType.IsVisible: - return isVisible; - case CompareType.IsNotVisible: - return !isVisible; - } - throw new Exception(); - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/IsRenderedByCamera.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/IsRenderedByCamera.cs.meta deleted file mode 100644 index 9cfc1f2..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/IsRenderedByCamera.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 8d45a1674f5e2e04485eafef922fac41 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/StringComparer.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/StringComparer.cs deleted file mode 100644 index 398f3e9..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/StringComparer.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class StringComparer : ComparerBaseGeneric - { - public enum CompareType - { - Equal, - NotEqual, - Shorter, - Longer - } - - public CompareType compareType; - public StringComparison comparisonType = StringComparison.Ordinal; - public bool ignoreCase = false; - - protected override bool Compare(string a, string b) - { - if (ignoreCase) - { - a = a.ToLower(); - b = b.ToLower(); - } - switch (compareType) - { - case CompareType.Equal: - return String.Compare(a, b, comparisonType) == 0; - case CompareType.NotEqual: - return String.Compare(a, b, comparisonType) != 0; - case CompareType.Longer: - return String.Compare(a, b, comparisonType) > 0; - case CompareType.Shorter: - return String.Compare(a, b, comparisonType) < 0; - } - throw new Exception(); - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/StringComparer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/StringComparer.cs.meta deleted file mode 100644 index a414f61..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/StringComparer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 58783f051e477fd4e93b42ec7a43bb64 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/TransformComparer.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/TransformComparer.cs deleted file mode 100644 index 5221c03..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/TransformComparer.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class TransformComparer : ComparerBaseGeneric - { - public enum CompareType { Equals, NotEquals } - - public CompareType compareType; - - protected override bool Compare(Transform a, Transform b) - { - if (compareType == CompareType.Equals) - { - return a.position == b.position; - } - if (compareType == CompareType.NotEquals) - { - return a.position != b.position; - } - throw new Exception(); - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/TransformComparer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/TransformComparer.cs.meta deleted file mode 100644 index f3d72e4..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/TransformComparer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 927f2d7e4f63632448b2a63d480e601a -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/ValueDoesNotChange.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/ValueDoesNotChange.cs deleted file mode 100644 index 49a3cc7..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/ValueDoesNotChange.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class ValueDoesNotChange : ActionBase - { - private object m_Value; - - protected override bool Compare(object a) - { - if (m_Value == null) - m_Value = a; - if (!m_Value.Equals(a)) - return false; - return true; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/ValueDoesNotChange.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/ValueDoesNotChange.cs.meta deleted file mode 100644 index b913d35..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/ValueDoesNotChange.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9d6d16a58a17940419a1dcbff3c60ca5 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector2Comparer.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector2Comparer.cs deleted file mode 100644 index 345d76d..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector2Comparer.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class Vector2Comparer : VectorComparerBase - { - public enum CompareType - { - MagnitudeEquals, - MagnitudeNotEquals - } - - public CompareType compareType; - public float floatingPointError = 0.0001f; - - protected override bool Compare(Vector2 a, Vector2 b) - { - switch (compareType) - { - case CompareType.MagnitudeEquals: - return AreVectorMagnitudeEqual(a.magnitude, - b.magnitude, floatingPointError); - case CompareType.MagnitudeNotEquals: - return !AreVectorMagnitudeEqual(a.magnitude, - b.magnitude, floatingPointError); - } - throw new Exception(); - } - public override int GetDepthOfSearch() - { - return 3; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector2Comparer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector2Comparer.cs.meta deleted file mode 100644 index 19ef5d2..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector2Comparer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a713db190443e814f8254a5a59014ec4 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector3Comparer.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector3Comparer.cs deleted file mode 100644 index 56f0b5b..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector3Comparer.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class Vector3Comparer : VectorComparerBase - { - public enum CompareType - { - MagnitudeEquals, - MagnitudeNotEquals - } - - public CompareType compareType; - public double floatingPointError = 0.0001f; - - protected override bool Compare(Vector3 a, Vector3 b) - { - switch (compareType) - { - case CompareType.MagnitudeEquals: - return AreVectorMagnitudeEqual(a.magnitude, - b.magnitude, floatingPointError); - case CompareType.MagnitudeNotEquals: - return !AreVectorMagnitudeEqual(a.magnitude, - b.magnitude, floatingPointError); - } - throw new Exception(); - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector3Comparer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector3Comparer.cs.meta deleted file mode 100644 index b871f24..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector3Comparer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6febd2d5046657040b3da98b7010ee29 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector4Comparer.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector4Comparer.cs deleted file mode 100644 index 4eda043..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector4Comparer.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class Vector4Comparer : VectorComparerBase - { - public enum CompareType - { - MagnitudeEquals, - MagnitudeNotEquals - } - - public CompareType compareType; - public double floatingPointError; - - protected override bool Compare(Vector4 a, Vector4 b) - { - switch (compareType) - { - case CompareType.MagnitudeEquals: - return AreVectorMagnitudeEqual(a.magnitude, - b.magnitude, - floatingPointError); - case CompareType.MagnitudeNotEquals: - return !AreVectorMagnitudeEqual(a.magnitude, - b.magnitude, - floatingPointError); - } - throw new Exception(); - } - public override int GetDepthOfSearch() - { - return 3; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector4Comparer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector4Comparer.cs.meta deleted file mode 100644 index 1e0314f..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/Vector4Comparer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 383a85a79f164d04b8a56b0ff4e04cb7 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/VectorComparerBase.cs b/example_project/Assets/UnityTestTools/Assertions/Comparers/VectorComparerBase.cs deleted file mode 100644 index cb394df..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/VectorComparerBase.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public abstract class VectorComparerBase : ComparerBaseGeneric - { - protected bool AreVectorMagnitudeEqual(float a, float b, double floatingPointError) - { - if (Math.Abs(a) < floatingPointError && Math.Abs(b) < floatingPointError) - return true; - if (Math.Abs(a - b) < floatingPointError) - return true; - return false; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Comparers/VectorComparerBase.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Comparers/VectorComparerBase.cs.meta deleted file mode 100644 index d4da9f7..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Comparers/VectorComparerBase.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7b35a237804d5eb42bd8c4e67568ae24 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor.meta b/example_project/Assets/UnityTestTools/Assertions/Editor.meta deleted file mode 100644 index 2fa5238..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: a28bb39b4fb20514990895d9cb4eaea9 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs b/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs deleted file mode 100644 index a2736a7..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs +++ /dev/null @@ -1,226 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using UnityEditor; -using UnityEngine; -using UnityEditor.SceneManagement; - -namespace UnityTest -{ - [CustomEditor(typeof(AssertionComponent))] - public class AssertionComponentEditor : Editor - { - private readonly DropDownControl m_ComparerDropDown = new DropDownControl(); - - private readonly PropertyPathSelector m_ThisPathSelector = new PropertyPathSelector("Compare"); - private readonly PropertyPathSelector m_OtherPathSelector = new PropertyPathSelector("Compare to"); - - #region GUI Contents - private readonly GUIContent m_GUICheckAfterTimeGuiContent = new GUIContent("Check after (seconds)", "After how many seconds the assertion should be checked"); - private readonly GUIContent m_GUIRepeatCheckTimeGuiContent = new GUIContent("Repeat check", "Should the check be repeated."); - private readonly GUIContent m_GUIRepeatEveryTimeGuiContent = new GUIContent("Frequency of repetitions", "How often should the check be done"); - private readonly GUIContent m_GUICheckAfterFramesGuiContent = new GUIContent("Check after (frames)", "After how many frames the assertion should be checked"); - private readonly GUIContent m_GUIRepeatCheckFrameGuiContent = new GUIContent("Repeat check", "Should the check be repeated."); - #endregion - - private static List allComparersList = null; - - public AssertionComponentEditor() - { - m_ComparerDropDown.convertForButtonLabel = type => type.Name; - m_ComparerDropDown.convertForGUIContent = type => type.Name; - m_ComparerDropDown.ignoreConvertForGUIContent = types => false; - m_ComparerDropDown.tooltip = "Comparer that will be used to compare values and determine the result of assertion."; - } - - public override void OnInspectorGUI() - { - var script = (AssertionComponent)target; - EditorGUILayout.BeginHorizontal(); - var obj = DrawComparerSelection(script); - script.checkMethods = (CheckMethod)EditorGUILayout.EnumMaskField(script.checkMethods, - EditorStyles.popup, - GUILayout.ExpandWidth(false)); - EditorGUILayout.EndHorizontal(); - - if (script.IsCheckMethodSelected(CheckMethod.AfterPeriodOfTime)) - { - DrawOptionsForAfterPeriodOfTime(script); - } - - if (script.IsCheckMethodSelected(CheckMethod.Update)) - { - DrawOptionsForOnUpdate(script); - } - - if (obj) - { - EditorGUILayout.Space(); - - m_ThisPathSelector.Draw(script.Action.go, script.Action, - script.Action.thisPropertyPath, script.Action.GetAccepatbleTypesForA(), - go => - { - script.Action.go = go; - AssertionExplorerWindow.Reload(); - }, - s => - { - script.Action.thisPropertyPath = s; - AssertionExplorerWindow.Reload(); - }); - - EditorGUILayout.Space(); - - DrawCustomFields(script); - - EditorGUILayout.Space(); - - if (script.Action is ComparerBase) - { - DrawCompareToType(script.Action as ComparerBase); - } - } - if(GUI.changed) - EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); - } - - private void DrawOptionsForAfterPeriodOfTime(AssertionComponent script) - { - EditorGUILayout.Space(); - script.checkAfterTime = EditorGUILayout.FloatField(m_GUICheckAfterTimeGuiContent, - script.checkAfterTime); - if (script.checkAfterTime < 0) - script.checkAfterTime = 0; - script.repeatCheckTime = EditorGUILayout.Toggle(m_GUIRepeatCheckTimeGuiContent, - script.repeatCheckTime); - if (script.repeatCheckTime) - { - script.repeatEveryTime = EditorGUILayout.FloatField(m_GUIRepeatEveryTimeGuiContent, - script.repeatEveryTime); - if (script.repeatEveryTime < 0) - script.repeatEveryTime = 0; - } - } - - private void DrawOptionsForOnUpdate(AssertionComponent script) - { - EditorGUILayout.Space(); - script.checkAfterFrames = EditorGUILayout.IntField(m_GUICheckAfterFramesGuiContent, - script.checkAfterFrames); - if (script.checkAfterFrames < 1) - script.checkAfterFrames = 1; - script.repeatCheckFrame = EditorGUILayout.Toggle(m_GUIRepeatCheckFrameGuiContent, - script.repeatCheckFrame); - if (script.repeatCheckFrame) - { - script.repeatEveryFrame = EditorGUILayout.IntField(m_GUIRepeatEveryTimeGuiContent, - script.repeatEveryFrame); - if (script.repeatEveryFrame < 1) - script.repeatEveryFrame = 1; - } - } - - private void DrawCompareToType(ComparerBase comparer) - { - comparer.compareToType = (ComparerBase.CompareToType)EditorGUILayout.EnumPopup("Compare to type", - comparer.compareToType, - EditorStyles.popup); - - if (comparer.compareToType == ComparerBase.CompareToType.CompareToConstantValue) - { - try - { - DrawConstCompareField(comparer); - } - catch (NotImplementedException) - { - Debug.LogWarning("This comparer can't compare to static value"); - comparer.compareToType = ComparerBase.CompareToType.CompareToObject; - } - } - else if (comparer.compareToType == ComparerBase.CompareToType.CompareToObject) - { - DrawObjectCompareField(comparer); - } - } - - private void DrawObjectCompareField(ComparerBase comparer) - { - m_OtherPathSelector.Draw(comparer.other, comparer, - comparer.otherPropertyPath, comparer.GetAccepatbleTypesForB(), - go => - { - comparer.other = go; - AssertionExplorerWindow.Reload(); - }, - s => - { - comparer.otherPropertyPath = s; - AssertionExplorerWindow.Reload(); - } - ); - } - - private void DrawConstCompareField(ComparerBase comparer) - { - if (comparer.ConstValue == null) - { - comparer.ConstValue = comparer.GetDefaultConstValue(); - } - - var so = new SerializedObject(comparer); - var sp = so.FindProperty("constantValueGeneric"); - if (sp != null) - { - EditorGUILayout.PropertyField(sp, new GUIContent("Constant"), true); - so.ApplyModifiedProperties(); - } - } - - private bool DrawComparerSelection(AssertionComponent script) - { - if(allComparersList == null) - { - allComparersList = new List(); - var allAssemblies = AppDomain.CurrentDomain.GetAssemblies(); - foreach (var assembly in allAssemblies) - { - var types = assembly.GetTypes(); - allComparersList.AddRange(types.Where(type => type.IsSubclassOf(typeof(ActionBase)) && !type.IsAbstract)); - } - } - var allComparers = allComparersList.ToArray(); - - if (script.Action == null) - script.Action = (ActionBase)CreateInstance(allComparers.First()); - - m_ComparerDropDown.Draw(script.Action.GetType(), allComparers, - type => - { - if (script.Action == null || script.Action.GetType().Name != type.Name) - { - script.Action = (ActionBase)CreateInstance(type); - AssertionExplorerWindow.Reload(); - } - }); - - return script.Action != null; - } - - private void DrawCustomFields(AssertionComponent script) - { - foreach (var prop in script.Action.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)) - { - var so = new SerializedObject(script.Action); - var sp = so.FindProperty(prop.Name); - if (sp != null) - { - EditorGUILayout.PropertyField(sp, true); - so.ApplyModifiedProperties(); - } - } - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs.meta deleted file mode 100644 index eb4174d..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: fd1cabf2c45d0a8489635607a6048621 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionExplorerWindow.cs b/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionExplorerWindow.cs deleted file mode 100644 index ecd7fda..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionExplorerWindow.cs +++ /dev/null @@ -1,194 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEngine; - -#if UNITY_METRO -#warning Assertion component is not supported on Windows Store apps -#endif - -namespace UnityTest -{ - [Serializable] - public class AssertionExplorerWindow : EditorWindow - { - private List m_AllAssertions = new List(); - [SerializeField] - private string m_FilterText = ""; - [SerializeField] - private FilterType m_FilterType; - [SerializeField] - private List m_FoldMarkers = new List(); - [SerializeField] - private GroupByType m_GroupBy; - [SerializeField] - private Vector2 m_ScrollPosition = Vector2.zero; - private DateTime m_NextReload = DateTime.Now; - [SerializeField] - private static bool s_ShouldReload; - [SerializeField] - private ShowType m_ShowType; - - public AssertionExplorerWindow() - { - titleContent = new GUIContent("Assertion Explorer"); - } - - public void OnDidOpenScene() - { - ReloadAssertionList(); - } - - public void OnFocus() - { - ReloadAssertionList(); - } - - private void ReloadAssertionList() - { - m_NextReload = DateTime.Now.AddSeconds(1); - s_ShouldReload = true; - } - - public void OnHierarchyChange() - { - ReloadAssertionList(); - } - - public void OnInspectorUpdate() - { - if (s_ShouldReload && m_NextReload < DateTime.Now) - { - s_ShouldReload = false; - m_AllAssertions = new List((AssertionComponent[])Resources.FindObjectsOfTypeAll(typeof(AssertionComponent))); - Repaint(); - } - } - - public void OnGUI() - { - DrawMenuPanel(); - - m_ScrollPosition = EditorGUILayout.BeginScrollView(m_ScrollPosition); - if (m_AllAssertions != null) - GetResultRendere().Render(FilterResults(m_AllAssertions, m_FilterText.ToLower()), m_FoldMarkers); - EditorGUILayout.EndScrollView(); - } - - private IEnumerable FilterResults(List assertionComponents, string text) - { - if (m_ShowType == ShowType.ShowDisabled) - assertionComponents = assertionComponents.Where(c => !c.enabled).ToList(); - else if (m_ShowType == ShowType.ShowEnabled) - assertionComponents = assertionComponents.Where(c => c.enabled).ToList(); - - if (string.IsNullOrEmpty(text)) - return assertionComponents; - - switch (m_FilterType) - { - case FilterType.ComparerName: - return assertionComponents.Where(c => c.Action.GetType().Name.ToLower().Contains(text)); - case FilterType.AttachedGameObject: - return assertionComponents.Where(c => c.gameObject.name.ToLower().Contains(text)); - case FilterType.FirstComparedGameObjectPath: - return assertionComponents.Where(c => c.Action.thisPropertyPath.ToLower().Contains(text)); - case FilterType.FirstComparedGameObject: - return assertionComponents.Where(c => c.Action.go != null - && c.Action.go.name.ToLower().Contains(text)); - case FilterType.SecondComparedGameObjectPath: - return assertionComponents.Where(c => - c.Action is ComparerBase - && (c.Action as ComparerBase).otherPropertyPath.ToLower().Contains(text)); - case FilterType.SecondComparedGameObject: - return assertionComponents.Where(c => - c.Action is ComparerBase - && (c.Action as ComparerBase).other != null - && (c.Action as ComparerBase).other.name.ToLower().Contains(text)); - default: - return assertionComponents; - } - } - - private readonly IListRenderer m_GroupByComparerRenderer = new GroupByComparerRenderer(); - private readonly IListRenderer m_GroupByExecutionMethodRenderer = new GroupByExecutionMethodRenderer(); - private readonly IListRenderer m_GroupByGoRenderer = new GroupByGoRenderer(); - private readonly IListRenderer m_GroupByTestsRenderer = new GroupByTestsRenderer(); - private readonly IListRenderer m_GroupByNothingRenderer = new GroupByNothingRenderer(); - - private IListRenderer GetResultRendere() - { - switch (m_GroupBy) - { - case GroupByType.Comparer: - return m_GroupByComparerRenderer; - case GroupByType.ExecutionMethod: - return m_GroupByExecutionMethodRenderer; - case GroupByType.GameObjects: - return m_GroupByGoRenderer; - case GroupByType.Tests: - return m_GroupByTestsRenderer; - default: - return m_GroupByNothingRenderer; - } - } - - private void DrawMenuPanel() - { - EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); - EditorGUILayout.LabelField("Group by:", Styles.toolbarLabel, GUILayout.MaxWidth(60)); - m_GroupBy = (GroupByType)EditorGUILayout.EnumPopup(m_GroupBy, EditorStyles.toolbarPopup, GUILayout.MaxWidth(150)); - - GUILayout.FlexibleSpace(); - - m_ShowType = (ShowType)EditorGUILayout.EnumPopup(m_ShowType, EditorStyles.toolbarPopup, GUILayout.MaxWidth(100)); - - EditorGUILayout.LabelField("Filter by:", Styles.toolbarLabel, GUILayout.MaxWidth(50)); - m_FilterType = (FilterType)EditorGUILayout.EnumPopup(m_FilterType, EditorStyles.toolbarPopup, GUILayout.MaxWidth(100)); - m_FilterText = GUILayout.TextField(m_FilterText, "ToolbarSeachTextField", GUILayout.MaxWidth(100)); - if (GUILayout.Button(GUIContent.none, string.IsNullOrEmpty(m_FilterText) ? "ToolbarSeachCancelButtonEmpty" : "ToolbarSeachCancelButton", GUILayout.ExpandWidth(false))) - m_FilterText = ""; - EditorGUILayout.EndHorizontal(); - } - - [MenuItem("Unity Test Tools/Assertion Explorer")] - public static AssertionExplorerWindow ShowWindow() - { - var w = GetWindow(typeof(AssertionExplorerWindow)); - w.Show(); - return w as AssertionExplorerWindow; - } - - private enum FilterType - { - ComparerName, - FirstComparedGameObject, - FirstComparedGameObjectPath, - SecondComparedGameObject, - SecondComparedGameObjectPath, - AttachedGameObject - } - - private enum ShowType - { - ShowAll, - ShowEnabled, - ShowDisabled - } - - private enum GroupByType - { - Nothing, - Comparer, - GameObjects, - ExecutionMethod, - Tests - } - - public static void Reload() - { - s_ShouldReload = true; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionExplorerWindow.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionExplorerWindow.cs.meta deleted file mode 100644 index f5591ab..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionExplorerWindow.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1a1e855053e7e2f46ace1dc93f2036f2 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionListRenderer.cs b/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionListRenderer.cs deleted file mode 100644 index 31e1b1e..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionListRenderer.cs +++ /dev/null @@ -1,251 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEngine; - -namespace UnityTest -{ - public interface IListRenderer - { - void Render(IEnumerable allAssertions, List foldMarkers); - } - - public abstract class AssertionListRenderer : IListRenderer - { - private static class Styles - { - public static readonly GUIStyle redLabel; - static Styles() - { - redLabel = new GUIStyle(EditorStyles.label); - redLabel.normal.textColor = Color.red; - } - } - - public void Render(IEnumerable allAssertions, List foldMarkers) - { - foreach (var grouping in GroupResult(allAssertions)) - { - var key = GetStringKey(grouping.Key); - bool isFolded = foldMarkers.Contains(key); - if (key != "") - { - EditorGUILayout.BeginHorizontal(); - - EditorGUI.BeginChangeCheck(); - isFolded = PrintFoldout(isFolded, - grouping.Key); - if (EditorGUI.EndChangeCheck()) - { - if (isFolded) - foldMarkers.Add(key); - else - foldMarkers.Remove(key); - } - EditorGUILayout.EndHorizontal(); - if (isFolded) - continue; - } - foreach (var assertionComponent in grouping) - { - EditorGUILayout.BeginVertical(); - EditorGUILayout.BeginHorizontal(); - - if (key != "") - GUILayout.Space(15); - - var assertionKey = assertionComponent.GetHashCode().ToString(); - bool isDetailsFolded = foldMarkers.Contains(assertionKey); - - EditorGUI.BeginChangeCheck(); - if (GUILayout.Button("", - EditorStyles.foldout, - GUILayout.Width(15))) - { - isDetailsFolded = !isDetailsFolded; - } - if (EditorGUI.EndChangeCheck()) - { - if (isDetailsFolded) - foldMarkers.Add(assertionKey); - else - foldMarkers.Remove(assertionKey); - } - PrintFoldedAssertionLine(assertionComponent); - EditorGUILayout.EndHorizontal(); - - if (isDetailsFolded) - { - EditorGUILayout.BeginHorizontal(); - if (key != "") - GUILayout.Space(15); - PrintAssertionLineDetails(assertionComponent); - EditorGUILayout.EndHorizontal(); - } - GUILayout.Box("", new[] {GUILayout.ExpandWidth(true), GUILayout.Height(1)}); - - EditorGUILayout.EndVertical(); - } - } - } - - protected abstract IEnumerable> GroupResult(IEnumerable assertionComponents); - - protected virtual string GetStringKey(T key) - { - return key.GetHashCode().ToString(); - } - - protected virtual bool PrintFoldout(bool isFolded, T key) - { - var content = new GUIContent(GetFoldoutDisplayName(key)); - var size = EditorStyles.foldout.CalcSize(content); - - var rect = GUILayoutUtility.GetRect(content, - EditorStyles.foldout, - GUILayout.MaxWidth(size.x)); - var res = EditorGUI.Foldout(rect, - !isFolded, - content, - true); - - return !res; - } - - protected virtual string GetFoldoutDisplayName(T key) - { - return key.ToString(); - } - - protected virtual void PrintFoldedAssertionLine(AssertionComponent assertionComponent) - { - EditorGUILayout.BeginHorizontal(); - - EditorGUILayout.BeginVertical(GUILayout.MaxWidth(300)); - EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(300)); - PrintPath(assertionComponent.Action.go, - assertionComponent.Action.thisPropertyPath); - EditorGUILayout.EndHorizontal(); - EditorGUILayout.EndVertical(); - - EditorGUILayout.BeginVertical(GUILayout.MaxWidth(250)); - var labelStr = assertionComponent.Action.GetType().Name; - var labelStr2 = assertionComponent.Action.GetConfigurationDescription(); - if (labelStr2 != "") - labelStr += "( " + labelStr2 + ")"; - EditorGUILayout.LabelField(labelStr); - EditorGUILayout.EndVertical(); - - if (assertionComponent.Action is ComparerBase) - { - var comparer = assertionComponent.Action as ComparerBase; - - var otherStrVal = "(no value selected)"; - EditorGUILayout.BeginVertical(); - EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(300)); - switch (comparer.compareToType) - { - case ComparerBase.CompareToType.CompareToObject: - if (comparer.other != null) - { - PrintPath(comparer.other, - comparer.otherPropertyPath); - } - else - { - EditorGUILayout.LabelField(otherStrVal, - Styles.redLabel); - } - break; - case ComparerBase.CompareToType.CompareToConstantValue: - otherStrVal = comparer.ConstValue.ToString(); - EditorGUILayout.LabelField(otherStrVal); - break; - case ComparerBase.CompareToType.CompareToNull: - otherStrVal = "null"; - EditorGUILayout.LabelField(otherStrVal); - break; - } - EditorGUILayout.EndHorizontal(); - EditorGUILayout.EndVertical(); - } - else - { - EditorGUILayout.LabelField(""); - } - EditorGUILayout.EndHorizontal(); - EditorGUILayout.Space(); - } - - protected virtual void PrintAssertionLineDetails(AssertionComponent assertionComponent) - { - EditorGUILayout.BeginHorizontal(); - - - EditorGUILayout.BeginVertical(GUILayout.MaxWidth(320)); - EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("Attached to", - GUILayout.Width(70)); - var sss = EditorStyles.objectField.CalcSize(new GUIContent(assertionComponent.gameObject.name)); - EditorGUILayout.ObjectField(assertionComponent.gameObject, - typeof(GameObject), - true, - GUILayout.Width(sss.x)); - EditorGUILayout.EndHorizontal(); - EditorGUILayout.EndVertical(); - - - EditorGUILayout.BeginVertical(GUILayout.MaxWidth(250)); - EditorGUILayout.EnumMaskField(assertionComponent.checkMethods, - EditorStyles.popup, - GUILayout.MaxWidth(150)); - EditorGUILayout.EndVertical(); - - - EditorGUILayout.BeginVertical(); - EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("Disabled", - GUILayout.Width(55)); - assertionComponent.enabled = !EditorGUILayout.Toggle(!assertionComponent.enabled, - GUILayout.Width(15)); - EditorGUILayout.EndHorizontal(); - EditorGUILayout.EndVertical(); - - EditorGUILayout.EndHorizontal(); - } - - private void PrintPath(GameObject go, string propertyPath) - { - string contentString = ""; - GUIStyle styleThisPath = EditorStyles.label; - if (go != null) - { - var sss = EditorStyles.objectField.CalcSize(new GUIContent(go.name)); - EditorGUILayout.ObjectField( - go, - typeof(GameObject), - true, - GUILayout.Width(sss.x)); - - if (!string.IsNullOrEmpty(propertyPath)) - contentString = "." + propertyPath; - } - else - { - contentString = "(no value selected)"; - styleThisPath = Styles.redLabel; - } - - var content = new GUIContent(contentString, - contentString); - var rect = GUILayoutUtility.GetRect(content, - EditorStyles.label, - GUILayout.MaxWidth(200)); - - EditorGUI.LabelField(rect, - content, - styleThisPath); - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionListRenderer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionListRenderer.cs.meta deleted file mode 100644 index 8e6a0d4..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionListRenderer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d83c02fb0f220344da42a8213ed36cb5 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionStripper.cs b/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionStripper.cs deleted file mode 100644 index 1b6bd04..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionStripper.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEditor.Callbacks; -using UnityEngine; -using UnityTest; -using Object = UnityEngine.Object; - -public class AssertionStripper -{ - [PostProcessScene] - public static void OnPostprocessScene() - { - if (Debug.isDebugBuild) return; - RemoveAssertionsFromGameObjects(); - } - - private static void RemoveAssertionsFromGameObjects() - { - var allAssertions = Resources.FindObjectsOfTypeAll(typeof(AssertionComponent)) as AssertionComponent[]; - foreach (var assertion in allAssertions) - { - Object.DestroyImmediate(assertion); - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionStripper.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionStripper.cs.meta deleted file mode 100644 index bf18bbe..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/AssertionStripper.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 95c9cd9570a6fba4198b6e4f15e11e5e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/DropDownControl.cs b/example_project/Assets/UnityTestTools/Assertions/Editor/DropDownControl.cs deleted file mode 100644 index 79804f9..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/DropDownControl.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEditor; -using UnityEngine; - -namespace UnityTest -{ - [Serializable] - internal class DropDownControl - { - private readonly GUILayoutOption[] m_ButtonLayoutOptions = { GUILayout.ExpandWidth(true) }; - public Func convertForButtonLabel = s => s.ToString(); - public Func convertForGUIContent = s => s.ToString(); - public Func ignoreConvertForGUIContent = t => t.Length <= 40; - public Action printContextMenu = null; - public string tooltip = ""; - - private object m_SelectedValue; - - - public void Draw(T selected, T[] options, Action onValueSelected) - { - Draw(null, - selected, - options, - onValueSelected); - } - - public void Draw(string label, T selected, T[] options, Action onValueSelected) - { - Draw(label, selected, () => options, onValueSelected); - } - - public void Draw(string label, T selected, Func loadOptions, Action onValueSelected) - { - if (!string.IsNullOrEmpty(label)) - EditorGUILayout.BeginHorizontal(); - var guiContent = new GUIContent(label); - var labelSize = EditorStyles.label.CalcSize(guiContent); - - if (!string.IsNullOrEmpty(label)) - GUILayout.Label(label, EditorStyles.label, GUILayout.Width(labelSize.x)); - - if (GUILayout.Button(new GUIContent(convertForButtonLabel(selected), tooltip), - EditorStyles.popup, m_ButtonLayoutOptions)) - { - if (Event.current.button == 0) - { - PrintMenu(loadOptions()); - } - else if (printContextMenu != null && Event.current.button == 1) - printContextMenu(selected); - } - - if (m_SelectedValue != null) - { - onValueSelected((T)m_SelectedValue); - m_SelectedValue = null; - } - if (!string.IsNullOrEmpty(label)) - EditorGUILayout.EndHorizontal(); - } - - public void PrintMenu(T[] options) - { - var menu = new GenericMenu(); - foreach (var s in options) - { - var localS = s; - menu.AddItem(new GUIContent((ignoreConvertForGUIContent(options) ? localS.ToString() : convertForGUIContent(localS))), - false, - () => { m_SelectedValue = localS; } - ); - } - menu.ShowAsContext(); - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/DropDownControl.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Editor/DropDownControl.cs.meta deleted file mode 100644 index 424d243..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/DropDownControl.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 83ec3ed09f8f2f34ea7483e055f6d76d -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByComparerRenderer.cs b/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByComparerRenderer.cs deleted file mode 100644 index 6d7875b..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByComparerRenderer.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace UnityTest -{ - public class GroupByComparerRenderer : AssertionListRenderer - { - protected override IEnumerable> GroupResult(IEnumerable assertionComponents) - { - return assertionComponents.GroupBy(c => c.Action.GetType()); - } - - protected override string GetStringKey(Type key) - { - return key.Name; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByComparerRenderer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByComparerRenderer.cs.meta deleted file mode 100644 index e917399..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByComparerRenderer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: efab536803bd0154a8a7dc78e8767ad9 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByExecutionMethodRenderer.cs b/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByExecutionMethodRenderer.cs deleted file mode 100644 index b4b6d3f..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByExecutionMethodRenderer.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace UnityTest -{ - public class GroupByExecutionMethodRenderer : AssertionListRenderer - { - protected override IEnumerable> GroupResult(IEnumerable assertionComponents) - { - var enumVals = Enum.GetValues(typeof(CheckMethod)).Cast(); - var pairs = new List(); - - foreach (var checkMethod in enumVals) - { - var components = assertionComponents.Where(c => (c.checkMethods & checkMethod) == checkMethod); - var componentPairs = components.Select(a => new CheckFunctionAssertionPair {checkMethod = checkMethod, assertionComponent = a}); - pairs.AddRange(componentPairs); - } - return pairs.GroupBy(pair => pair.checkMethod, - pair => pair.assertionComponent); - } - - private class CheckFunctionAssertionPair - { - public AssertionComponent assertionComponent; - public CheckMethod checkMethod; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByExecutionMethodRenderer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByExecutionMethodRenderer.cs.meta deleted file mode 100644 index e542ae1..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByExecutionMethodRenderer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 97340abf816b1424fa835a4f26bbdc78 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByGORenderer.cs b/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByGORenderer.cs deleted file mode 100644 index 6d76ca5..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByGORenderer.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEngine; - -namespace UnityTest -{ - public class GroupByGoRenderer : AssertionListRenderer - { - protected override IEnumerable> GroupResult(IEnumerable assertionComponents) - { - return assertionComponents.GroupBy(c => c.gameObject); - } - - protected override bool PrintFoldout(bool isFolded, GameObject key) - { - isFolded = base.PrintFoldout(isFolded, - key); - - EditorGUILayout.ObjectField(key, - typeof(GameObject), - true, - GUILayout.ExpandWidth(false)); - - return isFolded; - } - - protected override string GetFoldoutDisplayName(GameObject key) - { - return key.name; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByGORenderer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByGORenderer.cs.meta deleted file mode 100644 index a11d1dc..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByGORenderer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: cb824de9146b42343a985aaf63beffd1 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByNothingRenderer.cs b/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByNothingRenderer.cs deleted file mode 100644 index db5d824..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByNothingRenderer.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace UnityTest -{ - public class GroupByNothingRenderer : AssertionListRenderer - { - protected override IEnumerable> GroupResult(IEnumerable assertionComponents) - { - return assertionComponents.GroupBy(c => ""); - } - - protected override string GetStringKey(string key) - { - return ""; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByNothingRenderer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByNothingRenderer.cs.meta deleted file mode 100644 index f7d9d2a..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByNothingRenderer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 33bf96aa461ea1d478bb757c52f51c95 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByTestsRenderer.cs b/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByTestsRenderer.cs deleted file mode 100644 index a126a51..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByTestsRenderer.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace UnityTest -{ - public class GroupByTestsRenderer : AssertionListRenderer - { - protected override IEnumerable> GroupResult(IEnumerable assertionComponents) - { - return assertionComponents.GroupBy(c => - { - var temp = c.transform; - while (temp != null) - { - if (temp.GetComponent("TestComponent") != null) return c.gameObject; - temp = temp.parent.transform; - } - return null; - }); - } - - protected override string GetFoldoutDisplayName(GameObject key) - { - return key.name; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByTestsRenderer.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByTestsRenderer.cs.meta deleted file mode 100644 index cbc3124..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/GroupByTestsRenderer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5e577f31e55208b4d8a1774b958e6ed5 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/PropertyPathSelector.cs b/example_project/Assets/UnityTestTools/Assertions/Editor/PropertyPathSelector.cs deleted file mode 100644 index 3bf3911..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/PropertyPathSelector.cs +++ /dev/null @@ -1,207 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using UnityEditor; -using UnityEngine; - -namespace UnityTest -{ - public class PropertyPathSelector - { - private readonly DropDownControl m_ThisDropDown = new DropDownControl(); - private readonly Func m_ReplaceDotWithSlashAndAddGoGroup = s => s.Replace('.', '/'); - - private readonly string m_Name; - private bool m_FocusBackToEdit; - private SelectedPathError m_Error; - - public PropertyPathSelector(string name) - { - m_Name = name; - m_ThisDropDown.convertForGUIContent = m_ReplaceDotWithSlashAndAddGoGroup; - m_ThisDropDown.tooltip = "Select the path to the value you want to use for comparison."; - } - - public void Draw(GameObject go, ActionBase comparer, string propertPath, Type[] accepatbleTypes, Action onSelectedGo, Action onSelectedPath) - { - var newGo = (GameObject)EditorGUILayout.ObjectField(m_Name, go, typeof(GameObject), true); - if (newGo != go) - onSelectedGo(newGo); - - if (go != null) - { - var newPath = DrawListOfMethods(go, comparer, propertPath, accepatbleTypes, m_ThisDropDown); - - if (newPath != propertPath) - onSelectedPath(newPath); - } - } - - private string DrawListOfMethods(GameObject go, ActionBase comparer, string propertPath, Type[] accepatbleTypes, DropDownControl dropDown) - { - string result = propertPath; - if (accepatbleTypes == null) - { - result = DrawManualPropertyEditField(go, propertPath, accepatbleTypes, dropDown); - } - else - { - bool isPropertyOrFieldFound = true; - if (string.IsNullOrEmpty(result)) - { - var options = GetFieldsAndProperties(go, comparer, result, accepatbleTypes); - isPropertyOrFieldFound = options.Any(); - if (isPropertyOrFieldFound) - { - result = options.First(); - } - } - - if (isPropertyOrFieldFound) - { - dropDown.Draw(go.name + '.', result, - () => - { - try - { - var options = GetFieldsAndProperties(go, comparer, result, accepatbleTypes); - return options.ToArray(); - } - catch (Exception) - { - Debug.LogWarning("An exception was thrown while resolving a property list. Resetting property path."); - result = ""; - return new string[0]; - } - }, s => result = s); - } - else - { - result = DrawManualPropertyEditField(go, propertPath, accepatbleTypes, dropDown); - } - } - return result; - } - - private static List GetFieldsAndProperties(GameObject go, ActionBase comparer, string extendPath, Type[] accepatbleTypes) - { - var propertyResolver = new PropertyResolver {AllowedTypes = accepatbleTypes, ExcludedFieldNames = comparer.GetExcludedFieldNames()}; - var options = propertyResolver.GetFieldsAndPropertiesFromGameObject(go, comparer.GetDepthOfSearch(), extendPath).ToList(); - options.Sort((x, y) => - { - if (char.IsLower(x[0])) - return -1; - if (char.IsLower(y[0])) - return 1; - return x.CompareTo(y); - }); - return options; - } - - private string DrawManualPropertyEditField(GameObject go, string propertPath, Type[] acceptableTypes, DropDownControl dropDown) - { - var propertyResolver = new PropertyResolver { AllowedTypes = acceptableTypes }; - IList list; - - var loadProps = new Func(() => - { - try - { - list = propertyResolver.GetFieldsAndPropertiesUnderPath(go, propertPath); - } - catch (ArgumentException) - { - list = propertyResolver.GetFieldsAndPropertiesUnderPath(go, ""); - } - return list.ToArray(); - }); - - EditorGUILayout.BeginHorizontal(); - - var labelSize = EditorStyles.label.CalcSize(new GUIContent(go.name + '.')); - GUILayout.Label(go.name + (propertPath.Length > 0 ? "." : ""), EditorStyles.label, GUILayout.Width(labelSize.x)); - - string btnName = "hintBtn"; - if (GUI.GetNameOfFocusedControl() == btnName - && Event.current.type == EventType.KeyDown - && Event.current.keyCode == KeyCode.DownArrow) - { - Event.current.Use(); - dropDown.PrintMenu(loadProps()); - GUI.FocusControl(""); - m_FocusBackToEdit = true; - } - - EditorGUI.BeginChangeCheck(); - GUI.SetNextControlName(btnName); - var result = GUILayout.TextField(propertPath, EditorStyles.textField); - if (EditorGUI.EndChangeCheck()) - { - m_Error = DoesPropertyExist(go, result); - } - - if (m_FocusBackToEdit) - { - m_FocusBackToEdit = false; - GUI.FocusControl(btnName); - } - - if (GUILayout.Button("Clear", EditorStyles.miniButton, GUILayout.Width(38))) - { - result = ""; - GUI.FocusControl(null); - m_FocusBackToEdit = true; - m_Error = DoesPropertyExist(go, result); - } - EditorGUILayout.EndHorizontal(); - EditorGUILayout.BeginHorizontal(); - GUILayout.Label("", GUILayout.Width(labelSize.x)); - - dropDown.Draw("", result ?? "", loadProps, s => - { - result = s; - GUI.FocusControl(null); - m_FocusBackToEdit = true; - m_Error = DoesPropertyExist(go, result); - }); - EditorGUILayout.EndHorizontal(); - - switch (m_Error) - { - case SelectedPathError.InvalidPath: - EditorGUILayout.HelpBox("This property does not exist", MessageType.Error); - break; - case SelectedPathError.MissingComponent: - EditorGUILayout.HelpBox("This property or field is not attached or set. It will fail unless it will be attached before the check is perfomed.", MessageType.Warning); - break; - } - - return result; - } - - private SelectedPathError DoesPropertyExist(GameObject go, string propertPath) - { - try - { - object obj; - if (MemberResolver.TryGetValue(go, propertPath, out obj)) - return SelectedPathError.None; - return SelectedPathError.InvalidPath; - } - catch (TargetInvocationException e) - { - if (e.InnerException is MissingComponentException) - return SelectedPathError.MissingComponent; - throw; - } - } - - private enum SelectedPathError - { - None, - MissingComponent, - InvalidPath - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/PropertyPathSelector.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Editor/PropertyPathSelector.cs.meta deleted file mode 100644 index b1998a8..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/PropertyPathSelector.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6619da1897737044080bdb8bc60eff87 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/PropertyResolver.cs b/example_project/Assets/UnityTestTools/Assertions/Editor/PropertyResolver.cs deleted file mode 100644 index 5d705da..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/PropertyResolver.cs +++ /dev/null @@ -1,188 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text.RegularExpressions; -using UnityEngine; - -namespace UnityTest -{ - [Serializable] - public class PropertyResolver - { - public string[] ExcludedFieldNames { get; set; } - public Type[] ExcludedTypes { get; set; } - public Type[] AllowedTypes { get; set; } - - public PropertyResolver() - { - ExcludedFieldNames = new string[] { }; - ExcludedTypes = new Type[] { }; - AllowedTypes = new Type[] { }; - } - - public IList GetFieldsAndPropertiesUnderPath(GameObject go, string propertPath) - { - propertPath = propertPath.Trim(); - if (!PropertyPathIsValid(propertPath)) - { - throw new ArgumentException("Incorrect property path: " + propertPath); - } - - var idx = propertPath.LastIndexOf('.'); - - if (idx < 0) - { - var components = GetFieldsAndPropertiesFromGameObject(go, 2, null); - return components; - } - - var propertyToSearch = propertPath; - Type type; - if (MemberResolver.TryGetMemberType(go, propertyToSearch, out type)) - { - idx = propertPath.Length - 1; - } - else - { - propertyToSearch = propertPath.Substring(0, idx); - if (!MemberResolver.TryGetMemberType(go, propertyToSearch, out type)) - { - var components = GetFieldsAndPropertiesFromGameObject(go, 2, null); - return components.Where(s => s.StartsWith(propertPath.Substring(idx + 1))).ToArray(); - } - } - - var resultList = new List(); - var path = ""; - if (propertyToSearch.EndsWith(".")) - propertyToSearch = propertyToSearch.Substring(0, propertyToSearch.Length - 1); - foreach (var c in propertyToSearch) - { - if (c == '.') - resultList.Add(path); - path += c; - } - resultList.Add(path); - foreach (var prop in type.GetProperties().Where(info => info.GetIndexParameters().Length == 0)) - { - if (prop.Name.StartsWith(propertPath.Substring(idx + 1))) - resultList.Add(propertyToSearch + "." + prop.Name); - } - foreach (var prop in type.GetFields()) - { - if (prop.Name.StartsWith(propertPath.Substring(idx + 1))) - resultList.Add(propertyToSearch + "." + prop.Name); - } - return resultList.ToArray(); - } - - internal bool PropertyPathIsValid(string propertPath) - { - if (propertPath.StartsWith(".")) - return false; - if (propertPath.IndexOf("..") >= 0) - return false; - if (Regex.IsMatch(propertPath, @"\s")) - return false; - return true; - } - - public IList GetFieldsAndPropertiesFromGameObject(GameObject gameObject, int depthOfSearch, string extendPath) - { - if (depthOfSearch < 1) throw new ArgumentOutOfRangeException("depthOfSearch has to be greater than 0"); - - var goVals = GetPropertiesAndFieldsFromType(typeof(GameObject), - depthOfSearch - 1).Select(s => "gameObject." + s); - - var result = new List(); - if (AllowedTypes == null || !AllowedTypes.Any() || AllowedTypes.Contains(typeof(GameObject))) - result.Add("gameObject"); - result.AddRange(goVals); - - foreach (var componentType in GetAllComponents(gameObject)) - { - if (AllowedTypes == null || !AllowedTypes.Any() || AllowedTypes.Any(t => t.IsAssignableFrom(componentType))) - result.Add(componentType.Name); - - if (depthOfSearch > 1) - { - var vals = GetPropertiesAndFieldsFromType(componentType, depthOfSearch - 1); - var valsFullName = vals.Select(s => componentType.Name + "." + s); - result.AddRange(valsFullName); - } - } - - if (!string.IsNullOrEmpty(extendPath)) - { - var memberResolver = new MemberResolver(gameObject, extendPath); - var pathType = memberResolver.GetMemberType(); - var vals = GetPropertiesAndFieldsFromType(pathType, depthOfSearch - 1); - var valsFullName = vals.Select(s => extendPath + "." + s); - result.AddRange(valsFullName); - } - - return result; - } - - private string[] GetPropertiesAndFieldsFromType(Type type, int level) - { - level--; - - var result = new List(); - var fields = new List(); - fields.AddRange(type.GetFields().Where(f => !Attribute.IsDefined(f, typeof(ObsoleteAttribute))).ToArray()); - fields.AddRange(type.GetProperties().Where(info => info.GetIndexParameters().Length == 0 && !Attribute.IsDefined(info, typeof(ObsoleteAttribute))).ToArray()); - - foreach (var member in fields) - { - var memberType = GetMemberFieldType(member); - var memberTypeName = memberType.Name; - - if (AllowedTypes == null - || !AllowedTypes.Any() - || (AllowedTypes.Any(t => t.IsAssignableFrom(memberType)) && !ExcludedFieldNames.Contains(memberTypeName))) - { - result.Add(member.Name); - } - - if (level > 0 && IsTypeOrNameNotExcluded(memberType, memberTypeName)) - { - var vals = GetPropertiesAndFieldsFromType(memberType, level); - var valsFullName = vals.Select(s => member.Name + "." + s); - result.AddRange(valsFullName); - } - } - return result.ToArray(); - } - - private Type GetMemberFieldType(MemberInfo info) - { - if (info.MemberType == MemberTypes.Property) - return (info as PropertyInfo).PropertyType; - if (info.MemberType == MemberTypes.Field) - return (info as FieldInfo).FieldType; - throw new Exception("Only properties and fields are allowed"); - } - - internal Type[] GetAllComponents(GameObject gameObject) - { - var result = new List(); - var components = gameObject.GetComponents(typeof(Component)); - foreach (var component in components) - { - var componentType = component.GetType(); - if (IsTypeOrNameNotExcluded(componentType, null)) - { - result.Add(componentType); - } - } - return result.ToArray(); - } - - private bool IsTypeOrNameNotExcluded(Type memberType, string memberTypeName) - { - return !ExcludedTypes.Contains(memberType) && !ExcludedFieldNames.Contains(memberTypeName); - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/Editor/PropertyResolver.cs.meta b/example_project/Assets/UnityTestTools/Assertions/Editor/PropertyResolver.cs.meta deleted file mode 100644 index 22210c7..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/Editor/PropertyResolver.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: bbbd193a27920d9478c2a766a7291d72 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/InvalidPathException.cs b/example_project/Assets/UnityTestTools/Assertions/InvalidPathException.cs deleted file mode 100644 index 9ddde07..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/InvalidPathException.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class InvalidPathException : Exception - { - public InvalidPathException(string path) - : base("Invalid path part " + path) - { - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/InvalidPathException.cs.meta b/example_project/Assets/UnityTestTools/Assertions/InvalidPathException.cs.meta deleted file mode 100644 index a5f882d..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/InvalidPathException.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 3b85786dfd1aef544bf8bb873d6a4ebb -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Assertions/MemberResolver.cs b/example_project/Assets/UnityTestTools/Assertions/MemberResolver.cs deleted file mode 100644 index 65f7351..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/MemberResolver.cs +++ /dev/null @@ -1,208 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Text.RegularExpressions; -using UnityEngine; - -namespace UnityTest -{ - public class MemberResolver - { - private object m_CallingObjectRef; - private MemberInfo[] m_Callstack; - private readonly GameObject m_GameObject; - private readonly string m_Path; - - public MemberResolver(GameObject gameObject, string path) - { - path = path.Trim(); - ValidatePath(path); - - m_GameObject = gameObject; - m_Path = path.Trim(); - } - - public object GetValue(bool useCache) - { - if (useCache && m_CallingObjectRef != null) - { - object val = m_CallingObjectRef; - for (int i = 0; i < m_Callstack.Length; i++) - val = GetValueFromMember(val, m_Callstack[i]); - return val; - } - - object result = GetBaseObject(); - var fullCallStack = GetCallstack(); - - m_CallingObjectRef = result; - var tempCallstack = new List(); - for (int i = 0; i < fullCallStack.Length; i++) - { - var member = fullCallStack[i]; - result = GetValueFromMember(result, member); - tempCallstack.Add(member); - if (result == null) return null; - var type = result.GetType(); - - //String is not a value type but we don't want to cache it - if (!IsValueType(type) && type != typeof(System.String)) - { - tempCallstack.Clear(); - m_CallingObjectRef = result; - } - } - m_Callstack = tempCallstack.ToArray(); - return result; - } - - public Type GetMemberType() - { - var callstack = GetCallstack(); - if (callstack.Length == 0) return GetBaseObject().GetType(); - - var member = callstack[callstack.Length - 1]; - if (member is FieldInfo) - return (member as FieldInfo).FieldType; - if (member is MethodInfo) - return (member as MethodInfo).ReturnType; - return null; - } - - #region Static wrappers - public static bool TryGetMemberType(GameObject gameObject, string path, out Type value) - { - try - { - var mr = new MemberResolver(gameObject, path); - value = mr.GetMemberType(); - return true; - } - catch (InvalidPathException) - { - value = null; - return false; - } - } - - public static bool TryGetValue(GameObject gameObject, string path, out object value) - { - try - { - var mr = new MemberResolver(gameObject, path); - value = mr.GetValue(false); - return true; - } - catch (InvalidPathException) - { - value = null; - return false; - } - } - #endregion - - private object GetValueFromMember(object obj, MemberInfo memberInfo) - { - if (memberInfo is FieldInfo) - return (memberInfo as FieldInfo).GetValue(obj); - if (memberInfo is MethodInfo) - return (memberInfo as MethodInfo).Invoke(obj, null); - throw new InvalidPathException(memberInfo.Name); - } - - private object GetBaseObject() - { - if (string.IsNullOrEmpty(m_Path)) return m_GameObject; - var firstElement = m_Path.Split('.')[0]; - var comp = m_GameObject.GetComponent(firstElement); - if (comp != null) - return comp; - return m_GameObject; - } - - private MemberInfo[] GetCallstack() - { - if (m_Path == "") return new MemberInfo[0]; - var propsQueue = new Queue(m_Path.Split('.')); - - Type type = GetBaseObject().GetType(); - if (type != typeof(GameObject)) - propsQueue.Dequeue(); - - PropertyInfo propertyTemp; - FieldInfo fieldTemp; - var list = new List(); - while (propsQueue.Count != 0) - { - var nameToFind = propsQueue.Dequeue(); - fieldTemp = GetField(type, nameToFind); - if (fieldTemp != null) - { - type = fieldTemp.FieldType; - list.Add(fieldTemp); - continue; - } - propertyTemp = GetProperty(type, nameToFind); - if (propertyTemp != null) - { - type = propertyTemp.PropertyType; - var getMethod = GetGetMethod(propertyTemp); - list.Add(getMethod); - continue; - } - throw new InvalidPathException(nameToFind); - } - return list.ToArray(); - } - - private void ValidatePath(string path) - { - bool invalid = false; - if (path.StartsWith(".") || path.EndsWith(".")) - invalid = true; - if (path.IndexOf("..") >= 0) - invalid = true; - if (Regex.IsMatch(path, @"\s")) - invalid = true; - - if (invalid) - throw new InvalidPathException(path); - } - - private static bool IsValueType(Type type) - { - #if !UNITY_METRO - return type.IsValueType; - #else - return false; - #endif - } - - private static FieldInfo GetField(Type type, string fieldName) - { - #if !UNITY_METRO - return type.GetField(fieldName); - #else - return null; - #endif - } - - private static PropertyInfo GetProperty(Type type, string propertyName) - { - #if !UNITY_METRO - return type.GetProperty(propertyName); - #else - return null; - #endif - } - - private static MethodInfo GetGetMethod(PropertyInfo propertyInfo) - { - #if !UNITY_METRO - return propertyInfo.GetGetMethod(); - #else - return null; - #endif - } - } -} diff --git a/example_project/Assets/UnityTestTools/Assertions/MemberResolver.cs.meta b/example_project/Assets/UnityTestTools/Assertions/MemberResolver.cs.meta deleted file mode 100644 index 6b1ea42..0000000 --- a/example_project/Assets/UnityTestTools/Assertions/MemberResolver.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 80df8ef907961e34dbcc7c89b22729b9 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Common.meta b/example_project/Assets/UnityTestTools/Common.meta deleted file mode 100644 index 5f0acfe..0000000 --- a/example_project/Assets/UnityTestTools/Common.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: a2caba6436df568499c84c1c607ce766 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor.meta b/example_project/Assets/UnityTestTools/Common/Editor.meta deleted file mode 100644 index 2021d4f..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: f4ab061d0035ee545a936bdf8f3f8620 -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/Icons.cs b/example_project/Assets/UnityTestTools/Common/Editor/Icons.cs deleted file mode 100644 index 8fd7bfa..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/Icons.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using UnityEditor; -using UnityEngine; - -namespace UnityTest -{ - public static class Icons - { - const string k_IconsFolderName = "icons"; - private static readonly string k_IconsFolderPath = String.Format("UnityTestTools{0}Common{0}Editor{0}{1}", Path.DirectorySeparatorChar, k_IconsFolderName); - - private static readonly string k_IconsAssetsPath = ""; - - public static readonly Texture2D FailImg; - public static readonly Texture2D IgnoreImg; - public static readonly Texture2D SuccessImg; - public static readonly Texture2D UnknownImg; - public static readonly Texture2D InconclusiveImg; - public static readonly Texture2D StopwatchImg; - - public static readonly GUIContent GUIUnknownImg; - public static readonly GUIContent GUIInconclusiveImg; - public static readonly GUIContent GUIIgnoreImg; - public static readonly GUIContent GUISuccessImg; - public static readonly GUIContent GUIFailImg; - - static Icons() - { - var dirs = Directory.GetDirectories("Assets", k_IconsFolderName, SearchOption.AllDirectories).Where(s => s.EndsWith(k_IconsFolderPath)); - if (dirs.Any()) - k_IconsAssetsPath = dirs.First(); - else - Debug.LogWarning("The UnityTestTools asset folder path is incorrect. If you relocated the tools please change the path accordingly (Icons.cs)."); - - FailImg = LoadTexture("failed.png"); - IgnoreImg = LoadTexture("ignored.png"); - SuccessImg = LoadTexture("passed.png"); - UnknownImg = LoadTexture("normal.png"); - InconclusiveImg = LoadTexture("inconclusive.png"); - StopwatchImg = LoadTexture("stopwatch.png"); - - GUIUnknownImg = new GUIContent(UnknownImg); - GUIInconclusiveImg = new GUIContent(InconclusiveImg); - GUIIgnoreImg = new GUIContent(IgnoreImg); - GUISuccessImg = new GUIContent(SuccessImg); - GUIFailImg = new GUIContent(FailImg); - } - - private static Texture2D LoadTexture(string fileName) - { - return (Texture2D)AssetDatabase.LoadAssetAtPath(k_IconsAssetsPath + Path.DirectorySeparatorChar + fileName, typeof(Texture2D)); - } - } -} diff --git a/example_project/Assets/UnityTestTools/Common/Editor/Icons.cs.meta b/example_project/Assets/UnityTestTools/Common/Editor/Icons.cs.meta deleted file mode 100644 index 267269a..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/Icons.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 8571844b0c115b84cbe8b3f67e8dec04 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/ProjectSettingsBase.cs b/example_project/Assets/UnityTestTools/Common/Editor/ProjectSettingsBase.cs deleted file mode 100644 index 99cafad..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/ProjectSettingsBase.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using UnityEditor; -using UnityEngine; - -namespace UnityTest -{ - public abstract class ProjectSettingsBase : ScriptableObject - { - private static readonly string k_SettingsPath = Path.Combine("UnityTestTools", "Common"); - const string k_SettingsFolder = "Settings"; - - public virtual void Save() - { - EditorUtility.SetDirty(this); - } - - public static T Load() where T : ProjectSettingsBase, new () - { - var pathsInProject = Directory.GetDirectories("Assets", "*", SearchOption.AllDirectories) - .Where(s => s.Contains(k_SettingsPath)); - - if (pathsInProject.Count() == 0) Debug.LogError("Can't find settings path: " + k_SettingsPath); - - string pathInProject = Path.Combine(pathsInProject.First(), k_SettingsFolder); - var assetPath = Path.Combine(pathInProject, typeof(T).Name) + ".asset"; - var settings = AssetDatabase.LoadAssetAtPath(assetPath, typeof(T)) as T; - - if (settings != null) return settings; - - settings = CreateInstance(); - Directory.CreateDirectory(pathInProject); - AssetDatabase.CreateAsset(settings, assetPath); - return settings; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Common/Editor/ProjectSettingsBase.cs.meta b/example_project/Assets/UnityTestTools/Common/Editor/ProjectSettingsBase.cs.meta deleted file mode 100644 index db5944b..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/ProjectSettingsBase.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9ac961be07107124a88dcb81927143d4 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter.meta b/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter.meta deleted file mode 100644 index 9b2e13b..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 4ffbf5a07740aa5479651bd415f52ebb -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/ResultSummarizer.cs b/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/ResultSummarizer.cs deleted file mode 100644 index cfd39ca..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/ResultSummarizer.cs +++ /dev/null @@ -1,173 +0,0 @@ -// **************************************************************** -// Based on nUnit 2.6.2 (http://www.nunit.org/) -// **************************************************************** - -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - /// - /// Summary description for ResultSummarizer. - /// - public class ResultSummarizer - { - private int m_ErrorCount; - private int m_FailureCount; - private int m_IgnoreCount; - private int m_InconclusiveCount; - private int m_NotRunnable; - private int m_ResultCount; - private int m_SkipCount; - private int m_SuccessCount; - private int m_TestsRun; - - private TimeSpan m_Duration; - - public ResultSummarizer(IEnumerable results) - { - foreach (var result in results) - Summarize(result); - } - - public bool Success - { - get { return m_FailureCount == 0; } - } - - /// - /// Returns the number of test cases for which results - /// have been summarized. Any tests excluded by use of - /// Category or Explicit attributes are not counted. - /// - public int ResultCount - { - get { return m_ResultCount; } - } - - /// - /// Returns the number of test cases actually run, which - /// is the same as ResultCount, less any Skipped, Ignored - /// or NonRunnable tests. - /// - public int TestsRun - { - get { return m_TestsRun; } - } - - /// - /// Returns the number of tests that passed - /// - public int Passed - { - get { return m_SuccessCount; } - } - - /// - /// Returns the number of test cases that had an error. - /// - public int Errors - { - get { return m_ErrorCount; } - } - - /// - /// Returns the number of test cases that failed. - /// - public int Failures - { - get { return m_FailureCount; } - } - - /// - /// Returns the number of test cases that failed. - /// - public int Inconclusive - { - get { return m_InconclusiveCount; } - } - - /// - /// Returns the number of test cases that were not runnable - /// due to errors in the signature of the class or method. - /// Such tests are also counted as Errors. - /// - public int NotRunnable - { - get { return m_NotRunnable; } - } - - /// - /// Returns the number of test cases that were skipped. - /// - public int Skipped - { - get { return m_SkipCount; } - } - - public int Ignored - { - get { return m_IgnoreCount; } - } - - public double Duration - { - get { return m_Duration.TotalSeconds; } - } - - public int TestsNotRun - { - get { return m_SkipCount + m_IgnoreCount + m_NotRunnable; } - } - - public void Summarize(ITestResult result) - { - m_Duration += TimeSpan.FromSeconds(result.Duration); - m_ResultCount++; - - if(!result.Executed) - { - if(result.IsIgnored) - { - m_IgnoreCount++; - return; - } - - m_SkipCount++; - return; - } - - switch (result.ResultState) - { - case TestResultState.Success: - m_SuccessCount++; - m_TestsRun++; - break; - case TestResultState.Failure: - m_FailureCount++; - m_TestsRun++; - break; - case TestResultState.Error: - case TestResultState.Cancelled: - m_ErrorCount++; - m_TestsRun++; - break; - case TestResultState.Inconclusive: - m_InconclusiveCount++; - m_TestsRun++; - break; - case TestResultState.NotRunnable: - m_NotRunnable++; - // errorCount++; - break; - case TestResultState.Ignored: - m_IgnoreCount++; - break; - default: - m_SkipCount++; - break; - } - } - } -} diff --git a/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/ResultSummarizer.cs.meta b/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/ResultSummarizer.cs.meta deleted file mode 100644 index ca3c41f..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/ResultSummarizer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ce89106be5bd4204388d58510e4e55da -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/StackTraceFilter.cs b/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/StackTraceFilter.cs deleted file mode 100644 index 686de92..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/StackTraceFilter.cs +++ /dev/null @@ -1,62 +0,0 @@ -// **************************************************************** -// Based on nUnit 2.6.2 (http://www.nunit.org/) -// **************************************************************** - -using System; -using System.Collections.Generic; -using System.IO; -using UnityEngine; - -namespace UnityTest -{ - /// - /// Summary description for StackTraceFilter. - /// - public class StackTraceFilter - { - public static string Filter(string stack) - { - if (stack == null) return null; - var sw = new StringWriter(); - var sr = new StringReader(stack); - - try - { - string line; - while ((line = sr.ReadLine()) != null) - { - if (!FilterLine(line)) - sw.WriteLine(line.Trim()); - } - } - catch (Exception) - { - return stack; - } - return sw.ToString(); - } - - static bool FilterLine(string line) - { - string[] patterns = - { - "NUnit.Core.TestCase", - "NUnit.Core.ExpectedExceptionTestCase", - "NUnit.Core.TemplateTestCase", - "NUnit.Core.TestResult", - "NUnit.Core.TestSuite", - "NUnit.Framework.Assertion", - "NUnit.Framework.Assert", - "System.Reflection.MonoMethod" - }; - - for (int i = 0; i < patterns.Length; i++) - { - if (line.IndexOf(patterns[i]) > 0) - return true; - } - - return false; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/StackTraceFilter.cs.meta b/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/StackTraceFilter.cs.meta deleted file mode 100644 index 7051843..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/StackTraceFilter.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: fe6b4d68575d4ba44b1d5c5c3f0e96d3 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/XmlResultWriter.cs b/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/XmlResultWriter.cs deleted file mode 100644 index 3115e4f..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/XmlResultWriter.cs +++ /dev/null @@ -1,303 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Security; -using System.Text; -using UnityEngine; - -namespace UnityTest -{ - public class XmlResultWriter - { - private readonly StringBuilder m_ResultWriter = new StringBuilder(); - private int m_Indend; - private readonly string m_SuiteName; - private readonly ITestResult[] m_Results; - string m_Platform; - - public XmlResultWriter(string suiteName, string platform, ITestResult[] results) - { - m_SuiteName = suiteName; - m_Results = results; - m_Platform = platform; - } - - private const string k_NUnitVersion = "2.6.2-Unity"; - - public string GetTestResult() - { - InitializeXmlFile(m_SuiteName, new ResultSummarizer(m_Results)); - foreach (var result in m_Results) - { - WriteResultElement(result); - } - TerminateXmlFile(); - return m_ResultWriter.ToString(); - } - - private void InitializeXmlFile(string resultsName, ResultSummarizer summaryResults) - { - WriteHeader(); - - DateTime now = DateTime.Now; - var attributes = new Dictionary - { - {"name", "Unity Tests"}, - {"total", summaryResults.TestsRun.ToString()}, - {"errors", summaryResults.Errors.ToString()}, - {"failures", summaryResults.Failures.ToString()}, - {"not-run", summaryResults.TestsNotRun.ToString()}, - {"inconclusive", summaryResults.Inconclusive.ToString()}, - {"ignored", summaryResults.Ignored.ToString()}, - {"skipped", summaryResults.Skipped.ToString()}, - {"invalid", summaryResults.NotRunnable.ToString()}, - {"date", now.ToString("yyyy-MM-dd")}, - {"time", now.ToString("HH:mm:ss")} - }; - - WriteOpeningElement("test-results", attributes); - - WriteEnvironment(m_Platform); - WriteCultureInfo(); - WriteTestSuite(resultsName, summaryResults); - WriteOpeningElement("results"); - } - - private void WriteOpeningElement(string elementName) - { - WriteOpeningElement(elementName, new Dictionary()); - } - - private void WriteOpeningElement(string elementName, Dictionary attributes) - { - WriteOpeningElement(elementName, attributes, false); - } - - - private void WriteOpeningElement(string elementName, Dictionary attributes, bool closeImmediatelly) - { - WriteIndend(); - m_Indend++; - m_ResultWriter.Append("<"); - m_ResultWriter.Append(elementName); - foreach (var attribute in attributes) - { - m_ResultWriter.AppendFormat(" {0}=\"{1}\"", attribute.Key, SecurityElement.Escape(attribute.Value)); - } - if (closeImmediatelly) - { - m_ResultWriter.Append(" /"); - m_Indend--; - } - m_ResultWriter.AppendLine(">"); - } - - private void WriteIndend() - { - for (int i = 0; i < m_Indend; i++) - { - m_ResultWriter.Append(" "); - } - } - - private void WriteClosingElement(string elementName) - { - m_Indend--; - WriteIndend(); - m_ResultWriter.AppendLine(""); - } - - private void WriteHeader() - { - m_ResultWriter.AppendLine(""); - m_ResultWriter.AppendLine(""); - } - - static string GetEnvironmentUserName() - { - return Environment.UserName; - } - - static string GetEnvironmentMachineName() - { - return Environment.MachineName; - } - - static string GetEnvironmentUserDomainName() - { - return Environment.UserDomainName; - } - - static string GetEnvironmentVersion() - { - return Environment.Version.ToString(); - } - - static string GetEnvironmentOSVersion() - { - return Environment.OSVersion.ToString(); - } - - static string GetEnvironmentOSVersionPlatform() - { - return Environment.OSVersion.Platform.ToString(); - } - - static string EnvironmentGetCurrentDirectory() - { - return Environment.CurrentDirectory; - } - - private void WriteEnvironment( string targetPlatform ) - { - var attributes = new Dictionary - { - {"nunit-version", k_NUnitVersion}, - {"clr-version", GetEnvironmentVersion()}, - {"os-version", GetEnvironmentOSVersion()}, - {"platform", GetEnvironmentOSVersionPlatform()}, - {"cwd", EnvironmentGetCurrentDirectory()}, - {"machine-name", GetEnvironmentMachineName()}, - {"user", GetEnvironmentUserName()}, - {"user-domain", GetEnvironmentUserDomainName()}, - {"unity-version", Application.unityVersion}, - {"unity-platform", targetPlatform} - }; - WriteOpeningElement("environment", attributes, true); - } - - private void WriteCultureInfo() - { - var attributes = new Dictionary - { - {"current-culture", CultureInfo.CurrentCulture.ToString()}, - {"current-uiculture", CultureInfo.CurrentUICulture.ToString()} - }; - WriteOpeningElement("culture-info", attributes, true); - } - - private void WriteTestSuite(string resultsName, ResultSummarizer summaryResults) - { - var attributes = new Dictionary - { - {"name", resultsName}, - {"type", "Assembly"}, - {"executed", "True"}, - {"result", summaryResults.Success ? "Success" : "Failure"}, - {"success", summaryResults.Success ? "True" : "False"}, - {"time", summaryResults.Duration.ToString("#####0.000", NumberFormatInfo.InvariantInfo)} - }; - WriteOpeningElement("test-suite", attributes); - } - - private void WriteResultElement(ITestResult result) - { - StartTestElement(result); - - switch (result.ResultState) - { - case TestResultState.Ignored: - case TestResultState.NotRunnable: - case TestResultState.Skipped: - WriteReasonElement(result); - break; - - case TestResultState.Failure: - case TestResultState.Error: - case TestResultState.Cancelled: - WriteFailureElement(result); - break; - case TestResultState.Success: - case TestResultState.Inconclusive: - if (result.Message != null) - WriteReasonElement(result); - break; - }; - - WriteClosingElement("test-case"); - } - - private void TerminateXmlFile() - { - WriteClosingElement("results"); - WriteClosingElement("test-suite"); - WriteClosingElement("test-results"); - } - - #region Element Creation Helpers - - private void StartTestElement(ITestResult result) - { - var attributes = new Dictionary - { - {"name", result.FullName}, - {"executed", result.Executed.ToString()} - }; - string resultString; - switch (result.ResultState) - { - case TestResultState.Cancelled: - resultString = TestResultState.Failure.ToString(); - break; - default: - resultString = result.ResultState.ToString(); - break; - } - attributes.Add("result", resultString); - if (result.Executed) - { - attributes.Add("success", result.IsSuccess.ToString()); - attributes.Add("time", result.Duration.ToString("#####0.000", NumberFormatInfo.InvariantInfo)); - } - WriteOpeningElement("test-case", attributes); - } - - private void WriteReasonElement(ITestResult result) - { - WriteOpeningElement("reason"); - WriteOpeningElement("message"); - WriteCData(result.Message); - WriteClosingElement("message"); - WriteClosingElement("reason"); - } - - private void WriteFailureElement(ITestResult result) - { - WriteOpeningElement("failure"); - WriteOpeningElement("message"); - WriteCData(result.Message); - WriteClosingElement("message"); - WriteOpeningElement("stack-trace"); - if (result.StackTrace != null) - WriteCData(StackTraceFilter.Filter(result.StackTrace)); - WriteClosingElement("stack-trace"); - WriteClosingElement("failure"); - } - - #endregion - - private void WriteCData(string text) - { - if (string.IsNullOrEmpty(text)) - return; - m_ResultWriter.AppendFormat("", text); - m_ResultWriter.AppendLine(); - } - - public void WriteToFile(string resultDestiantion, string resultFileName) - { - try - { - var path = Path.Combine(resultDestiantion, resultFileName); - Debug.Log("Saving results in " + path); - File.WriteAllText(path, GetTestResult(), Encoding.UTF8); - } - catch (Exception e) - { - Debug.LogError("Error while opening file"); - Debug.LogException(e); - } - } - } -} diff --git a/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/XmlResultWriter.cs.meta b/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/XmlResultWriter.cs.meta deleted file mode 100644 index 2fffa90..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/ResultWriter/XmlResultWriter.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e9bba41ace7686d4ab0c400d1e7f55b7 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/Styles.cs b/example_project/Assets/UnityTestTools/Common/Editor/Styles.cs deleted file mode 100644 index 0caf6e1..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/Styles.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEditor; -using UnityEngine; - -namespace UnityTest -{ - public static class Styles - { - public static GUIStyle info; - public static GUIStyle testList; - - public static GUIStyle selectedFoldout; - public static GUIStyle foldout; - public static GUIStyle toolbarLabel; - - public static GUIStyle testName; - - private static readonly Color k_SelectedColor = new Color(0.3f, 0.5f, 0.85f); - - static Styles() - { - info = new GUIStyle(EditorStyles.wordWrappedLabel); - info.wordWrap = false; - info.stretchHeight = true; - info.margin.right = 15; - - testList = new GUIStyle("CN Box"); - testList.margin.top = 0; - testList.padding.left = 3; - - foldout = new GUIStyle(EditorStyles.foldout); - selectedFoldout = new GUIStyle(EditorStyles.foldout); - selectedFoldout.onFocused.textColor = selectedFoldout.focused.textColor = - selectedFoldout.onActive.textColor = selectedFoldout.active.textColor = - selectedFoldout.onNormal.textColor = selectedFoldout.normal.textColor = k_SelectedColor; - - toolbarLabel = new GUIStyle(EditorStyles.toolbarButton); - toolbarLabel.normal.background = null; - toolbarLabel.contentOffset = new Vector2(0, -2); - - testName = new GUIStyle(EditorStyles.label); - testName.padding.left += 12; - testName.focused.textColor = testName.onFocused.textColor = k_SelectedColor; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Common/Editor/Styles.cs.meta b/example_project/Assets/UnityTestTools/Common/Editor/Styles.cs.meta deleted file mode 100644 index 294a619..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/Styles.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a8b92379e11501742b1badcbb08da812 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/TestFilterSettings.cs b/example_project/Assets/UnityTestTools/Common/Editor/TestFilterSettings.cs deleted file mode 100644 index cef016a..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/TestFilterSettings.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; -using System.Linq; - -namespace UnityTest -{ - public class TestFilterSettings - { - public bool ShowSucceeded; - public bool ShowFailed; - public bool ShowIgnored; - public bool ShowNotRun; - - public string FilterByName; - public int FilterByCategory; - - private GUIContent _succeededBtn; - private GUIContent _failedBtn; - private GUIContent _ignoredBtn; - private GUIContent _notRunBtn; - - public string[] AvailableCategories; - - private readonly string _prefsKey; - - public TestFilterSettings(string prefsKey) - { - _prefsKey = prefsKey; - Load(); - UpdateCounters(Enumerable.Empty()); - } - - public void Load() - { - ShowSucceeded = EditorPrefs.GetBool(_prefsKey + ".ShowSucceeded", true); - ShowFailed = EditorPrefs.GetBool(_prefsKey + ".ShowFailed", true); - ShowIgnored = EditorPrefs.GetBool(_prefsKey + ".ShowIgnored", true); - ShowNotRun = EditorPrefs.GetBool(_prefsKey + ".ShowNotRun", true); - FilterByName = EditorPrefs.GetString(_prefsKey + ".FilterByName", string.Empty); - FilterByCategory = EditorPrefs.GetInt(_prefsKey + ".FilterByCategory", 0); - } - - public void Save() - { - EditorPrefs.SetBool(_prefsKey + ".ShowSucceeded", ShowSucceeded); - EditorPrefs.SetBool(_prefsKey + ".ShowFailed", ShowFailed); - EditorPrefs.SetBool(_prefsKey + ".ShowIgnored", ShowIgnored); - EditorPrefs.SetBool(_prefsKey + ".ShowNotRun", ShowNotRun); - EditorPrefs.SetString(_prefsKey + ".FilterByName", FilterByName); - EditorPrefs.SetInt(_prefsKey + ".FilterByCategory", FilterByCategory); - } - - public void UpdateCounters(IEnumerable results) - { - var summary = new ResultSummarizer(results); - - _succeededBtn = new GUIContent(summary.Passed.ToString(), Icons.SuccessImg, "Show tests that succeeded"); - _failedBtn = new GUIContent((summary.Errors + summary.Failures + summary.Inconclusive).ToString(), Icons.FailImg, "Show tests that failed"); - _ignoredBtn = new GUIContent((summary.Ignored + summary.NotRunnable).ToString(), Icons.IgnoreImg, "Show tests that are ignored"); - _notRunBtn = new GUIContent((summary.TestsNotRun - summary.Ignored - summary.NotRunnable).ToString(), Icons.UnknownImg, "Show tests that didn't run"); - } - - public string[] GetSelectedCategories() - { - if(AvailableCategories == null) return new string[0]; - - return AvailableCategories.Where ((c, i) => (FilterByCategory & (1 << i)) != 0).ToArray(); - } - - public void OnGUI() - { - EditorGUI.BeginChangeCheck(); - - FilterByName = GUILayout.TextField(FilterByName, "ToolbarSeachTextField", GUILayout.MinWidth(100), GUILayout.MaxWidth(250), GUILayout.ExpandWidth(true)); - if(GUILayout.Button (GUIContent.none, string.IsNullOrEmpty(FilterByName) ? "ToolbarSeachCancelButtonEmpty" : "ToolbarSeachCancelButton")) - FilterByName = string.Empty; - - if (AvailableCategories != null && AvailableCategories.Length > 0) - FilterByCategory = EditorGUILayout.MaskField(FilterByCategory, AvailableCategories, EditorStyles.toolbarDropDown, GUILayout.MaxWidth(90)); - - ShowSucceeded = GUILayout.Toggle(ShowSucceeded, _succeededBtn, EditorStyles.toolbarButton); - ShowFailed = GUILayout.Toggle(ShowFailed, _failedBtn, EditorStyles.toolbarButton); - ShowIgnored = GUILayout.Toggle(ShowIgnored, _ignoredBtn, EditorStyles.toolbarButton); - ShowNotRun = GUILayout.Toggle(ShowNotRun, _notRunBtn, EditorStyles.toolbarButton); - - if(EditorGUI.EndChangeCheck()) Save (); - } - - public RenderingOptions BuildRenderingOptions() - { - var options = new RenderingOptions(); - options.showSucceeded = ShowSucceeded; - options.showFailed = ShowFailed; - options.showIgnored = ShowIgnored; - options.showNotRunned = ShowNotRun; - options.nameFilter = FilterByName; - options.categories = GetSelectedCategories(); - return options; - } - } - -} diff --git a/example_project/Assets/UnityTestTools/Common/Editor/TestFilterSettings.cs.meta b/example_project/Assets/UnityTestTools/Common/Editor/TestFilterSettings.cs.meta deleted file mode 100644 index 9a7a0e3..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/TestFilterSettings.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5a2d025e58bff433e963d0a4cd7599ef -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/icons.meta b/example_project/Assets/UnityTestTools/Common/Editor/icons.meta deleted file mode 100644 index 58c5248..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/icons.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: e8bb6eae11352f44da0d6d8a8959b69e -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/icons/failed.png b/example_project/Assets/UnityTestTools/Common/Editor/icons/failed.png deleted file mode 100644 index 7c0aba4..0000000 Binary files a/example_project/Assets/UnityTestTools/Common/Editor/icons/failed.png and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Common/Editor/icons/failed.png.meta b/example_project/Assets/UnityTestTools/Common/Editor/icons/failed.png.meta deleted file mode 100644 index 03673da..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/icons/failed.png.meta +++ /dev/null @@ -1,35 +0,0 @@ -fileFormatVersion: 2 -guid: 41488feb372865440b7c01773f04c0cf -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - linearTexture: 1 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: 1 - mipBias: -1 - wrapMode: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - textureType: 2 - buildTargetSettings: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/icons/ignored.png b/example_project/Assets/UnityTestTools/Common/Editor/icons/ignored.png deleted file mode 100644 index 0190e59..0000000 Binary files a/example_project/Assets/UnityTestTools/Common/Editor/icons/ignored.png and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Common/Editor/icons/ignored.png.meta b/example_project/Assets/UnityTestTools/Common/Editor/icons/ignored.png.meta deleted file mode 100644 index d14cc3b..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/icons/ignored.png.meta +++ /dev/null @@ -1,35 +0,0 @@ -fileFormatVersion: 2 -guid: 0076bfa6073f17546b3535ac1b456b0b -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - linearTexture: 1 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: 1 - mipBias: -1 - wrapMode: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - textureType: 2 - buildTargetSettings: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/icons/inconclusive.png b/example_project/Assets/UnityTestTools/Common/Editor/icons/inconclusive.png deleted file mode 100644 index df398dd..0000000 Binary files a/example_project/Assets/UnityTestTools/Common/Editor/icons/inconclusive.png and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Common/Editor/icons/inconclusive.png.meta b/example_project/Assets/UnityTestTools/Common/Editor/icons/inconclusive.png.meta deleted file mode 100644 index 7c93bc4..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/icons/inconclusive.png.meta +++ /dev/null @@ -1,35 +0,0 @@ -fileFormatVersion: 2 -guid: e28761099904678488cdddf7b6be2ceb -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - linearTexture: 1 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: 1 - mipBias: -1 - wrapMode: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - textureType: 2 - buildTargetSettings: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/icons/normal.png b/example_project/Assets/UnityTestTools/Common/Editor/icons/normal.png deleted file mode 100644 index 6a04f79..0000000 Binary files a/example_project/Assets/UnityTestTools/Common/Editor/icons/normal.png and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Common/Editor/icons/normal.png.meta b/example_project/Assets/UnityTestTools/Common/Editor/icons/normal.png.meta deleted file mode 100644 index 34895eb..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/icons/normal.png.meta +++ /dev/null @@ -1,35 +0,0 @@ -fileFormatVersion: 2 -guid: a9f3c491f4c2f9f43ac33a27c16913dd -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - linearTexture: 1 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: 1 - mipBias: -1 - wrapMode: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - textureType: 2 - buildTargetSettings: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/icons/passed.png b/example_project/Assets/UnityTestTools/Common/Editor/icons/passed.png deleted file mode 100644 index 1edd286..0000000 Binary files a/example_project/Assets/UnityTestTools/Common/Editor/icons/passed.png and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Common/Editor/icons/passed.png.meta b/example_project/Assets/UnityTestTools/Common/Editor/icons/passed.png.meta deleted file mode 100644 index 876d32d..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/icons/passed.png.meta +++ /dev/null @@ -1,35 +0,0 @@ -fileFormatVersion: 2 -guid: 31f7928179ee46d4690d274579efb037 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - linearTexture: 1 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: 1 - mipBias: -1 - wrapMode: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - textureType: 2 - buildTargetSettings: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Editor/icons/stopwatch.png b/example_project/Assets/UnityTestTools/Common/Editor/icons/stopwatch.png deleted file mode 100644 index ac5721c..0000000 Binary files a/example_project/Assets/UnityTestTools/Common/Editor/icons/stopwatch.png and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Common/Editor/icons/stopwatch.png.meta b/example_project/Assets/UnityTestTools/Common/Editor/icons/stopwatch.png.meta deleted file mode 100644 index f39adad..0000000 --- a/example_project/Assets/UnityTestTools/Common/Editor/icons/stopwatch.png.meta +++ /dev/null @@ -1,35 +0,0 @@ -fileFormatVersion: 2 -guid: f73f95ae19d51af47ad56044f2779aa1 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - linearTexture: 1 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: 1 - mipBias: -1 - wrapMode: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - textureType: 2 - buildTargetSettings: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Common/ITestResult.cs b/example_project/Assets/UnityTestTools/Common/ITestResult.cs deleted file mode 100644 index 13f5fc3..0000000 --- a/example_project/Assets/UnityTestTools/Common/ITestResult.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using UnityTest; - -public interface ITestResult -{ - TestResultState ResultState { get; } - - string Message { get; } - - string Logs { get; } - - bool Executed { get; } - - string Name { get; } - - string FullName { get; } - - string Id { get; } - - bool IsSuccess { get; } - - double Duration { get; } - - string StackTrace { get; } - - bool IsIgnored { get; } -} diff --git a/example_project/Assets/UnityTestTools/Common/ITestResult.cs.meta b/example_project/Assets/UnityTestTools/Common/ITestResult.cs.meta deleted file mode 100644 index 4864197..0000000 --- a/example_project/Assets/UnityTestTools/Common/ITestResult.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d1e4e2c4d00b3f2469494fc0f67cdeae -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Common/Settings/IntegrationTestsRunnerSettings.asset b/example_project/Assets/UnityTestTools/Common/Settings/IntegrationTestsRunnerSettings.asset deleted file mode 100644 index 6dc1b80..0000000 Binary files a/example_project/Assets/UnityTestTools/Common/Settings/IntegrationTestsRunnerSettings.asset and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Common/Settings/IntegrationTestsRunnerSettings.asset.meta b/example_project/Assets/UnityTestTools/Common/Settings/IntegrationTestsRunnerSettings.asset.meta deleted file mode 100644 index d4ac497..0000000 --- a/example_project/Assets/UnityTestTools/Common/Settings/IntegrationTestsRunnerSettings.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 023de13c6caab894c9f703d6afde3fa7 -timeCreated: 1466591233 -licenseType: Free -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/example_project/Assets/UnityTestTools/Common/TestResultState.cs b/example_project/Assets/UnityTestTools/Common/TestResultState.cs deleted file mode 100644 index 3dc4eb8..0000000 --- a/example_project/Assets/UnityTestTools/Common/TestResultState.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public enum TestResultState : byte - { - Inconclusive = 0, - - /// - /// The test was not runnable. - /// - NotRunnable = 1, - - /// - /// The test has been skipped. - /// - Skipped = 2, - - /// - /// The test has been ignored. - /// - Ignored = 3, - - /// - /// The test succeeded - /// - Success = 4, - - /// - /// The test failed - /// - Failure = 5, - - /// - /// The test encountered an unexpected exception - /// - Error = 6, - - /// - /// The test was cancelled by the user - /// - Cancelled = 7 - } -} diff --git a/example_project/Assets/UnityTestTools/Common/TestResultState.cs.meta b/example_project/Assets/UnityTestTools/Common/TestResultState.cs.meta deleted file mode 100644 index e1576c7..0000000 --- a/example_project/Assets/UnityTestTools/Common/TestResultState.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: da3ca54ee4cce064989d27165f3081fb -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Documentation.url b/example_project/Assets/UnityTestTools/Documentation.url deleted file mode 100644 index 980b585..0000000 --- a/example_project/Assets/UnityTestTools/Documentation.url +++ /dev/null @@ -1,3 +0,0 @@ -[InternetShortcut] -URL=https://bitbucket.org/Unity-Technologies/unitytesttools/wiki -IconIndex=0 \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/Documentation.url.meta b/example_project/Assets/UnityTestTools/Documentation.url.meta deleted file mode 100644 index b5db496..0000000 --- a/example_project/Assets/UnityTestTools/Documentation.url.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 28f1b62e1364e5a4e88f7bb94dbcf183 -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples.meta b/example_project/Assets/UnityTestTools/Examples.meta deleted file mode 100644 index 85e2759..0000000 --- a/example_project/Assets/UnityTestTools/Examples.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 36eb46c771e52864e9f81fa648c3d500 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample.meta b/example_project/Assets/UnityTestTools/Examples/AssertionExample.meta deleted file mode 100644 index 5fe301a..0000000 --- a/example_project/Assets/UnityTestTools/Examples/AssertionExample.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 7854431fdc41b744795c7c586a2baa53 -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/AssertionsExample.unity b/example_project/Assets/UnityTestTools/Examples/AssertionExample/AssertionsExample.unity deleted file mode 100644 index 5ad1f67..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/AssertionExample/AssertionsExample.unity and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/AssertionsExample.unity.meta b/example_project/Assets/UnityTestTools/Examples/AssertionExample/AssertionsExample.unity.meta deleted file mode 100644 index cb0e54e..0000000 --- a/example_project/Assets/UnityTestTools/Examples/AssertionExample/AssertionsExample.unity.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 284a2502d0525ad45a00d66cfcaee7b3 -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/Ball.physicMaterial b/example_project/Assets/UnityTestTools/Examples/AssertionExample/Ball.physicMaterial deleted file mode 100644 index e40833d..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/AssertionExample/Ball.physicMaterial and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/Ball.physicMaterial.meta b/example_project/Assets/UnityTestTools/Examples/AssertionExample/Ball.physicMaterial.meta deleted file mode 100644 index d6bfd04..0000000 --- a/example_project/Assets/UnityTestTools/Examples/AssertionExample/Ball.physicMaterial.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: f9955b9bc48103645a71b05046ce13bc -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/BouncingPlane.physicMaterial b/example_project/Assets/UnityTestTools/Examples/AssertionExample/BouncingPlane.physicMaterial deleted file mode 100644 index 8d7d30d..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/AssertionExample/BouncingPlane.physicMaterial and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/BouncingPlane.physicMaterial.meta b/example_project/Assets/UnityTestTools/Examples/AssertionExample/BouncingPlane.physicMaterial.meta deleted file mode 100644 index 10dd191..0000000 --- a/example_project/Assets/UnityTestTools/Examples/AssertionExample/BouncingPlane.physicMaterial.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: c3a7173873a52c44cbed094e5e244493 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/BouncingSphere.prefab b/example_project/Assets/UnityTestTools/Examples/AssertionExample/BouncingSphere.prefab deleted file mode 100644 index a0bf936..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/AssertionExample/BouncingSphere.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/BouncingSphere.prefab.meta b/example_project/Assets/UnityTestTools/Examples/AssertionExample/BouncingSphere.prefab.meta deleted file mode 100644 index 55210ae..0000000 --- a/example_project/Assets/UnityTestTools/Examples/AssertionExample/BouncingSphere.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: ea57e39611d17f148a04d1a1c84393d4 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/Materials.meta b/example_project/Assets/UnityTestTools/Examples/AssertionExample/Materials.meta deleted file mode 100644 index 0ca6622..0000000 --- a/example_project/Assets/UnityTestTools/Examples/AssertionExample/Materials.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: f6bd965477d21b64aad9f2d122a2496e -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/Materials/checkerTexture.mat b/example_project/Assets/UnityTestTools/Examples/AssertionExample/Materials/checkerTexture.mat deleted file mode 100644 index 3279d91..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/AssertionExample/Materials/checkerTexture.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/Materials/checkerTexture.mat.meta b/example_project/Assets/UnityTestTools/Examples/AssertionExample/Materials/checkerTexture.mat.meta deleted file mode 100644 index 57dcfb2..0000000 --- a/example_project/Assets/UnityTestTools/Examples/AssertionExample/Materials/checkerTexture.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: d734a9661c1c7a94c94b027d59504baf -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/NotBouncingPlane.physicMaterial b/example_project/Assets/UnityTestTools/Examples/AssertionExample/NotBouncingPlane.physicMaterial deleted file mode 100644 index e043ab1..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/AssertionExample/NotBouncingPlane.physicMaterial and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/NotBouncingPlane.physicMaterial.meta b/example_project/Assets/UnityTestTools/Examples/AssertionExample/NotBouncingPlane.physicMaterial.meta deleted file mode 100644 index 0b8474c..0000000 --- a/example_project/Assets/UnityTestTools/Examples/AssertionExample/NotBouncingPlane.physicMaterial.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 79b6f9d3d49d1a2469d2d9402570c834 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/checkerTexture.png b/example_project/Assets/UnityTestTools/Examples/AssertionExample/checkerTexture.png deleted file mode 100644 index bc0b8fb..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/AssertionExample/checkerTexture.png and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/AssertionExample/checkerTexture.png.meta b/example_project/Assets/UnityTestTools/Examples/AssertionExample/checkerTexture.png.meta deleted file mode 100644 index 098ab3e..0000000 --- a/example_project/Assets/UnityTestTools/Examples/AssertionExample/checkerTexture.png.meta +++ /dev/null @@ -1,35 +0,0 @@ -fileFormatVersion: 2 -guid: 080591fda7eb7d24cbe458aafca0b041 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: 1 - mipBias: -1 - wrapMode: 0 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - textureType: 0 - buildTargetSettings: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples.meta deleted file mode 100644 index 4e90a5c..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 6580c9b1070dd524c940a0c402d8b153 -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests.meta deleted file mode 100644 index 37cdd11..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 68d993feda7ffe748acaea2f44dbff18 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Animations.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Animations.meta deleted file mode 100644 index 912b994..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Animations.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: b83200d7123c88b4d9c24f4c88f7e694 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Animations/ShootAdditive.anim b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Animations/ShootAdditive.anim deleted file mode 100644 index 645640e..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Animations/ShootAdditive.anim and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Animations/ShootAdditive.anim.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Animations/ShootAdditive.anim.meta deleted file mode 100644 index 9814949..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Animations/ShootAdditive.anim.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 00a2c2298d1f54f909674141edb1041b -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/ExampleABTests.unity b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/ExampleABTests.unity deleted file mode 100644 index c0c08ac..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/ExampleABTests.unity and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/ExampleABTests.unity.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/ExampleABTests.unity.meta deleted file mode 100644 index fd45dfa..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/ExampleABTests.unity.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: a32fe04ca3b9bc64aa8f0db9aaa268f6 -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions.meta deleted file mode 100644 index a6e7313..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: b41e893ab4c200143aa1ec8fd530617b -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials.meta deleted file mode 100644 index 515d5ad..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 339fa1d8314854a40b8d0a9c9726a6d5 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/Blob_Storm.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/Blob_Storm.mat deleted file mode 100644 index 28406b0..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/Blob_Storm.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/Blob_Storm.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/Blob_Storm.mat.meta deleted file mode 100644 index 94fb8d9..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/Blob_Storm.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 43c3af1d49001417996af5e8a36cd699 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/BloodA.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/BloodA.mat deleted file mode 100644 index e6cc25d..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/BloodA.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/BloodA.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/BloodA.mat.meta deleted file mode 100644 index f96f350..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/BloodA.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: cfccaa378af3f472ca3adcc8f939d397 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/ElectricShockwave.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/ElectricShockwave.mat deleted file mode 100644 index bf8933a..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/ElectricShockwave.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/ElectricShockwave.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/ElectricShockwave.mat.meta deleted file mode 100644 index 46646b5..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/ElectricShockwave.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 9d32c2efdb8794de3b449ab1bbc6459b -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/EleeectricSparksHitA.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/EleeectricSparksHitA.mat deleted file mode 100644 index c2e3c74..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/EleeectricSparksHitA.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/EleeectricSparksHitA.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/EleeectricSparksHitA.mat.meta deleted file mode 100644 index eab98b8..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/EleeectricSparksHitA.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 9be28344ea0b64065bf04ab3d63a8de0 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/FireBall_Blue.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/FireBall_Blue.mat deleted file mode 100644 index df24284..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/FireBall_Blue.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/FireBall_Blue.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/FireBall_Blue.mat.meta deleted file mode 100644 index e2d6660..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/FireBall_Blue.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 026976e57ed244642aa5de4510239bea -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/FireballA.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/FireballA.mat deleted file mode 100644 index e8c87d4..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/FireballA.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/FireballA.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/FireballA.mat.meta deleted file mode 100644 index 6bc3628..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/FireballA.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 3049dffabc5225d40b27675901977fdd -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/ShockWave_Simple.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/ShockWave_Simple.mat deleted file mode 100644 index b2450bd..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/ShockWave_Simple.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/ShockWave_Simple.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/ShockWave_Simple.mat.meta deleted file mode 100644 index cb83a9c..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/ShockWave_Simple.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 0d3e3e18fa5d7451c8af78156975a0c0 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/SmokeA.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/SmokeA.mat deleted file mode 100644 index 1ef8e7d..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/SmokeA.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/SmokeA.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/SmokeA.mat.meta deleted file mode 100644 index 53320ca..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/SmokeA.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 2d7e594d401a7524e82695dcd66c2bc0 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/scorchMarkSpider.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/scorchMarkSpider.mat deleted file mode 100644 index cb47aec..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/scorchMarkSpider.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/scorchMarkSpider.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/scorchMarkSpider.mat.meta deleted file mode 100644 index 5516477..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Materials/scorchMarkSpider.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 5d07628057bf34bc4aa7e37d04672b29 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts.meta deleted file mode 100644 index 148eff5..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 0314e59f90ffc854ca090496bd5cbce0 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts/EffectSequencer.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts/EffectSequencer.js deleted file mode 100644 index 83b0542..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts/EffectSequencer.js +++ /dev/null @@ -1,56 +0,0 @@ -#pragma strict - -class ExplosionPart { - var gameObject : GameObject = null; - var delay : float = 0.0; - var hqOnly : boolean = false; - var yOffset : float = 0.0; -} - -public var ambientEmitters : ExplosionPart[]; -public var explosionEmitters : ExplosionPart[]; -public var smokeEmitters : ExplosionPart[]; - -public var miscSpecialEffects : ExplosionPart[]; - -function Start () { - var go : ExplosionPart; - var maxTime : float = 0; - - for (go in ambientEmitters) { - InstantiateDelayed(go); - if (go.gameObject.GetComponent.()) - maxTime = Mathf.Max (maxTime, go.delay + go.gameObject.GetComponent.().maxEnergy); - } - for (go in explosionEmitters) { - InstantiateDelayed(go); - if (go.gameObject.GetComponent.()) - maxTime = Mathf.Max (maxTime, go.delay + go.gameObject.GetComponent.().maxEnergy); - } - for (go in smokeEmitters) { - InstantiateDelayed(go); - if (go.gameObject.GetComponent.()) - maxTime = Mathf.Max (maxTime, go.delay + go.gameObject.GetComponent.().maxEnergy); - } - - if (GetComponent.() && GetComponent.().clip) - maxTime = Mathf.Max (maxTime, GetComponent.().clip.length); - - yield; - - for (go in miscSpecialEffects) { - InstantiateDelayed(go); - if (go.gameObject.GetComponent.()) - maxTime = Mathf.Max (maxTime, go.delay + go.gameObject.GetComponent.().maxEnergy); - } - - Destroy (gameObject, maxTime + 0.5); -} - -function InstantiateDelayed (go : ExplosionPart) { - //if (go.hqOnly && QualityManager.quality < Quality.High) - // return; - - yield WaitForSeconds (go.delay); - Instantiate (go.gameObject, transform.position + Vector3.up * go.yOffset, transform.rotation); -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts/EffectSequencer.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts/EffectSequencer.js.meta deleted file mode 100644 index 928965b..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts/EffectSequencer.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 520a2b60096ec40d38a3dfa179f784a8 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts/MuzzleFlashAnimate.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts/MuzzleFlashAnimate.js deleted file mode 100644 index 38d12f4..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts/MuzzleFlashAnimate.js +++ /dev/null @@ -1,7 +0,0 @@ - -#pragma strict - -function Update () { - transform.localScale = Vector3.one * Random.Range(0.5,1.5); - transform.localEulerAngles.z = Random.Range(0,90.0); -} \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts/MuzzleFlashAnimate.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts/MuzzleFlashAnimate.js.meta deleted file mode 100644 index ddda97f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Scripts/MuzzleFlashAnimate.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0cdf562647f9346c492d3a7329db1756 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts.meta deleted file mode 100644 index ae2adc4..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: f939067cafb958f4099528f2a88cfaa8 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksA.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksA.prefab deleted file mode 100644 index 522a62c..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksA.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksA.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksA.prefab.meta deleted file mode 100644 index 02fbfd8..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksA.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: e43bacea4bcd4475581f17fa064b08e5 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksC.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksC.prefab deleted file mode 100644 index 4494ca8..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksC.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksC.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksC.prefab.meta deleted file mode 100644 index 7b5ba6e..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksC.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 1b1bf49e3d3e34f32aeae829cbd4be43 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksHitA.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksHitA.prefab deleted file mode 100644 index 8befb27..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksHitA.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksHitA.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksHitA.prefab.meta deleted file mode 100644 index 348111d..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ElectricSparksHitA.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 0f5671d6ceae3417cba7097cfa4aa290 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Fire_Spider.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Fire_Spider.prefab deleted file mode 100644 index 5027649..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Fire_Spider.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Fire_Spider.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Fire_Spider.prefab.meta deleted file mode 100644 index cd299c8..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Fire_Spider.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 97767d7c7ee0541cf8c1898412d39287 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Fire_Spider_Detonate.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Fire_Spider_Detonate.prefab deleted file mode 100644 index 99008ff..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Fire_Spider_Detonate.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Fire_Spider_Detonate.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Fire_Spider_Detonate.prefab.meta deleted file mode 100644 index 891016b..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Fire_Spider_Detonate.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 91c2f880b84384cb8981d186308bc257 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ShockwaveA.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ShockwaveA.prefab deleted file mode 100644 index 2a0b491..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ShockwaveA.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ShockwaveA.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ShockwaveA.prefab.meta deleted file mode 100644 index eb30082..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/ShockwaveA.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 24b406bea89b34ec582aae7babb277ba -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Smoke_Spider_Missile.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Smoke_Spider_Missile.prefab deleted file mode 100644 index 431a4d1..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Smoke_Spider_Missile.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Smoke_Spider_Missile.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Smoke_Spider_Missile.prefab.meta deleted file mode 100644 index e26c4e4..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/SequenceParts/Smoke_Spider_Missile.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 1b6efec96f2de41a9b93752f8e4dfa6f -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences.meta deleted file mode 100644 index 3f0fca8..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: edcbdd6eb6d834846ab0bebb5387cd9b -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences/ExplosionSequenceSpider.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences/ExplosionSequenceSpider.prefab deleted file mode 100644 index 8ea37f0..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences/ExplosionSequenceSpider.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences/ExplosionSequenceSpider.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences/ExplosionSequenceSpider.prefab.meta deleted file mode 100644 index 33af57a..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences/ExplosionSequenceSpider.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 373c2c2682efb424e9c667738eaee503 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences/ExplosionSequenceSpiderDetonate.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences/ExplosionSequenceSpiderDetonate.prefab deleted file mode 100644 index 54319df..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences/ExplosionSequenceSpiderDetonate.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences/ExplosionSequenceSpiderDetonate.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences/ExplosionSequenceSpiderDetonate.prefab.meta deleted file mode 100644 index e3e2a41..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Sequences/ExplosionSequenceSpiderDetonate.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 176cb82da2d4b47209bf74dccc47f86c -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Standalone.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Standalone.meta deleted file mode 100644 index 6252adc..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Standalone.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 4d2f99df718ae9943b7a0f320c60e431 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Standalone/Blood_Splatter.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Standalone/Blood_Splatter.prefab deleted file mode 100644 index f1160a0..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Standalone/Blood_Splatter.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Standalone/Blood_Splatter.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Standalone/Blood_Splatter.prefab.meta deleted file mode 100644 index 5d4fde8..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Standalone/Blood_Splatter.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 22221d1942e66451b8d06811bff21613 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures.meta deleted file mode 100644 index 388f0ef..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: b9f11db82afab6d4a920497d422037a0 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/AfterExplosion_B.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/AfterExplosion_B.psd deleted file mode 100644 index c6ed407..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/AfterExplosion_B.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/AfterExplosion_B.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/AfterExplosion_B.psd.meta deleted file mode 100644 index 859c70f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/AfterExplosion_B.psd.meta +++ /dev/null @@ -1,64 +0,0 @@ -fileFormatVersion: 2 -guid: 1d89c00039fa543dcb9ccc5deb4aaf03 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 256 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 256 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Standalone - maxTextureSize: 256 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: iPhone - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Android - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: FlashPlayer - maxTextureSize: 256 - textureFormat: -1 - compressionQuality: 20 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/BloodA_test.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/BloodA_test.psd deleted file mode 100644 index 7dbe42a..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/BloodA_test.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/BloodA_test.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/BloodA_test.psd.meta deleted file mode 100644 index a4ee753..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/BloodA_test.psd.meta +++ /dev/null @@ -1,64 +0,0 @@ -fileFormatVersion: 2 -guid: 38a148d20bb184d4797f99fa972a6d97 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 128 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 64 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Standalone - maxTextureSize: 64 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: iPhone - maxTextureSize: 64 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Android - maxTextureSize: 64 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: FlashPlayer - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: 0 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/ElectricShockwave1.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/ElectricShockwave1.psd deleted file mode 100644 index a26f41b..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/ElectricShockwave1.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/ElectricShockwave1.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/ElectricShockwave1.psd.meta deleted file mode 100644 index 1d6c779..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/ElectricShockwave1.psd.meta +++ /dev/null @@ -1,60 +0,0 @@ -fileFormatVersion: 2 -guid: f10f8a975ed7146b8a566c2f787343a5 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 2 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 128 - textureSettings: - filterMode: 1 - aniso: 1 - mipBias: 0 - wrapMode: 0 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: Standalone - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: iPhone - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: Android - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: 50 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Fireball_Blue_UVA.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Fireball_Blue_UVA.psd deleted file mode 100644 index 5b634df..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Fireball_Blue_UVA.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Fireball_Blue_UVA.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Fireball_Blue_UVA.psd.meta deleted file mode 100644 index b7b7a8d..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Fireball_Blue_UVA.psd.meta +++ /dev/null @@ -1,64 +0,0 @@ -fileFormatVersion: 2 -guid: 596d02b7e6a264b4f85b42fe791580c2 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 512 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 512 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Standalone - maxTextureSize: 512 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: iPhone - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Android - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: FlashPlayer - maxTextureSize: 512 - textureFormat: -1 - compressionQuality: 10 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Fireball_Storm_UVA_01_test.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Fireball_Storm_UVA_01_test.psd deleted file mode 100644 index 23e33ea..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Fireball_Storm_UVA_01_test.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Fireball_Storm_UVA_01_test.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Fireball_Storm_UVA_01_test.psd.meta deleted file mode 100644 index 8dc9b7f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Fireball_Storm_UVA_01_test.psd.meta +++ /dev/null @@ -1,64 +0,0 @@ -fileFormatVersion: 2 -guid: fcc6c17b515a14312ac72839d1212b0a -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 512 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 512 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Standalone - maxTextureSize: 512 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: iPhone - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Android - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: FlashPlayer - maxTextureSize: 512 - textureFormat: -1 - compressionQuality: 10 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Muzzle_Flash_Front_A.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Muzzle_Flash_Front_A.psd deleted file mode 100644 index bc6227a..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Muzzle_Flash_Front_A.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Muzzle_Flash_Front_A.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Muzzle_Flash_Front_A.psd.meta deleted file mode 100644 index c48f86e..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Muzzle_Flash_Front_A.psd.meta +++ /dev/null @@ -1,64 +0,0 @@ -fileFormatVersion: 2 -guid: e0a74726c7d9b4ee09334ab50155ea80 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 128 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Standalone - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: iPhone - maxTextureSize: 64 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Android - maxTextureSize: 64 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: FlashPlayer - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: 0 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Shockwave.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Shockwave.psd deleted file mode 100644 index 5d076be..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Shockwave.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Shockwave.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Shockwave.psd.meta deleted file mode 100644 index 3517352..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Shockwave.psd.meta +++ /dev/null @@ -1,60 +0,0 @@ -fileFormatVersion: 2 -guid: b7460a00d2f78cc48a5f7acbafe163e8 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 2 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: 1 - aniso: 1 - mipBias: 0 - wrapMode: 0 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: Standalone - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: iPhone - maxTextureSize: 64 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: Android - maxTextureSize: 64 - textureFormat: -1 - compressionQuality: 50 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Smoke.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Smoke.psd deleted file mode 100644 index 2da4422..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Smoke.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Smoke.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Smoke.psd.meta deleted file mode 100644 index 5a943dd..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Smoke.psd.meta +++ /dev/null @@ -1,60 +0,0 @@ -fileFormatVersion: 2 -guid: 2a6221eb1b1c50a4cb69a62e2f264e58 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 1 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 2 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 1 - heightScale: .113163002 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 512 - textureSettings: - filterMode: 1 - aniso: 1 - mipBias: 0 - wrapMode: 0 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 1 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 256 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: Standalone - maxTextureSize: 256 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: iPhone - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: Android - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: 50 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Smoke_Storm_UVA_02_test.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Smoke_Storm_UVA_02_test.psd deleted file mode 100644 index 4ff0dd3..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Smoke_Storm_UVA_02_test.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Smoke_Storm_UVA_02_test.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Smoke_Storm_UVA_02_test.psd.meta deleted file mode 100644 index 0d2bdad..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/Smoke_Storm_UVA_02_test.psd.meta +++ /dev/null @@ -1,60 +0,0 @@ -fileFormatVersion: 2 -guid: 49d183629522f456981418447438c869 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 256 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: Standalone - maxTextureSize: 256 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: iPhone - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: Android - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: 50 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/blob.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/blob.psd deleted file mode 100644 index 5f0787b..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/blob.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/blob.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/blob.psd.meta deleted file mode 100644 index c3e115b..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/blob.psd.meta +++ /dev/null @@ -1,60 +0,0 @@ -fileFormatVersion: 2 -guid: fb5d3487c412c4fa9ad41827a46623bb -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -3 - maxTextureSize: 256 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: iPhone - maxTextureSize: 64 - textureFormat: -3 - compressionQuality: 50 - - buildTarget: Web - maxTextureSize: 64 - textureFormat: -3 - compressionQuality: 50 - - buildTarget: Standalone - maxTextureSize: 64 - textureFormat: -3 - compressionQuality: 50 - - buildTarget: Android - maxTextureSize: 64 - textureFormat: -3 - compressionQuality: 50 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/whiteBlob.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/whiteBlob.psd deleted file mode 100644 index debefd7..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/whiteBlob.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/whiteBlob.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/whiteBlob.psd.meta deleted file mode 100644 index 18b2ad7..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Explosions/Textures/whiteBlob.psd.meta +++ /dev/null @@ -1,44 +0,0 @@ -fileFormatVersion: 2 -guid: 9d05c439cf1b74b0090725b5852c56cb -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 2 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 1 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: 5 - maxTextureSize: 64 - textureSettings: - filterMode: 1 - aniso: 1 - mipBias: 0 - wrapMode: 0 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: -1 - buildTargetSettings: [] - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials.meta deleted file mode 100644 index 8fb0b25..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 463d57bb50a73f44ea5a92f4b07ec3ff -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Cursor.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Cursor.mat deleted file mode 100644 index e7df346..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Cursor.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Cursor.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Cursor.mat.meta deleted file mode 100644 index bf872e1..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Cursor.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 6e42c90cd211e40278389f82657608d2 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Decal.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Decal.mat deleted file mode 100644 index f06da80..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Decal.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Decal.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Decal.mat.meta deleted file mode 100644 index 398f584..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Decal.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 5231caf19bce04df29d48d73a92356f2 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/GlowPlane.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/GlowPlane.mat deleted file mode 100644 index 6c30a02..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/GlowPlane.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/GlowPlane.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/GlowPlane.mat.meta deleted file mode 100644 index a3ed01f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/GlowPlane.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 8f72bd63908224f2bb00f3844f7d1018 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/LaserDot.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/LaserDot.mat deleted file mode 100644 index 15c16f5..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/LaserDot.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/LaserDot.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/LaserDot.mat.meta deleted file mode 100644 index ce5da54..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/LaserDot.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 40ddda021ce77480d8a47a41b57bbb6a -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/LaserMaterial.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/LaserMaterial.mat deleted file mode 100644 index dad1cda..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/LaserMaterial.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/LaserMaterial.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/LaserMaterial.mat.meta deleted file mode 100644 index 4110986..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/LaserMaterial.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: ebf996884992847a8bf2f4f12b04677c -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Reflection.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Reflection.mat deleted file mode 100644 index 5fadf7b..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Reflection.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Reflection.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Reflection.mat.meta deleted file mode 100644 index eb4c106..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Reflection.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 22b43c3aa0097483d92b4cca9adbb7f3 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Trail.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Trail.mat deleted file mode 100644 index a7d71c2..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Trail.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Trail.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Trail.mat.meta deleted file mode 100644 index 979737d..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/Trail.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 436a8033c36e41c47a6e2a1cfd0dcb04 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/healthbar_player.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/healthbar_player.mat deleted file mode 100644 index 35e29ef..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/healthbar_player.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/healthbar_player.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/healthbar_player.mat.meta deleted file mode 100644 index a8c32f1..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/healthbar_player.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: ccc8b5039e68def429242f31cb9ff971 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/minebot_diffuse.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/minebot_diffuse.mat deleted file mode 100644 index a3e4163..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/minebot_diffuse.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/minebot_diffuse.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/minebot_diffuse.mat.meta deleted file mode 100644 index f37dff6..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/minebot_diffuse.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: ca159162814614f2e96f37b3192a5868 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/weapon.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/weapon.mat deleted file mode 100644 index ee6c054..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/weapon.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/weapon.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/weapon.mat.meta deleted file mode 100644 index 7afaa5c..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Materials/weapon.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 0723fdd1d7ab0e447bf8a9f28e4a19a1 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects.meta deleted file mode 100644 index 7c3df65..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: d16e4419eeb3b894290e3f152e0210f2 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies.meta deleted file mode 100644 index 94d21d3..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: f2fb0a761a130da4aaa15801b5687b61 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot.FBX b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot.FBX deleted file mode 100644 index 6c1483c..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot.FBX and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot.FBX.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot.FBX.meta deleted file mode 100644 index 2b7de40..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot.FBX.meta +++ /dev/null @@ -1,112 +0,0 @@ -fileFormatVersion: 2 -guid: caeffedc34d9f4161b7694ad0d84bbd3 -ModelImporter: - serializedVersion: 15 - fileIDToRecycleName: - 100000: minebot_front_upperleg 1 - 100002: minebot_left_lowerleg - 100004: minebot_left_upperleg - 100006: minebot_back_lowerleg - 100008: minebot_front_upperleg - 100010: minebot_right_lowerleg - 100012: minebot_right_upperleg - 100014: //RootNode - 100016: minebot_main - 100018: minebot_head - 100020: minebot_front_lowerleg - 400000: minebot_front_upperleg 1 - 400002: minebot_left_lowerleg - 400004: minebot_left_upperleg - 400006: minebot_back_lowerleg - 400008: minebot_front_upperleg - 400010: minebot_right_lowerleg - 400012: minebot_right_upperleg - 400014: //RootNode - 400016: minebot_main - 400018: minebot_head - 400020: minebot_front_lowerleg - 2300000: minebot_front_upperleg 1 - 2300002: minebot_left_lowerleg - 2300004: minebot_left_upperleg - 2300006: minebot_back_lowerleg - 2300008: minebot_front_upperleg - 2300010: minebot_right_lowerleg - 2300012: minebot_right_upperleg - 2300014: minebot_main - 2300016: minebot_head - 2300018: minebot_front_lowerleg - 3300000: minebot_front_upperleg 1 - 3300002: minebot_left_lowerleg - 3300004: minebot_left_upperleg - 3300006: minebot_back_lowerleg - 3300008: minebot_front_upperleg - 3300010: minebot_right_lowerleg - 3300012: minebot_right_upperleg - 3300014: minebot_main - 3300016: minebot_head - 3300018: minebot_front_lowerleg - 4300000: minebot_main - 4300002: minebot_right_upperleg - 4300004: minebot_right_lowerleg - 4300006: minebot_head - 4300008: minebot_front_upperleg - 4300010: minebot_back_lowerleg - 4300012: minebot_left_upperleg - 4300014: minebot_left_lowerleg - 4300016: minebot_front_upperleg - 4300018: minebot_front_lowerleg - 7400004: Take 001 - 7400006: __preview__Take 001 - 11100000: //RootNode - materials: - importMaterials: 1 - materialName: 3 - materialSearch: 1 - animations: - legacyGenerateAnimations: 3 - bakeSimulation: 0 - optimizeGameObjects: 0 - animationCompression: 1 - animationRotationError: .5 - animationPositionError: .5 - animationScaleError: .5 - animationWrapMode: 0 - extraExposedTransformPaths: [] - clipAnimations: [] - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: .0130000003 - meshCompression: 0 - addColliders: 0 - importBlendShapes: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - weldVertices: 1 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - tangentSpace: - normalSmoothAngle: 60 - splitTangentsAcrossUV: 1 - normalImportMode: 0 - tangentImportMode: 1 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - human: [] - skeleton: [] - armTwist: .5 - foreArmTwist: .5 - upperLegTwist: .5 - legTwist: .5 - armStretch: .0500000007 - legStretch: .0500000007 - feetSpacing: 0 - rootMotionBoneName: - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 1 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@awake.FBX b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@awake.FBX deleted file mode 100644 index 6c1483c..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@awake.FBX and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@awake.FBX.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@awake.FBX.meta deleted file mode 100644 index 3a26b1e..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@awake.FBX.meta +++ /dev/null @@ -1,112 +0,0 @@ -fileFormatVersion: 2 -guid: 7e212db0aa2c00b448aa511ece336f20 -ModelImporter: - serializedVersion: 15 - fileIDToRecycleName: - 100000: minebot_front_upperleg 1 - 100002: minebot_left_lowerleg - 100004: minebot_left_upperleg - 100006: minebot_back_lowerleg - 100008: minebot_front_upperleg - 100010: minebot_right_lowerleg - 100012: minebot_right_upperleg - 100014: //RootNode - 100016: minebot_main - 100018: minebot_head - 100020: minebot_front_lowerleg - 400000: minebot_front_upperleg 1 - 400002: minebot_left_lowerleg - 400004: minebot_left_upperleg - 400006: minebot_back_lowerleg - 400008: minebot_front_upperleg - 400010: minebot_right_lowerleg - 400012: minebot_right_upperleg - 400014: //RootNode - 400016: minebot_main - 400018: minebot_head - 400020: minebot_front_lowerleg - 2300000: minebot_front_upperleg 1 - 2300002: minebot_left_lowerleg - 2300004: minebot_left_upperleg - 2300006: minebot_back_lowerleg - 2300008: minebot_front_upperleg - 2300010: minebot_right_lowerleg - 2300012: minebot_right_upperleg - 2300014: minebot_main - 2300016: minebot_head - 2300018: minebot_front_lowerleg - 3300000: minebot_front_upperleg 1 - 3300002: minebot_left_lowerleg - 3300004: minebot_left_upperleg - 3300006: minebot_back_lowerleg - 3300008: minebot_front_upperleg - 3300010: minebot_right_lowerleg - 3300012: minebot_right_upperleg - 3300014: minebot_main - 3300016: minebot_head - 3300018: minebot_front_lowerleg - 4300000: minebot_main - 4300002: minebot_right_upperleg - 4300004: minebot_right_lowerleg - 4300006: minebot_head - 4300008: minebot_front_upperleg - 4300010: minebot_back_lowerleg - 4300012: minebot_left_upperleg - 4300014: minebot_left_lowerleg - 4300016: minebot_front_upperleg - 4300018: minebot_front_lowerleg - 7400002: Take 001 - 7400004: __preview__Take 001 - 11100000: //RootNode - materials: - importMaterials: 1 - materialName: 3 - materialSearch: 1 - animations: - legacyGenerateAnimations: 3 - bakeSimulation: 0 - optimizeGameObjects: 0 - animationCompression: 1 - animationRotationError: .5 - animationPositionError: .5 - animationScaleError: .5 - animationWrapMode: 8 - extraExposedTransformPaths: [] - clipAnimations: [] - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: .0130000003 - meshCompression: 0 - addColliders: 0 - importBlendShapes: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - weldVertices: 1 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - tangentSpace: - normalSmoothAngle: 60 - splitTangentsAcrossUV: 1 - normalImportMode: 0 - tangentImportMode: 1 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - human: [] - skeleton: [] - armTwist: .5 - foreArmTwist: .5 - upperLegTwist: .5 - legTwist: .5 - armStretch: .0500000007 - legStretch: .0500000007 - feetSpacing: 0 - rootMotionBoneName: - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 1 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@back.FBX b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@back.FBX deleted file mode 100644 index 6c20f33..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@back.FBX and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@back.FBX.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@back.FBX.meta deleted file mode 100644 index 0cd3354..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@back.FBX.meta +++ /dev/null @@ -1,112 +0,0 @@ -fileFormatVersion: 2 -guid: a13fed205b1fa3942abfab7ba21463ec -ModelImporter: - serializedVersion: 15 - fileIDToRecycleName: - 100000: minebot_main - 100002: //RootNode - 100004: minebot_head - 100006: minebot_back_lowerleg - 100008: minebot_front_lowerleg - 100010: minebot_left_lowerleg - 100012: minebot_front_upperleg - 100014: minebot_front_upperleg 1 - 100016: minebot_right_lowerleg - 100018: minebot_right_upperleg - 100020: minebot_left_upperleg - 400000: minebot_main - 400002: //RootNode - 400004: minebot_head - 400006: minebot_back_lowerleg - 400008: minebot_front_lowerleg - 400010: minebot_left_lowerleg - 400012: minebot_front_upperleg - 400014: minebot_front_upperleg 1 - 400016: minebot_right_lowerleg - 400018: minebot_right_upperleg - 400020: minebot_left_upperleg - 2300000: minebot_main - 2300002: minebot_head - 2300004: minebot_back_lowerleg - 2300006: minebot_front_lowerleg - 2300008: minebot_left_lowerleg - 2300010: minebot_front_upperleg - 2300012: minebot_front_upperleg 1 - 2300014: minebot_right_lowerleg - 2300016: minebot_right_upperleg - 2300018: minebot_left_upperleg - 3300000: minebot_main - 3300002: minebot_head - 3300004: minebot_back_lowerleg - 3300006: minebot_front_lowerleg - 3300008: minebot_left_lowerleg - 3300010: minebot_front_upperleg - 3300012: minebot_front_upperleg 1 - 3300014: minebot_right_lowerleg - 3300016: minebot_right_upperleg - 3300018: minebot_left_upperleg - 4300000: minebot_main - 4300002: minebot_right_upperleg - 4300004: minebot_right_lowerleg - 4300006: minebot_head - 4300008: minebot_front_upperleg - 4300010: minebot_back_lowerleg - 4300012: minebot_left_upperleg - 4300014: minebot_left_lowerleg - 4300016: minebot_front_upperleg - 4300018: minebot_front_lowerleg - 7400002: Take 001 - 7400004: __preview__Take 001 - 11100000: //RootNode - materials: - importMaterials: 1 - materialName: 3 - materialSearch: 1 - animations: - legacyGenerateAnimations: 3 - bakeSimulation: 0 - optimizeGameObjects: 0 - animationCompression: 1 - animationRotationError: .5 - animationPositionError: .5 - animationScaleError: .5 - animationWrapMode: 2 - extraExposedTransformPaths: [] - clipAnimations: [] - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: .0130000003 - meshCompression: 0 - addColliders: 0 - importBlendShapes: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - weldVertices: 1 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - tangentSpace: - normalSmoothAngle: 60 - splitTangentsAcrossUV: 1 - normalImportMode: 0 - tangentImportMode: 1 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - human: [] - skeleton: [] - armTwist: .5 - foreArmTwist: .5 - upperLegTwist: .5 - legTwist: .5 - armStretch: .0500000007 - legStretch: .0500000007 - feetSpacing: 0 - rootMotionBoneName: - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 1 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@forward.FBX b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@forward.FBX deleted file mode 100644 index 534e64a..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@forward.FBX and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@forward.FBX.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@forward.FBX.meta deleted file mode 100644 index d1dcf65..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@forward.FBX.meta +++ /dev/null @@ -1,112 +0,0 @@ -fileFormatVersion: 2 -guid: 1da85f72a7a82bc4eabdbd8f0683bde2 -ModelImporter: - serializedVersion: 15 - fileIDToRecycleName: - 100000: //RootNode - 100002: minebot_main - 100004: minebot_head - 100006: minebot_back_lowerleg - 100008: minebot_front_upperleg 1 - 100010: minebot_left_lowerleg - 100012: minebot_front_upperleg - 100014: minebot_right_lowerleg - 100016: minebot_front_lowerleg - 100018: minebot_right_upperleg - 100020: minebot_left_upperleg - 400000: //RootNode - 400002: minebot_main - 400004: minebot_head - 400006: minebot_back_lowerleg - 400008: minebot_front_upperleg 1 - 400010: minebot_left_lowerleg - 400012: minebot_front_upperleg - 400014: minebot_right_lowerleg - 400016: minebot_front_lowerleg - 400018: minebot_right_upperleg - 400020: minebot_left_upperleg - 2300000: minebot_main - 2300002: minebot_head - 2300004: minebot_back_lowerleg - 2300006: minebot_front_upperleg 1 - 2300008: minebot_left_lowerleg - 2300010: minebot_front_upperleg - 2300012: minebot_right_lowerleg - 2300014: minebot_front_lowerleg - 2300016: minebot_right_upperleg - 2300018: minebot_left_upperleg - 3300000: minebot_main - 3300002: minebot_head - 3300004: minebot_back_lowerleg - 3300006: minebot_front_upperleg 1 - 3300008: minebot_left_lowerleg - 3300010: minebot_front_upperleg - 3300012: minebot_right_lowerleg - 3300014: minebot_front_lowerleg - 3300016: minebot_right_upperleg - 3300018: minebot_left_upperleg - 4300000: minebot_main - 4300002: minebot_right_upperleg - 4300004: minebot_right_lowerleg - 4300006: minebot_head - 4300008: minebot_front_upperleg - 4300010: minebot_back_lowerleg - 4300012: minebot_left_upperleg - 4300014: minebot_left_lowerleg - 4300016: minebot_front_upperleg - 4300018: minebot_front_lowerleg - 7400002: Take 001 - 7400004: __preview__Take 001 - 11100000: //RootNode - materials: - importMaterials: 1 - materialName: 3 - materialSearch: 1 - animations: - legacyGenerateAnimations: 3 - bakeSimulation: 0 - optimizeGameObjects: 0 - animationCompression: 1 - animationRotationError: .5 - animationPositionError: .5 - animationScaleError: .5 - animationWrapMode: 2 - extraExposedTransformPaths: [] - clipAnimations: [] - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: .0130000003 - meshCompression: 0 - addColliders: 0 - importBlendShapes: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - weldVertices: 1 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - tangentSpace: - normalSmoothAngle: 60 - splitTangentsAcrossUV: 1 - normalImportMode: 0 - tangentImportMode: 1 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - human: [] - skeleton: [] - armTwist: .5 - foreArmTwist: .5 - upperLegTwist: .5 - legTwist: .5 - armStretch: .0500000007 - legStretch: .0500000007 - feetSpacing: 0 - rootMotionBoneName: - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 1 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@left.FBX b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@left.FBX deleted file mode 100644 index 8fed363..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@left.FBX and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@left.FBX.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@left.FBX.meta deleted file mode 100644 index 365018a..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@left.FBX.meta +++ /dev/null @@ -1,112 +0,0 @@ -fileFormatVersion: 2 -guid: b667956babf1f0446a76fa8b99404ab8 -ModelImporter: - serializedVersion: 15 - fileIDToRecycleName: - 100000: minebot_head - 100002: //RootNode - 100004: minebot_main - 100006: minebot_back_lowerleg - 100008: minebot_front_lowerleg - 100010: minebot_front_upperleg 1 - 100012: minebot_right_upperleg - 100014: minebot_left_lowerleg - 100016: minebot_left_upperleg - 100018: minebot_right_lowerleg - 100020: minebot_front_upperleg - 400000: minebot_head - 400002: //RootNode - 400004: minebot_main - 400006: minebot_back_lowerleg - 400008: minebot_front_lowerleg - 400010: minebot_front_upperleg 1 - 400012: minebot_right_upperleg - 400014: minebot_left_lowerleg - 400016: minebot_left_upperleg - 400018: minebot_right_lowerleg - 400020: minebot_front_upperleg - 2300000: minebot_head - 2300002: minebot_main - 2300004: minebot_back_lowerleg - 2300006: minebot_front_lowerleg - 2300008: minebot_front_upperleg 1 - 2300010: minebot_right_upperleg - 2300012: minebot_left_lowerleg - 2300014: minebot_left_upperleg - 2300016: minebot_right_lowerleg - 2300018: minebot_front_upperleg - 3300000: minebot_head - 3300002: minebot_main - 3300004: minebot_back_lowerleg - 3300006: minebot_front_lowerleg - 3300008: minebot_front_upperleg 1 - 3300010: minebot_right_upperleg - 3300012: minebot_left_lowerleg - 3300014: minebot_left_upperleg - 3300016: minebot_right_lowerleg - 3300018: minebot_front_upperleg - 4300000: minebot_main - 4300002: minebot_right_upperleg - 4300004: minebot_right_lowerleg - 4300006: minebot_head - 4300008: minebot_front_upperleg - 4300010: minebot_back_lowerleg - 4300012: minebot_left_upperleg - 4300014: minebot_left_lowerleg - 4300016: minebot_front_upperleg - 4300018: minebot_front_lowerleg - 7400002: Take 001 - 7400004: __preview__Take 001 - 11100000: //RootNode - materials: - importMaterials: 1 - materialName: 3 - materialSearch: 1 - animations: - legacyGenerateAnimations: 3 - bakeSimulation: 0 - optimizeGameObjects: 0 - animationCompression: 1 - animationRotationError: .5 - animationPositionError: .5 - animationScaleError: .5 - animationWrapMode: 2 - extraExposedTransformPaths: [] - clipAnimations: [] - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: .0130000003 - meshCompression: 0 - addColliders: 0 - importBlendShapes: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - weldVertices: 1 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - tangentSpace: - normalSmoothAngle: 60 - splitTangentsAcrossUV: 1 - normalImportMode: 0 - tangentImportMode: 1 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - human: [] - skeleton: [] - armTwist: .5 - foreArmTwist: .5 - upperLegTwist: .5 - legTwist: .5 - armStretch: .0500000007 - legStretch: .0500000007 - feetSpacing: 0 - rootMotionBoneName: - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 1 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@right.FBX b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@right.FBX deleted file mode 100644 index e9d23f8..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@right.FBX and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@right.FBX.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@right.FBX.meta deleted file mode 100644 index 6ff0558..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Enemies/mine_bot@right.FBX.meta +++ /dev/null @@ -1,112 +0,0 @@ -fileFormatVersion: 2 -guid: f8136785e54fd1d459d2a3a0849fe770 -ModelImporter: - serializedVersion: 15 - fileIDToRecycleName: - 100000: minebot_head - 100002: minebot_main - 100004: //RootNode - 100006: minebot_front_lowerleg - 100008: minebot_back_lowerleg - 100010: minebot_front_upperleg - 100012: minebot_left_lowerleg - 100014: minebot_right_upperleg - 100016: minebot_front_upperleg 1 - 100018: minebot_left_upperleg - 100020: minebot_right_lowerleg - 400000: minebot_head - 400002: minebot_main - 400004: //RootNode - 400006: minebot_front_lowerleg - 400008: minebot_back_lowerleg - 400010: minebot_front_upperleg - 400012: minebot_left_lowerleg - 400014: minebot_right_upperleg - 400016: minebot_front_upperleg 1 - 400018: minebot_left_upperleg - 400020: minebot_right_lowerleg - 2300000: minebot_head - 2300002: minebot_main - 2300004: minebot_front_lowerleg - 2300006: minebot_back_lowerleg - 2300008: minebot_front_upperleg - 2300010: minebot_left_lowerleg - 2300012: minebot_right_upperleg - 2300014: minebot_front_upperleg 1 - 2300016: minebot_left_upperleg - 2300018: minebot_right_lowerleg - 3300000: minebot_head - 3300002: minebot_main - 3300004: minebot_front_lowerleg - 3300006: minebot_back_lowerleg - 3300008: minebot_front_upperleg - 3300010: minebot_left_lowerleg - 3300012: minebot_right_upperleg - 3300014: minebot_front_upperleg 1 - 3300016: minebot_left_upperleg - 3300018: minebot_right_lowerleg - 4300000: minebot_main - 4300002: minebot_right_upperleg - 4300004: minebot_right_lowerleg - 4300006: minebot_head - 4300008: minebot_front_upperleg - 4300010: minebot_back_lowerleg - 4300012: minebot_left_upperleg - 4300014: minebot_left_lowerleg - 4300016: minebot_front_upperleg - 4300018: minebot_front_lowerleg - 7400002: Take 001 - 7400004: __preview__Take 001 - 11100000: //RootNode - materials: - importMaterials: 1 - materialName: 3 - materialSearch: 1 - animations: - legacyGenerateAnimations: 3 - bakeSimulation: 0 - optimizeGameObjects: 0 - animationCompression: 1 - animationRotationError: .5 - animationPositionError: .5 - animationScaleError: .5 - animationWrapMode: 2 - extraExposedTransformPaths: [] - clipAnimations: [] - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: .0130000003 - meshCompression: 0 - addColliders: 0 - importBlendShapes: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - weldVertices: 1 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - tangentSpace: - normalSmoothAngle: 60 - splitTangentsAcrossUV: 1 - normalImportMode: 0 - tangentImportMode: 1 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - human: [] - skeleton: [] - armTwist: .5 - foreArmTwist: .5 - upperLegTwist: .5 - legTwist: .5 - armStretch: .0500000007 - legStretch: .0500000007 - feetSpacing: 0 - rootMotionBoneName: - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 1 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc.meta deleted file mode 100644 index 1213020..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 282bb665344fe014f957fd7922c70f30 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Bullet.FBX b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Bullet.FBX deleted file mode 100644 index b395d6b..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Bullet.FBX and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Bullet.FBX.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Bullet.FBX.meta deleted file mode 100644 index e4f4bbb..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Bullet.FBX.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: 574d4e5bea2d7f246bf8164d1c47b6d8 -ModelImporter: - serializedVersion: 15 - fileIDToRecycleName: - 100000: //RootNode - 400000: //RootNode - 2300000: //RootNode - 3300000: //RootNode - 4300000: Plane001 - 11100000: //RootNode - materials: - importMaterials: 1 - materialName: 3 - materialSearch: 1 - animations: - legacyGenerateAnimations: 3 - bakeSimulation: 0 - optimizeGameObjects: 0 - animationCompression: 1 - animationRotationError: .5 - animationPositionError: .5 - animationScaleError: .5 - animationWrapMode: 0 - extraExposedTransformPaths: [] - clipAnimations: [] - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: .0799999982 - meshCompression: 0 - addColliders: 0 - importBlendShapes: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - weldVertices: 1 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - tangentSpace: - normalSmoothAngle: 60 - splitTangentsAcrossUV: 1 - normalImportMode: 0 - tangentImportMode: 1 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - human: [] - skeleton: [] - armTwist: .5 - foreArmTwist: .5 - upperLegTwist: .5 - legTwist: .5 - armStretch: .0500000007 - legStretch: .0500000007 - feetSpacing: 0 - rootMotionBoneName: - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 1 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials.meta deleted file mode 100644 index 6017e1d..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: e8d8fd46dd67c564a8761e0a9dbeb173 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/Bullet-bullet.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/Bullet-bullet.mat deleted file mode 100644 index 7b97035..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/Bullet-bullet.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/Bullet-bullet.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/Bullet-bullet.mat.meta deleted file mode 100644 index 1ed6291..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/Bullet-bullet.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 6c055f79c6e034b65be556accf6daa36 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/PlaneSmall-lambert2.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/PlaneSmall-lambert2.mat deleted file mode 100644 index 594d82f..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/PlaneSmall-lambert2.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/PlaneSmall-lambert2.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/PlaneSmall-lambert2.mat.meta deleted file mode 100644 index 0be3918..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/PlaneSmall-lambert2.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 01a4676f80a3044a0a7082b6086b8eba -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/plane-lambert2.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/plane-lambert2.mat deleted file mode 100644 index 438285e..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/plane-lambert2.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/plane-lambert2.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/plane-lambert2.mat.meta deleted file mode 100644 index fbe0961..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Materials/plane-lambert2.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: a43bd3ae495384d7e8bbb5f2e9df3fb9 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Plane.fbx b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Plane.fbx deleted file mode 100644 index d51783b..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Plane.fbx and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Plane.fbx.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Plane.fbx.meta deleted file mode 100644 index a2a69e8..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/Plane.fbx.meta +++ /dev/null @@ -1,64 +0,0 @@ -fileFormatVersion: 2 -guid: e7a62e43c54d44bd78af31fe1202ce68 -ModelImporter: - serializedVersion: 15 - fileIDToRecycleName: - 100000: //RootNode - 400000: //RootNode - 2300000: //RootNode - 2800000: __AssetImporterPreview - 3300000: //RootNode - 4300000: pPlane2 - 11100000: //RootNode - materials: - importMaterials: 1 - materialName: 3 - materialSearch: 1 - animations: - legacyGenerateAnimations: 3 - bakeSimulation: 0 - optimizeGameObjects: 0 - animationCompression: 1 - animationRotationError: .5 - animationPositionError: .5 - animationScaleError: .5 - animationWrapMode: 0 - extraExposedTransformPaths: [] - clipAnimations: [] - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: 1 - meshCompression: 0 - addColliders: 0 - importBlendShapes: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - weldVertices: 1 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - tangentSpace: - normalSmoothAngle: 60 - splitTangentsAcrossUV: 0 - normalImportMode: 0 - tangentImportMode: 1 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - human: [] - skeleton: [] - armTwist: .5 - foreArmTwist: .5 - upperLegTwist: .5 - legTwist: .5 - armStretch: .0500000007 - legStretch: .0500000007 - feetSpacing: 0 - rootMotionBoneName: - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 1 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/PlaneSmall.fbx b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/PlaneSmall.fbx deleted file mode 100644 index d51783b..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/PlaneSmall.fbx and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/PlaneSmall.fbx.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/PlaneSmall.fbx.meta deleted file mode 100644 index 235b05e..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Misc/PlaneSmall.fbx.meta +++ /dev/null @@ -1,64 +0,0 @@ -fileFormatVersion: 2 -guid: c3ae12cf00fcf482788b4b27e3558870 -ModelImporter: - serializedVersion: 15 - fileIDToRecycleName: - 100000: //RootNode - 400000: //RootNode - 2300000: //RootNode - 2800000: __AssetImporterPreview - 3300000: //RootNode - 4300000: pPlane2 - 11100000: //RootNode - materials: - importMaterials: 1 - materialName: 3 - materialSearch: 1 - animations: - legacyGenerateAnimations: 3 - bakeSimulation: 0 - optimizeGameObjects: 0 - animationCompression: 1 - animationRotationError: .5 - animationPositionError: .5 - animationScaleError: .5 - animationWrapMode: 0 - extraExposedTransformPaths: [] - clipAnimations: [] - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: .0799999982 - meshCompression: 0 - addColliders: 0 - importBlendShapes: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - weldVertices: 1 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - tangentSpace: - normalSmoothAngle: 60 - splitTangentsAcrossUV: 0 - normalImportMode: 0 - tangentImportMode: 1 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - human: [] - skeleton: [] - armTwist: .5 - foreArmTwist: .5 - upperLegTwist: .5 - legTwist: .5 - armStretch: .0500000007 - legStretch: .0500000007 - feetSpacing: 0 - rootMotionBoneName: - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 1 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player.meta deleted file mode 100644 index 064e62a..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 0b333964df5fb68459b423c90b9f1680 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials.meta deleted file mode 100644 index 29d4687..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: ead423728eb8c8344a1be86bfe8f67ed -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/muzzleFlash-lambert21.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/muzzleFlash-lambert21.mat deleted file mode 100644 index 28d6896..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/muzzleFlash-lambert21.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/muzzleFlash-lambert21.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/muzzleFlash-lambert21.mat.meta deleted file mode 100644 index 24acbb6..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/muzzleFlash-lambert21.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: ba563644c5a6647a4aad401ce54ac8cc -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/player-01 - default.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/player-01 - default.mat deleted file mode 100644 index fe47304..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/player-01 - default.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/player-01 - default.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/player-01 - default.mat.meta deleted file mode 100644 index 7370958..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/player-01 - default.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 57dae6752ad0b7d47b1efb90ad62208c -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/player-healthglow.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/player-healthglow.mat deleted file mode 100644 index fdc6537..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/player-healthglow.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/player-healthglow.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/player-healthglow.mat.meta deleted file mode 100644 index 2e337b9..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Materials/player-healthglow.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 819226f6e5961434087c87bab9a2e025 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/MuzzleFlash.fbx b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/MuzzleFlash.fbx deleted file mode 100644 index 379638b..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/MuzzleFlash.fbx and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/MuzzleFlash.fbx.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/MuzzleFlash.fbx.meta deleted file mode 100644 index a28bb36..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/MuzzleFlash.fbx.meta +++ /dev/null @@ -1,63 +0,0 @@ -fileFormatVersion: 2 -guid: 2ad21cc5b2a724b64ba4c729939d59d9 -ModelImporter: - serializedVersion: 15 - fileIDToRecycleName: - 100000: //RootNode - 400000: //RootNode - 2300000: //RootNode - 3300000: //RootNode - 4300000: pPlane441 - 11100000: //RootNode - materials: - importMaterials: 1 - materialName: 3 - materialSearch: 1 - animations: - legacyGenerateAnimations: 0 - bakeSimulation: 0 - optimizeGameObjects: 0 - animationCompression: 1 - animationRotationError: .5 - animationPositionError: .5 - animationScaleError: .5 - animationWrapMode: 0 - extraExposedTransformPaths: [] - clipAnimations: [] - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: .5 - meshCompression: 0 - addColliders: 0 - importBlendShapes: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - weldVertices: 1 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - tangentSpace: - normalSmoothAngle: 60 - splitTangentsAcrossUV: 1 - normalImportMode: 0 - tangentImportMode: 1 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - human: [] - skeleton: [] - armTwist: .5 - foreArmTwist: .5 - upperLegTwist: .5 - legTwist: .5 - armStretch: .0500000007 - legStretch: .0500000007 - feetSpacing: 0 - rootMotionBoneName: - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 1 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Player.FBX b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Player.FBX deleted file mode 100644 index 6773b56..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Player.FBX and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Player.FBX.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Player.FBX.meta deleted file mode 100644 index 0ddc420..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Objects/Player/Player.FBX.meta +++ /dev/null @@ -1,306 +0,0 @@ -fileFormatVersion: 2 -guid: df1f47a0a2effe74488d5da197295a19 -ModelImporter: - serializedVersion: 15 - fileIDToRecycleName: - 100000: //RootNode - 100002: player_root - 100004: Bip001 Footsteps - 100012: Bip001 R Toe0 - 100014: Bip001 R Foot - 100016: Bip001 R Calf - 100018: Bip001 R Thigh - 100020: Bip001 L Toe0 - 100022: Bip001 L Foot - 100024: Bip001 L Calf - 100026: Bip001 L Thigh - 100028: main_weapon001 - 100030: Bip001 R Hand - 100032: Bip001 L Hand - 100034: Bip001 HeadNub - 100036: Bip001 Head - 100038: Bip001 Neck - 100040: Bip001 Spine1 - 100042: Bip001 Spine - 100044: Bip001 Pelvis - 100046: Bip001 - 100048: Bip001 R Toe0Nub - 100050: Bip001 L Toe0Nub - 100052: Bip001 R Finger2Nub - 100054: Bip001 R Finger21 - 100056: Bip001 R Finger2 - 100058: Bip001 R Finger1Nub - 100060: Bip001 R Finger11 - 100062: Bip001 R Finger1 - 100064: Bip001 R Finger0Nub - 100066: Bip001 R Finger01 - 100068: Bip001 R Finger0 - 100070: Bip001 R Forearm - 100072: Bip001 R UpperArm - 100074: Bip001 R Clavicle - 100076: Bip001 L Finger2Nub - 100078: Bip001 L Finger21 - 100080: Bip001 L Finger2 - 100082: Bip001 L Finger1Nub - 100084: Bip001 L Finger11 - 100086: Bip001 L Finger1 - 100088: Bip001 L Finger0Nub - 100090: Bip001 L Finger01 - 100092: Bip001 L Finger0 - 100094: Bip001 L Forearm - 100096: Bip001 L UpperArm - 100098: Bip001 L Clavicle - 100100: main_player_lorez - 400000: //RootNode - 400002: player_root - 400004: Bip001 Footsteps - 400012: Bip001 R Toe0 - 400014: Bip001 R Foot - 400016: Bip001 R Calf - 400018: Bip001 R Thigh - 400020: Bip001 L Toe0 - 400022: Bip001 L Foot - 400024: Bip001 L Calf - 400026: Bip001 L Thigh - 400028: main_weapon001 - 400030: Bip001 R Hand - 400032: Bip001 L Hand - 400034: Bip001 HeadNub - 400036: Bip001 Head - 400038: Bip001 Neck - 400040: Bip001 Spine1 - 400042: Bip001 Spine - 400044: Bip001 Pelvis - 400046: Bip001 - 400048: Bip001 R Toe0Nub - 400050: Bip001 L Toe0Nub - 400052: Bip001 R Finger2Nub - 400054: Bip001 R Finger21 - 400056: Bip001 R Finger2 - 400058: Bip001 R Finger1Nub - 400060: Bip001 R Finger11 - 400062: Bip001 R Finger1 - 400064: Bip001 R Finger0Nub - 400066: Bip001 R Finger01 - 400068: Bip001 R Finger0 - 400070: Bip001 R Forearm - 400072: Bip001 R UpperArm - 400074: Bip001 R Clavicle - 400076: Bip001 L Finger2Nub - 400078: Bip001 L Finger21 - 400080: Bip001 L Finger2 - 400082: Bip001 L Finger1Nub - 400084: Bip001 L Finger11 - 400086: Bip001 L Finger1 - 400088: Bip001 L Finger0Nub - 400090: Bip001 L Finger01 - 400092: Bip001 L Finger0 - 400094: Bip001 L Forearm - 400096: Bip001 L UpperArm - 400098: Bip001 L Clavicle - 400100: main_player_lorez - 2300010: main_weapon001 - 3300010: main_weapon001 - 4300000: main_player_lorez - 4300002: main_weapon001 - 4300004: Cylinder001 - 4300006: Cylinder002 - 4300008: Cylinder003 - 4300010: Cylinder004 - 4300012: Cylinder005 - 4300014: healthbar - 7400030: idle - 7400032: run_forward - 7400034: run_backward - 7400036: run_right - 7400038: run_left - 7400040: __preview__Take 001 - 7400042: - 7400044: - 7400046: - 7400048: - 7400050: - 11100000: //RootNode - 13700000: main_player_lorez - materials: - importMaterials: 1 - materialName: 3 - materialSearch: 1 - animations: - legacyGenerateAnimations: 3 - bakeSimulation: 0 - optimizeGameObjects: 0 - animationCompression: 1 - animationRotationError: .100000001 - animationPositionError: .5 - animationScaleError: .5 - animationWrapMode: 0 - extraExposedTransformPaths: [] - clipAnimations: - - serializedVersion: 16 - name: idle - takeName: - firstFrame: 0 - lastFrame: 74 - wrapMode: 2 - orientationOffsetY: 0 - level: 0 - cycleOffset: 0 - loop: 1 - loopTime: 0 - loopBlend: 0 - loopBlendOrientation: 0 - loopBlendPositionY: 0 - loopBlendPositionXZ: 0 - keepOriginalOrientation: 0 - keepOriginalPositionY: 1 - keepOriginalPositionXZ: 0 - heightFromFeet: 0 - mirror: 0 - bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 - curves: [] - events: [] - transformMask: [] - maskType: 0 - maskSource: {instanceID: 0} - - serializedVersion: 16 - name: run_forward - takeName: - firstFrame: 76 - lastFrame: 94 - wrapMode: 2 - orientationOffsetY: 0 - level: 0 - cycleOffset: 0 - loop: 1 - loopTime: 0 - loopBlend: 0 - loopBlendOrientation: 0 - loopBlendPositionY: 0 - loopBlendPositionXZ: 0 - keepOriginalOrientation: 0 - keepOriginalPositionY: 1 - keepOriginalPositionXZ: 0 - heightFromFeet: 0 - mirror: 0 - bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 - curves: [] - events: [] - transformMask: [] - maskType: 0 - maskSource: {instanceID: 0} - - serializedVersion: 16 - name: run_backward - takeName: - firstFrame: 96 - lastFrame: 114 - wrapMode: 2 - orientationOffsetY: 0 - level: 0 - cycleOffset: 0 - loop: 1 - loopTime: 0 - loopBlend: 0 - loopBlendOrientation: 0 - loopBlendPositionY: 0 - loopBlendPositionXZ: 0 - keepOriginalOrientation: 0 - keepOriginalPositionY: 1 - keepOriginalPositionXZ: 0 - heightFromFeet: 0 - mirror: 0 - bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 - curves: [] - events: [] - transformMask: [] - maskType: 0 - maskSource: {instanceID: 0} - - serializedVersion: 16 - name: run_right - takeName: - firstFrame: 116 - lastFrame: 134 - wrapMode: 2 - orientationOffsetY: 0 - level: 0 - cycleOffset: 0 - loop: 1 - loopTime: 0 - loopBlend: 0 - loopBlendOrientation: 0 - loopBlendPositionY: 0 - loopBlendPositionXZ: 0 - keepOriginalOrientation: 0 - keepOriginalPositionY: 1 - keepOriginalPositionXZ: 0 - heightFromFeet: 0 - mirror: 0 - bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 - curves: [] - events: [] - transformMask: [] - maskType: 0 - maskSource: {instanceID: 0} - - serializedVersion: 16 - name: run_left - takeName: - firstFrame: 136 - lastFrame: 154 - wrapMode: 2 - orientationOffsetY: 0 - level: 0 - cycleOffset: 0 - loop: 1 - loopTime: 0 - loopBlend: 0 - loopBlendOrientation: 0 - loopBlendPositionY: 0 - loopBlendPositionXZ: 0 - keepOriginalOrientation: 0 - keepOriginalPositionY: 1 - keepOriginalPositionXZ: 0 - heightFromFeet: 0 - mirror: 0 - bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 - curves: [] - events: [] - transformMask: [] - maskType: 0 - maskSource: {instanceID: 0} - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: .0120000001 - meshCompression: 0 - addColliders: 0 - importBlendShapes: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - weldVertices: 1 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - tangentSpace: - normalSmoothAngle: 60 - splitTangentsAcrossUV: 1 - normalImportMode: 0 - tangentImportMode: 1 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - human: [] - skeleton: [] - armTwist: .5 - foreArmTwist: .5 - upperLegTwist: .5 - legTwist: .5 - armStretch: .0500000007 - legStretch: .0500000007 - feetSpacing: 0 - rootMotionBoneName: - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 1 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials.meta deleted file mode 100644 index 940598b..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 93572dd6591d1ed4b927c6b0efff59c9 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials/Enemy.physicMaterial b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials/Enemy.physicMaterial deleted file mode 100644 index 7a0cffd..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials/Enemy.physicMaterial and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials/Enemy.physicMaterial.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials/Enemy.physicMaterial.meta deleted file mode 100644 index 80d4e00..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials/Enemy.physicMaterial.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 57855795a303942438ffe7b982db920a -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials/Frictionless.physicMaterial b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials/Frictionless.physicMaterial deleted file mode 100644 index cca3cf9..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials/Frictionless.physicMaterial and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials/Frictionless.physicMaterial.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials/Frictionless.physicMaterial.meta deleted file mode 100644 index 8fa58e6..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/PhysicMaterials/Frictionless.physicMaterial.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: d35b37e7667d34205b83e85449b6d6a4 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs.meta deleted file mode 100644 index b93d0fe..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 0a0928d2ccc16f84faacff785430b418 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies.meta deleted file mode 100644 index a6aae71..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 741a5ab4ed8b5944abcf85eeb8b8665b -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies/EnemySpider.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies/EnemySpider.prefab deleted file mode 100644 index 782c93a..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies/EnemySpider.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies/EnemySpider.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies/EnemySpider.prefab.meta deleted file mode 100644 index 70dd571..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies/EnemySpider.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 61a8f246d5c514f18b5ff0a0f28693b0 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies/spiderScorchMark.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies/spiderScorchMark.prefab deleted file mode 100644 index bd38c86..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies/spiderScorchMark.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies/spiderScorchMark.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies/spiderScorchMark.prefab.meta deleted file mode 100644 index 01d71e4..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Enemies/spiderScorchMark.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 48cdb930df2e54565971b0f4c9e3ceb2 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Misc.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Misc.meta deleted file mode 100644 index 9568917..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Misc.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: e6b9ef83c63a02d4a91d57114dbea0a3 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Misc/Joystick.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Misc/Joystick.prefab deleted file mode 100644 index 2f4b47b..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Misc/Joystick.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Misc/Joystick.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Misc/Joystick.prefab.meta deleted file mode 100644 index 7b2d790..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Misc/Joystick.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 76305b7830af34f949acf9d383cf2f74 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player.meta deleted file mode 100644 index 50c1d4e..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: e8b78b23d993c1c4b8e168f511eeba4d -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player/Cursor.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player/Cursor.prefab deleted file mode 100644 index 2207c1c..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player/Cursor.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player/Cursor.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player/Cursor.prefab.meta deleted file mode 100644 index 17324fe..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player/Cursor.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 2dd326d33d99a491289f9402ad97bcc1 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player/PlayerPrefab.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player/PlayerPrefab.prefab deleted file mode 100644 index c6680d3..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player/PlayerPrefab.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player/PlayerPrefab.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player/PlayerPrefab.prefab.meta deleted file mode 100644 index 0fb2f3f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Player/PlayerPrefab.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: a8244aeb156024dfbae1997ab0ee2745 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Weapons.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Weapons.meta deleted file mode 100644 index 8f2cfc1..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Weapons.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 5a30de7ed04c705438cc6ddb7dbbad43 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Weapons/InstantBullet.prefab b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Weapons/InstantBullet.prefab deleted file mode 100644 index df2f8a7..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Weapons/InstantBullet.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Weapons/InstantBullet.prefab.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Weapons/InstantBullet.prefab.meta deleted file mode 100644 index 922cd54..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Prefabs/Weapons/InstantBullet.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 647e7d9f49e834c51991c6bd76163b2b -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts.meta deleted file mode 100644 index 0bc9cb3..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 3c5ea3d1cf5d1de438d71ed957d6740e -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI.meta deleted file mode 100644 index 8c07116..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: ba2fdd7bbd1e51843a9ae08e7fa309ca -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/AI.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/AI.js deleted file mode 100644 index a61d9ad..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/AI.js +++ /dev/null @@ -1,67 +0,0 @@ -#pragma strict - -// Public member data -public var behaviourOnSpotted : MonoBehaviour; -public var soundOnSpotted : AudioClip; -public var behaviourOnLostTrack : MonoBehaviour; - -// Private memeber data -private var character : Transform; -private var player : Transform; -private var insideInterestArea : boolean = true; - -function Awake () { - character = transform; - player = GameObject.FindWithTag ("Player").transform; -} - -function OnEnable () { - behaviourOnLostTrack.enabled = true; - behaviourOnSpotted.enabled = false; -} - -function OnTriggerEnter (other : Collider) { - if (other.transform == player && CanSeePlayer ()) { - OnSpotted (); - } -} - -function OnEnterInterestArea () { - insideInterestArea = true; -} - -function OnExitInterestArea () { - insideInterestArea = false; - OnLostTrack (); -} - -function OnSpotted () { - if (!insideInterestArea) - return; - if (!behaviourOnSpotted.enabled) { - behaviourOnSpotted.enabled = true; - behaviourOnLostTrack.enabled = false; - - if (GetComponent.() && soundOnSpotted) { - GetComponent.().clip = soundOnSpotted; - GetComponent.().Play (); - } - } -} - -function OnLostTrack () { - if (!behaviourOnLostTrack.enabled) { - behaviourOnLostTrack.enabled = true; - behaviourOnSpotted.enabled = false; - } -} - -function CanSeePlayer () : boolean { - var playerDirection : Vector3 = (player.position - character.position); - var hit : RaycastHit; - Physics.Raycast (character.position, playerDirection, hit, playerDirection.magnitude); - if (hit.collider && hit.collider.transform == player) { - return true; - } - return false; -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/AI.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/AI.js.meta deleted file mode 100644 index a54ae89..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/AI.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: eb6e22f32d1ef42f28882da13fb49f4b -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/DisableOutsideRadius.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/DisableOutsideRadius.js deleted file mode 100644 index ab55a88..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/DisableOutsideRadius.js +++ /dev/null @@ -1,41 +0,0 @@ -#pragma strict - -@script RequireComponent (SphereCollider) - -private var target : GameObject; -private var sphereCollider : SphereCollider; -private var activeRadius : float; - -function Awake () { - target = transform.parent.gameObject; - sphereCollider = GetComponent. (); - activeRadius = sphereCollider.radius; - - Disable (); -} - -function OnTriggerEnter (other : Collider) { - if (other.tag == "Player" && target.transform.parent == transform) { - Enable (); - } -} - -function OnTriggerExit (other : Collider) { - if (other.tag == "Player") { - Disable (); - } -} - -function Disable () { - transform.parent = target.transform.parent; - target.transform.parent = transform; - target.SetActive (false); - sphereCollider.radius = activeRadius; -} - -function Enable () { - target.transform.parent = transform.parent; - target.SetActive (true); - transform.parent = target.transform; - sphereCollider.radius = activeRadius * 1.1; -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/DisableOutsideRadius.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/DisableOutsideRadius.js.meta deleted file mode 100644 index b7f3a13..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/DisableOutsideRadius.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: de5c6e70ca9d046ceae3e8a5bab50c32 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/PatrolPoint.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/PatrolPoint.js deleted file mode 100644 index 36649b6..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/PatrolPoint.js +++ /dev/null @@ -1,7 +0,0 @@ -#pragma strict - -var position : Vector3; - -function Awake () { - position = transform.position; -} \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/PatrolPoint.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/PatrolPoint.js.meta deleted file mode 100644 index 3676323..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/PatrolPoint.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9a404b899ecb54ee6892c1beef12a693 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/SpiderAttackMoveController.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/SpiderAttackMoveController.js deleted file mode 100644 index 63e6856..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/SpiderAttackMoveController.js +++ /dev/null @@ -1,142 +0,0 @@ -#pragma strict - -// Public member data -public var motor : MovementMotor; - -public var targetDistanceMin : float = 2.0; -public var targetDistanceMax : float = 3.0; -public var proximityDistance : float = 4.0; -public var damageRadius : float = 5.0; -public var proximityBuildupTime : float = 2.0; -public var proximityOfNoReturn : float = 0.6; -public var damageAmount : float = 30.0; -public var proximityRenderer : Renderer; -public var audioSource : AudioSource; -public var blinkComponents : SelfIlluminationBlink[]; -public var blinkPlane : GlowPlane; - -public var intentionalExplosion : GameObject; -public var animationBehaviour : MonoBehaviour; - -// Private memeber data -private var ai : AI; - -private var character : Transform; - -private var player : Transform; - -private var inRange : boolean = false; -private var nextRaycastTime : float = 0; -private var lastRaycastSuccessfulTime : float = 0; -private var proximityLevel : float = 0; -private var lastBlinkTime : float = 0; -private var noticeTime : float = 0; - -function Awake () { - character = motor.transform; - player = GameObject.FindWithTag ("Player").transform; - ai = transform.parent.GetComponentInChildren. (); - if (!blinkComponents.Length) - blinkComponents = transform.parent.GetComponentsInChildren. (); -} - -function OnEnable () { - inRange = false; - nextRaycastTime = Time.time; - lastRaycastSuccessfulTime = Time.time; - noticeTime = Time.time; - animationBehaviour.enabled = true; - if (blinkPlane) - blinkPlane.GetComponent.().enabled = false; -} - -function OnDisable () { - if (proximityRenderer == null) - Debug.LogError ("proximityRenderer is null", this); - else if (proximityRenderer.material == null) - Debug.LogError ("proximityRenderer.material is null", this); - else - proximityRenderer.material.color = Color.white; - if (blinkPlane) - blinkPlane.GetComponent.().enabled = false; -} - -function Update () { - if (Time.time < noticeTime + 0.7) { - motor.movementDirection = Vector3.zero; - return; - } - - // Calculate the direction from the player to this character - var playerDirection : Vector3 = (player.position - character.position); - playerDirection.y = 0; - var playerDist : float = playerDirection.magnitude; - playerDirection /= playerDist; - - // Set this character to face the player, - // that is, to face the direction from this character to the player - //motor.facingDirection = playerDirection; - - if (inRange && playerDist > targetDistanceMax) - inRange = false; - if (!inRange && playerDist < targetDistanceMin) - inRange = true; - - if (inRange) - motor.movementDirection = Vector3.zero; - else - motor.movementDirection = playerDirection; - - if ((playerDist < proximityDistance && Time.time < lastRaycastSuccessfulTime + 1) || proximityLevel > proximityOfNoReturn) - proximityLevel += Time.deltaTime / proximityBuildupTime; - else - proximityLevel -= Time.deltaTime / proximityBuildupTime; - - proximityLevel = Mathf.Clamp01 (proximityLevel); - //proximityRenderer.material.color = Color.Lerp (Color.blue, Color.red, proximityLevel); - if (proximityLevel == 1) - Explode (); - - if (Time.time > nextRaycastTime) { - nextRaycastTime = Time.time + 1; - if (ai.CanSeePlayer ()) { - lastRaycastSuccessfulTime = Time.time; - } - else { - if (Time.time > lastRaycastSuccessfulTime + 2) { - ai.OnLostTrack (); - } - } - } - - var deltaBlink = 1 / Mathf.Lerp (2, 15, proximityLevel); - if (Time.time > lastBlinkTime + deltaBlink) { - lastBlinkTime = Time.time; - proximityRenderer.material.color = Color.red; - if (audioSource.enabled) - { - audioSource.Play (); - } - for (var comp : SelfIlluminationBlink in blinkComponents) { - comp.Blink (); - } - if (blinkPlane) - blinkPlane.GetComponent.().enabled = !blinkPlane.GetComponent.().enabled; - } - if (Time.time > lastBlinkTime + 0.04) { - proximityRenderer.material.color = Color.white; - } -} - -function Explode () { - var damageFraction : float = 1 - (Vector3.Distance (player.position, character.position) / damageRadius); - - var targetHealth : Health = player.GetComponent. (); - if (targetHealth) { - // Apply damage - targetHealth.OnDamage (damageAmount * damageFraction, character.position - player.position); - } - player.GetComponent.().AddExplosionForce (10, character.position, damageRadius, 0.0, ForceMode.Impulse); - Spawner.Spawn (intentionalExplosion, transform.position, Quaternion.identity); - Spawner.Destroy (character.gameObject); -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/SpiderAttackMoveController.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/SpiderAttackMoveController.js.meta deleted file mode 100644 index a0a62bc..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/SpiderAttackMoveController.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a1faac4a799dd4e8bb9040d595af2ae1 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/SpiderReturnMoveController.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/SpiderReturnMoveController.js deleted file mode 100644 index 7e827b7..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/SpiderReturnMoveController.js +++ /dev/null @@ -1,33 +0,0 @@ -#pragma strict - -// Public member data -public var motor : MovementMotor; - -// Private memeber data -private var ai : AI; - -private var character : Transform; -private var spawnPos : Vector3; -public var animationBehaviour : MonoBehaviour; - -function Awake () { - character = motor.transform; - ai = transform.parent.GetComponentInChildren. (); - spawnPos = character.position; -} - -function Update () { - motor.movementDirection = spawnPos - character.position; - motor.movementDirection.y = 0; - if (motor.movementDirection.sqrMagnitude > 1) - motor.movementDirection = motor.movementDirection.normalized; - - if (motor.movementDirection.sqrMagnitude < 0.01) { - character.position = new Vector3 (spawnPos.x, character.position.y, spawnPos.z); - motor.GetComponent.().velocity = Vector3.zero; - motor.GetComponent.().angularVelocity = Vector3.zero; - motor.movementDirection = Vector3.zero; - enabled = false; - animationBehaviour.enabled = false; - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/SpiderReturnMoveController.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/SpiderReturnMoveController.js.meta deleted file mode 100644 index 18c7330..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/AI/SpiderReturnMoveController.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e2cda9a06a2cf41a8a847fcf1331d16f -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation.meta deleted file mode 100644 index 47f4f0b..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: c7b84ff7f6b13fe46b7cbdf142faa8fb -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/FanRotate.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/FanRotate.js deleted file mode 100644 index a8e86d2..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/FanRotate.js +++ /dev/null @@ -1,25 +0,0 @@ - -#pragma strict - -var thisMesh : Mesh; -var uvs : Vector2[]; - -#if !UNITY_IPHONE && !UNITY_ANDROID && !UNITY_WP8 && !UNITY_BLACKBERRY - -function Start () -{ - thisMesh = GetComponent(MeshFilter).mesh; - uvs = thisMesh.uv; -} - -function Update() -{ - for (var i : int = 0; i < uvs.length; i++) - { - uvs[i].y = (uvs[i].y + 0.25); - } - - thisMesh.uv = uvs; -} - -#endif \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/FanRotate.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/FanRotate.js.meta deleted file mode 100644 index 7021b7b..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/FanRotate.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 37d43fa7d421646219d39ea5722cfe68 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/FootstepHandler.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/FootstepHandler.js deleted file mode 100644 index f21972c..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/FootstepHandler.js +++ /dev/null @@ -1,38 +0,0 @@ -#pragma strict - -enum FootType { - Player, - Mech, - Spider -} - -var audioSource : AudioSource; -var footType : FootType; - -private var physicMaterial : PhysicMaterial; - -function OnCollisionEnter (collisionInfo : Collision) { - physicMaterial = collisionInfo.collider.sharedMaterial; -} - -function OnFootstep () { - if (!audioSource.enabled) - { - return; - } - - var sound : AudioClip; - switch (footType) { - case FootType.Player: - //sound = MaterialImpactManager.GetPlayerFootstepSound (physicMaterial); - break; - case FootType.Mech: - //sound = MaterialImpactManager.GetMechFootstepSound (physicMaterial); - break; - case FootType.Spider: - //sound = MaterialImpactManager.GetSpiderFootstepSound (physicMaterial); - break; - } - audioSource.pitch = Random.Range (0.98, 1.02); - audioSource.PlayOneShot (sound, Random.Range (0.8, 1.2)); -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/FootstepHandler.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/FootstepHandler.js.meta deleted file mode 100644 index cbec66f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/FootstepHandler.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0d9ca0c66e3ba47f7aa60403bd613485 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/MechAnimation.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/MechAnimation.js deleted file mode 100644 index 197b6aa..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/MechAnimation.js +++ /dev/null @@ -1,60 +0,0 @@ -#pragma strict - -var rigid : Rigidbody; -var idle : AnimationClip; -var walk : AnimationClip; -var turnLeft : AnimationClip; -var turnRight : AnimationClip; -var footstepSignals : SignalSender; - -private var tr : Transform; -private var lastFootstepTime : float = 0; -private var lastAnimTime : float = 0; - -function OnEnable () { - tr = rigid.transform; - - GetComponent.()[idle.name].layer = 0; - GetComponent.()[idle.name].weight = 1; - GetComponent.()[idle.name].enabled = true; - - GetComponent.()[walk.name].layer = 1; - GetComponent.()[turnLeft.name].layer = 1; - GetComponent.()[turnRight.name].layer = 1; - - GetComponent.()[walk.name].weight = 1; - GetComponent.()[turnLeft.name].weight = 0; - GetComponent.()[turnRight.name].weight = 0; - - GetComponent.()[walk.name].enabled = true; - GetComponent.()[turnLeft.name].enabled = true; - GetComponent.()[turnRight.name].enabled = true; - - //animation.SyncLayer (1); -} - -function FixedUpdate () { - var turningWeight : float = Mathf.Abs (rigid.angularVelocity.y) * Mathf.Rad2Deg / 100.0; - var forwardWeight : float = rigid.velocity.magnitude / 2.5; - var turningDir : float = Mathf.Sign (rigid.angularVelocity.y); - - // Temp, until we get the animations fixed - GetComponent.()[walk.name].speed = Mathf.Lerp (1.0, GetComponent.()[walk.name].length / GetComponent.()[turnLeft.name].length * 1.33, turningWeight); - GetComponent.()[turnLeft.name].time = GetComponent.()[walk.name].time; - GetComponent.()[turnRight.name].time = GetComponent.()[walk.name].time; - - GetComponent.()[turnLeft.name].weight = Mathf.Clamp01 (-turningWeight * turningDir); - GetComponent.()[turnRight.name].weight = Mathf.Clamp01 (turningWeight * turningDir); - GetComponent.()[walk.name].weight = Mathf.Clamp01 (forwardWeight); - - if (forwardWeight + turningWeight > 0.1) { - var newAnimTime = Mathf.Repeat (GetComponent.()[walk.name].normalizedTime * 2 + 0.1, 1); - if (newAnimTime < lastAnimTime) { - if (Time.time > lastFootstepTime + 0.1) { - footstepSignals.SendSignals (this); - lastFootstepTime = Time.time; - } - } - lastAnimTime = newAnimTime; - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/MechAnimation.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/MechAnimation.js.meta deleted file mode 100644 index ee5686c..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/MechAnimation.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5f9ba405be8854d2fade944b8c9f823f -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/MechAnimationTest.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/MechAnimationTest.js deleted file mode 100644 index d521bce..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/MechAnimationTest.js +++ /dev/null @@ -1,78 +0,0 @@ -#pragma strict - -#if !UNITY_FLASH - -var turning : float = 0; -var walking : float = 0; -var turnOffset : float = 0.0; - -var rigid : Rigidbody; -var idle : AnimationClip; -var walk : AnimationClip; -var turnLeft : AnimationClip; -var turnRight : AnimationClip; -var footstepSignals : SignalSender; - -function OnEnable () { - - GetComponent.()[idle.name].layer = 0; - GetComponent.()[idle.name].weight = 1; - GetComponent.()[idle.name].enabled = true; - - GetComponent.()[walk.name].layer = 1; - GetComponent.()[turnLeft.name].layer = 1; - GetComponent.()[turnRight.name].layer = 1; - - GetComponent.()[walk.name].weight = 1; - GetComponent.()[turnLeft.name].weight = 0; - GetComponent.()[turnRight.name].weight = 0; - - GetComponent.()[walk.name].enabled = true; - GetComponent.()[turnLeft.name].enabled = true; - GetComponent.()[turnRight.name].enabled = true; - - //animation[walk.name].speed = 0.93; - - //animation.Play (); -} - -function FixedUpdate () { - GetComponent.()[walk.name].speed = Mathf.Lerp (1, GetComponent.()[walk.name].length / GetComponent.()[turnLeft.name].length, Mathf.Abs (turning)); - - GetComponent.()[turnLeft.name].time = GetComponent.()[walk.name].time + turnOffset; - GetComponent.()[turnRight.name].time = GetComponent.()[walk.name].time + turnOffset; - - rigid.velocity = rigid.transform.forward * 2.5 * walking; - rigid.angularVelocity = Vector3.up * turning * 100 * Mathf.Deg2Rad; - - var turningWeight : float = rigid.angularVelocity.y * Mathf.Rad2Deg / 100.0; - var forwardWeight : float = rigid.velocity.magnitude / 2.5; - - GetComponent.()[turnLeft.name].weight = Mathf.Clamp01 (-turningWeight); - GetComponent.()[turnRight.name].weight = Mathf.Clamp01 (turningWeight); - GetComponent.()[walk.name].weight = Mathf.Clamp01 (forwardWeight); -} - -function OnGUI () { - GUILayout.Label ("Walking (0 to 1): "+walking.ToString("0.00")); - walking = GUILayout.HorizontalSlider (walking, 0, 1, GUILayout.Width (100)); - if (GUI.changed) { - turning = Mathf.Clamp (Mathf.Abs (turning), 0, 1 - walking) * Mathf.Sign (turning); - GUI.changed = false; - } - - GUILayout.Label ("Turning (-1 to 1): "+turning.ToString("0.00")); - turning = GUILayout.HorizontalSlider (turning, -1, 1, GUILayout.Width (100)); - if (Mathf.Abs (turning) < 0.1) - turning = 0; - if (GUI.changed) { - walking = Mathf.Clamp (walking, 0, 1 - Mathf.Abs (turning)); - GUI.changed = false; - } - - GUILayout.Label ("Offset to turning anims (-0.5 to 0.5): "+turnOffset.ToString("0.00")); - turnOffset = GUILayout.HorizontalSlider (turnOffset, -0.5, 0.5, GUILayout.Width (100)); - if (Mathf.Abs (turnOffset) < 0.05) - turnOffset = 0; -} -#endif \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/MechAnimationTest.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/MechAnimationTest.js.meta deleted file mode 100644 index d0833e4..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/MechAnimationTest.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5f34d48cfe767425d8421958a93d358a -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/PlayerAnimation.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/PlayerAnimation.js deleted file mode 100644 index b242da7..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/PlayerAnimation.js +++ /dev/null @@ -1,206 +0,0 @@ -#pragma strict - -class MoveAnimation { - // The animation clip - var clip : AnimationClip; - - // The velocity of the walk or run cycle in this clip - var velocity : Vector3; - - // Store the current weight of this animation - @HideInInspector - public var weight : float; - - // Keep track of whether this animation is currently the best match - @HideInInspector - public var currentBest : boolean = false; - - // The speed and angle is directly derived from the velocity, - // but since it's slightly expensive to calculate them - // we do it once in the beginning instead of in every frame. - @HideInInspector - public var speed : float; - @HideInInspector - public var angle : float; - - public function Init () { - velocity.y = 0; - speed = velocity.magnitude; - angle = PlayerAnimation.HorizontalAngle (velocity); - } -} - -var rigid : Rigidbody; -var rootBone : Transform; -var upperBodyBone : Transform; -var maxIdleSpeed : float = 0.5; -var minWalkSpeed : float = 2.0; -var idle : AnimationClip; -var turn : AnimationClip; -var shootAdditive : AnimationClip; -var moveAnimations : MoveAnimation[]; -var footstepSignals : SignalSender; - -private var tr : Transform; -private var lastPosition : Vector3 = Vector3.zero; -private var velocity : Vector3 = Vector3.zero; -private var localVelocity : Vector3 = Vector3.zero; -private var speed : float = 0; -private var angle : float = 0; -private var lowerBodyDeltaAngle : float = 0; -private var idleWeight : float = 0; -private var lowerBodyForwardTarget : Vector3 = Vector3.forward; -private var lowerBodyForward : Vector3 = Vector3.forward; -private var bestAnimation : MoveAnimation = null; -private var lastFootstepTime : float = 0; -private var lastAnimTime : float = 0; - -public var animationComponent : Animation; - -function Awake () { - tr = rigid.transform; - lastPosition = tr.position; - - for (var moveAnimation : MoveAnimation in moveAnimations) { - moveAnimation.Init (); - animationComponent[moveAnimation.clip.name].layer = 1; - animationComponent[moveAnimation.clip.name].enabled = true; - } - animationComponent.SyncLayer (1); - - animationComponent[idle.name].layer = 2; - animationComponent[turn.name].layer = 3; - animationComponent[idle.name].enabled = true; - - animationComponent[shootAdditive.name].layer = 4; - animationComponent[shootAdditive.name].weight = 1; - animationComponent[shootAdditive.name].speed = 0.6; - animationComponent[shootAdditive.name].blendMode = AnimationBlendMode.Additive; - - //animation[turn.name].enabled = true; -} - -function OnStartFire () { - if (Time.timeScale == 0) - return; - - animationComponent[shootAdditive.name].enabled = true; -} - -function OnStopFire () { - animationComponent[shootAdditive.name].enabled = false; -} - -function FixedUpdate () { - velocity = (tr.position - lastPosition) / Time.deltaTime; - localVelocity = tr.InverseTransformDirection (velocity); - localVelocity.y = 0; - speed = localVelocity.magnitude; - angle = HorizontalAngle (localVelocity); - - lastPosition = tr.position; -} - -function Update () { - idleWeight = Mathf.Lerp (idleWeight, Mathf.InverseLerp (minWalkSpeed, maxIdleSpeed, speed), Time.deltaTime * 10); - animationComponent[idle.name].weight = idleWeight; - - if (speed > 0) { - var smallestDiff : float = Mathf.Infinity; - for (var moveAnimation : MoveAnimation in moveAnimations) { - var angleDiff : float = Mathf.Abs(Mathf.DeltaAngle (angle, moveAnimation.angle)); - var speedDiff : float = Mathf.Abs (speed - moveAnimation.speed); - var diff : float = angleDiff + speedDiff; - if (moveAnimation == bestAnimation) - diff *= 0.9; - - if (diff < smallestDiff) { - bestAnimation = moveAnimation; - smallestDiff = diff; - } - } - - animationComponent.CrossFade (bestAnimation.clip.name); - } - else { - bestAnimation = null; - } - - if (lowerBodyForward != lowerBodyForwardTarget && idleWeight >= 0.9) - animationComponent.CrossFade (turn.name, 0.05); - - if (bestAnimation && idleWeight < 0.9) { - var newAnimTime = Mathf.Repeat (animationComponent[bestAnimation.clip.name].normalizedTime * 2 + 0.1, 1); - if (newAnimTime < lastAnimTime) { - if (Time.time > lastFootstepTime + 0.1) { - footstepSignals.SendSignals (this); - lastFootstepTime = Time.time; - } - } - lastAnimTime = newAnimTime; - } -} - -function LateUpdate () { - var idle : float = Mathf.InverseLerp (minWalkSpeed, maxIdleSpeed, speed); - - if (idle < 1) { - // Calculate a weighted average of the animation velocities that are currently used - var animatedLocalVelocity : Vector3 = Vector3.zero; - for (var moveAnimation : MoveAnimation in moveAnimations) { - // Ignore this animation if its weight is 0 - if (animationComponent[moveAnimation.clip.name].weight == 0) - continue; - - // Ignore this animation if its velocity is more than 90 degrees away from current velocity - if (Vector3.Dot (moveAnimation.velocity, localVelocity) <= 0) - continue; - - // Add velocity of this animation to the weighted average - animatedLocalVelocity += moveAnimation.velocity * animationComponent[moveAnimation.clip.name].weight; - } - - // Calculate target angle to rotate lower body by in order - // to make feet run in the direction of the velocity - var lowerBodyDeltaAngleTarget : float = Mathf.DeltaAngle ( - HorizontalAngle (tr.rotation * animatedLocalVelocity), - HorizontalAngle (velocity) - ); - - // Lerp the angle to smooth it a bit - lowerBodyDeltaAngle = Mathf.LerpAngle (lowerBodyDeltaAngle, lowerBodyDeltaAngleTarget, Time.deltaTime * 10); - - // Update these so they're ready for when we go into idle - lowerBodyForwardTarget = tr.forward; - lowerBodyForward = Quaternion.Euler (0, lowerBodyDeltaAngle, 0) * lowerBodyForwardTarget; - } - else { - // Turn the lower body towards it's target direction - lowerBodyForward = Vector3.RotateTowards (lowerBodyForward, lowerBodyForwardTarget, Time.deltaTime * 520 * Mathf.Deg2Rad, 1); - - // Calculate delta angle to make the lower body stay in place - lowerBodyDeltaAngle = Mathf.DeltaAngle ( - HorizontalAngle (tr.forward), - HorizontalAngle (lowerBodyForward) - ); - - // If the body is twisted more than 80 degrees, - // set a new target direction for the lower body, so it begins turning - if (Mathf.Abs(lowerBodyDeltaAngle) > 80) - lowerBodyForwardTarget = tr.forward; - } - - // Create a Quaternion rotation from the rotation angle - var lowerBodyDeltaRotation : Quaternion = Quaternion.Euler (0, lowerBodyDeltaAngle, 0); - - // Rotate the whole body by the angle - rootBone.rotation = lowerBodyDeltaRotation * rootBone.rotation; - - // Counter-rotate the upper body so it won't be affected - upperBodyBone.rotation = Quaternion.Inverse (lowerBodyDeltaRotation) * upperBodyBone.rotation; - -} - -static function HorizontalAngle (direction : Vector3) { - return Mathf.Atan2 (direction.x, direction.z) * Mathf.Rad2Deg; -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/PlayerAnimation.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/PlayerAnimation.js.meta deleted file mode 100644 index 70588bd..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/PlayerAnimation.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 842b770b5d21e422c8cbcfed681ebf81 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/SpiderAnimation.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/SpiderAnimation.js deleted file mode 100644 index 9b6198f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/SpiderAnimation.js +++ /dev/null @@ -1,118 +0,0 @@ -#pragma strict - -var motor : MovementMotor; -var activateAnim : AnimationClip; -var forwardAnim : AnimationClip; -var backAnim : AnimationClip; -var leftAnim : AnimationClip; -var rightAnim : AnimationClip; -var audioSource : AudioSource; -var footstepSignals : SignalSender; -var skiddingSounds : boolean; -var footstepSounds : boolean; - -private var tr : Transform; -private var lastFootstepTime : float = 0; -private var lastAnimTime : float = 0; - -function OnEnable () { - tr = motor.transform; - - GetComponent.()[activateAnim.name].enabled = true; - GetComponent.()[activateAnim.name].weight = 1; - GetComponent.()[activateAnim.name].time = 0; - GetComponent.()[activateAnim.name].speed = 1; - - GetComponent.()[forwardAnim.name].layer = 1; - GetComponent.()[forwardAnim.name].enabled = true; - GetComponent.()[forwardAnim.name].weight = 0; - GetComponent.()[backAnim.name].layer = 1; - GetComponent.()[backAnim.name].enabled = true; - GetComponent.()[backAnim.name].weight = 0; - GetComponent.()[leftAnim.name].layer = 1; - GetComponent.()[leftAnim.name].enabled = true; - GetComponent.()[leftAnim.name].weight = 0; - GetComponent.()[rightAnim.name].layer = 1; - GetComponent.()[rightAnim.name].enabled = true; - GetComponent.()[rightAnim.name].weight = 0; - -} - -function OnDisable () { - GetComponent.()[activateAnim.name].enabled = true; - GetComponent.()[activateAnim.name].weight = 1; - GetComponent.()[activateAnim.name].normalizedTime = 1; - GetComponent.()[activateAnim.name].speed = -1; - GetComponent.().CrossFade (activateAnim.name, 0.3, PlayMode.StopAll); -} - -function Update () { - var direction : Vector3 = motor.movementDirection; - direction.y = 0; - - var walkWeight : float = direction.magnitude; - - GetComponent.()[forwardAnim.name].speed = walkWeight; - GetComponent.()[rightAnim.name].speed = walkWeight; - GetComponent.()[backAnim.name].speed = walkWeight; - GetComponent.()[leftAnim.name].speed = walkWeight; - - var angle : float = Mathf.DeltaAngle ( - HorizontalAngle (tr.forward), - HorizontalAngle (direction) - ); - - if (walkWeight > 0.01) { - var w : float; - if (angle < -90) { - w = Mathf.InverseLerp (-180, -90, angle); - GetComponent.()[forwardAnim.name].weight = 0; - GetComponent.()[rightAnim.name].weight = 0; - GetComponent.()[backAnim.name].weight = 1 - w; - GetComponent.()[leftAnim.name].weight = 1; - } - else if (angle < 0) { - w = Mathf.InverseLerp (-90, 0, angle); - GetComponent.()[forwardAnim.name].weight = w; - GetComponent.()[rightAnim.name].weight = 0; - GetComponent.()[backAnim.name].weight = 0; - GetComponent.()[leftAnim.name].weight = 1 - w; - } - else if (angle < 90) { - w = Mathf.InverseLerp (0, 90, angle); - GetComponent.()[forwardAnim.name].weight = 1 - w; - GetComponent.()[rightAnim.name].weight = w; - GetComponent.()[backAnim.name].weight = 0; - GetComponent.()[leftAnim.name].weight = 0; - } - else { - w = Mathf.InverseLerp (90, 180, angle); - GetComponent.()[forwardAnim.name].weight = 0; - GetComponent.()[rightAnim.name].weight = 1 - w; - GetComponent.()[backAnim.name].weight = w; - GetComponent.()[leftAnim.name].weight = 0; - } - } - - if (skiddingSounds) { - if (walkWeight > 0.2 && !audioSource.isPlaying) - audioSource.Play (); - else if (walkWeight < 0.2 && audioSource.isPlaying) - audioSource.Pause (); - } - - if (footstepSounds && walkWeight > 0.2) { - var newAnimTime = Mathf.Repeat (GetComponent.()[forwardAnim.name].normalizedTime * 4 + 0.1, 1); - if (newAnimTime < lastAnimTime) { - if (Time.time > lastFootstepTime + 0.1) { - footstepSignals.SendSignals (this); - lastFootstepTime = Time.time; - } - } - lastAnimTime = newAnimTime; - } -} - -static function HorizontalAngle (direction : Vector3) { - return Mathf.Atan2 (direction.x, direction.z) * Mathf.Rad2Deg; -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/SpiderAnimation.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/SpiderAnimation.js.meta deleted file mode 100644 index 137ec02..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/SpiderAnimation.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b9b1abacf2a5046178faf10c090ffb35 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/SpiderAnimationTest.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/SpiderAnimationTest.js deleted file mode 100644 index 33e309f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/SpiderAnimationTest.js +++ /dev/null @@ -1,98 +0,0 @@ -#pragma strict - -#if !UNITY_FLASH - -var rigid : Rigidbody; -var forwardAnim : AnimationClip; -var backAnim : AnimationClip; -var leftAnim : AnimationClip; -var rightAnim : AnimationClip; - -var walking : float; -var angle : float; - -private var tr : Transform; - -function OnEnable () { - tr = rigid.transform; - - GetComponent.()[forwardAnim.name].layer = 1; - GetComponent.()[forwardAnim.name].enabled = true; - GetComponent.()[backAnim.name].layer = 1; - GetComponent.()[backAnim.name].enabled = true; - GetComponent.()[leftAnim.name].layer = 1; - GetComponent.()[leftAnim.name].enabled = true; - GetComponent.()[rightAnim.name].layer = 1; - GetComponent.()[rightAnim.name].enabled = true; - GetComponent.().SyncLayer (1); -} - -function Update () { - rigid.velocity = Quaternion.Euler(0, angle, 0) * rigid.transform.forward * 2.4 * walking; - - var velocity : Vector3 = rigid.velocity; - velocity.y = 0; - - var walkWeight : float = velocity.magnitude / 2.4; - - GetComponent.()[forwardAnim.name].speed = walkWeight; - GetComponent.()[rightAnim.name].speed = walkWeight; - GetComponent.()[backAnim.name].speed = walkWeight; - GetComponent.()[leftAnim.name].speed = walkWeight; - - if (velocity == Vector3.zero) { - return; - } - - var angle : float = Mathf.DeltaAngle ( - HorizontalAngle (tr.forward), - HorizontalAngle (rigid.velocity) - ); - - var w : float; - if (angle < -90) { - w = Mathf.InverseLerp (-180, -90, angle); - GetComponent.()[forwardAnim.name].weight = 0; - GetComponent.()[rightAnim.name].weight = 0; - GetComponent.()[backAnim.name].weight = 1 - w; - GetComponent.()[leftAnim.name].weight = 1; - } - else if (angle < 0) { - w = Mathf.InverseLerp (-90, 0, angle); - GetComponent.()[forwardAnim.name].weight = w; - GetComponent.()[rightAnim.name].weight = 0; - GetComponent.()[backAnim.name].weight = 0; - GetComponent.()[leftAnim.name].weight = 1 - w; - } - else if (angle < 90) { - w = Mathf.InverseLerp (0, 90, angle); - GetComponent.()[forwardAnim.name].weight = 1 - w; - GetComponent.()[rightAnim.name].weight = w; - GetComponent.()[backAnim.name].weight = 0; - GetComponent.()[leftAnim.name].weight = 0; - } - else { - w = Mathf.InverseLerp (90, 180, angle); - GetComponent.()[forwardAnim.name].weight = 0; - GetComponent.()[rightAnim.name].weight = 1 - w; - GetComponent.()[backAnim.name].weight = w; - GetComponent.()[leftAnim.name].weight = 0; - } -} - -static function HorizontalAngle (direction : Vector3) { - return Mathf.Atan2 (direction.x, direction.z) * Mathf.Rad2Deg; -} - -function OnGUI () { - GUILayout.Label ("Angle (0 to 360): "+angle.ToString("0.00")); - angle = GUILayout.HorizontalSlider (angle, 0, 360, GUILayout.Width (200)); - for (var i : int = 0; i<=360; i+=45) { - if (Mathf.Abs (angle - i) < 10) - angle = i; - } - - GUILayout.Label ("Walking (0 to 1): "+walking.ToString("0.00")); - walking = GUILayout.HorizontalSlider (walking, 0, 1, GUILayout.Width (100)); -} -#endif \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/SpiderAnimationTest.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/SpiderAnimationTest.js.meta deleted file mode 100644 index 7a2dc53..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/SpiderAnimationTest.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 27c365583b4af467a9b085c4b2c18f37 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/conveyorBelt.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/conveyorBelt.js deleted file mode 100644 index 6d3da02..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/conveyorBelt.js +++ /dev/null @@ -1,24 +0,0 @@ - -#pragma strict - -var scrollSpeed : float = 0.1; -var mat : Material; - -function Start () { - enabled = false; -} - -function OnBecameVisible () { - enabled = true; -} - -function OnBecameInvisible () { - enabled = false; -} - -function Update () { - var offset : float = (Time.time * scrollSpeed) % 1.0; - - mat.SetTextureOffset ("_MainTex", Vector2(0, -offset)); - mat.SetTextureOffset ("_BumpMap", Vector2(0, -offset)); -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/conveyorBelt.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/conveyorBelt.js.meta deleted file mode 100644 index 072a07f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Animation/conveyorBelt.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4ad3c97b882594f91a676c3445e487db -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx.meta deleted file mode 100644 index 79afbd9..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 06ffe9b1fe24bd447acd9b5cb01e85bc -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/GlowPlane.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/GlowPlane.js deleted file mode 100644 index cec44c2..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/GlowPlane.js +++ /dev/null @@ -1,54 +0,0 @@ - -#pragma strict - -var playerTransform : Transform; -private var pos : Vector3; -private var scale : Vector3; -var minGlow : float = 0.2f; -var maxGlow : float = 0.5f; -var glowColor : Color = Color.white; - -private var mat : Material; - -function Start () { - if (!playerTransform) - playerTransform = GameObject.FindWithTag ("Player").transform; - pos = transform.position; - scale = transform.localScale; - mat = GetComponent.().material; - enabled = false; -} - -function OnDrawGizmos () { - Gizmos.color = glowColor; - Gizmos.color.a = maxGlow * 0.25f; - Gizmos.matrix = transform.localToWorldMatrix; - var scale : Vector3 = 5.0f * Vector3.Scale (Vector3.one, Vector3(1,0,1)); - Gizmos.DrawCube (Vector3.zero, scale); - Gizmos.matrix = Matrix4x4.identity; -} - -function OnDrawGizmosSelected () { - Gizmos.color = glowColor; - Gizmos.color.a = maxGlow; - Gizmos.matrix = transform.localToWorldMatrix; - var scale : Vector3 = 5.0f * Vector3.Scale (Vector3.one, Vector3(1,0,1)); - Gizmos.DrawCube (Vector3.zero, scale); - Gizmos.matrix = Matrix4x4.identity; -} - -function OnBecameVisible () { - enabled = true; -} - -function OnBecameInvisible () { - enabled = false; -} - -function Update () { - var vec : Vector3 = (pos - playerTransform.position); - vec.y = 0.0f; - var distance = vec.magnitude; - transform.localScale = Vector3.Lerp (Vector3.one * minGlow, scale, Mathf.Clamp01 (distance * 0.35f)); - mat.SetColor ("_TintColor", glowColor * Mathf.Clamp (distance * 0.1f, minGlow, maxGlow)); -} \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/GlowPlane.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/GlowPlane.js.meta deleted file mode 100644 index 85960cf..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/GlowPlane.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 38f2946e5dd7e4fcf8deb05e72f915dc -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/GlowPlaneAngleFade.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/GlowPlaneAngleFade.js deleted file mode 100644 index c1e4000..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/GlowPlaneAngleFade.js +++ /dev/null @@ -1,19 +0,0 @@ - -#pragma strict - -var cameraTransform : Transform; -var glowColor : Color = Color.grey; -private var dot : float = 0.5f; - -function Start () { - if (!cameraTransform) - cameraTransform = Camera.main.transform; -} - -function Update () { - dot = 1.5f * Mathf.Clamp01 (Vector3.Dot (cameraTransform.forward, -transform.up) - 0.25f); -} - -function OnWillRenderObject () { - GetComponent.().sharedMaterial.SetColor ("_TintColor", glowColor * dot); -} \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/GlowPlaneAngleFade.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/GlowPlaneAngleFade.js.meta deleted file mode 100644 index d2a30d3..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/GlowPlaneAngleFade.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e840c8e0c4a924e53a9125f6a35cb26d -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/LaserScope.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/LaserScope.js deleted file mode 100644 index 9dd3206..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/LaserScope.js +++ /dev/null @@ -1,71 +0,0 @@ -#pragma strict - -@script RequireComponent (PerFrameRaycast) - -public var scrollSpeed : float = 0.5; -public var pulseSpeed : float = 1.5; - -public var noiseSize : float = 1.0; - -public var maxWidth : float = 0.5; -public var minWidth : float = 0.2; - -public var pointer : GameObject = null; - -private var lRenderer : LineRenderer; -private var aniTime : float = 0.0; -private var aniDir : float = 1.0; - -private var raycast : PerFrameRaycast; - -function Start() { - lRenderer = gameObject.GetComponent (LineRenderer) as LineRenderer; - aniTime = 0.0; - - // Change some animation values here and there - ChoseNewAnimationTargetCoroutine(); - - raycast = GetComponent. (); -} - -function ChoseNewAnimationTargetCoroutine () { - while (true) { - aniDir = aniDir * 0.9 + Random.Range (0.5, 1.5) * 0.1; - yield; - minWidth = minWidth * 0.8 + Random.Range (0.1, 1.0) * 0.2; - yield WaitForSeconds (1.0 + Random.value * 2.0 - 1.0); - } -} - -function Update () { - GetComponent.().material.mainTextureOffset.x += Time.deltaTime * aniDir * scrollSpeed; - GetComponent.().material.SetTextureOffset ("_NoiseTex", Vector2 (-Time.time * aniDir * scrollSpeed, 0.0)); - - var aniFactor : float = Mathf.PingPong (Time.time * pulseSpeed, 1.0); - aniFactor = Mathf.Max (minWidth, aniFactor) * maxWidth; - lRenderer.SetWidth (aniFactor, aniFactor); - - // Cast a ray to find out the end point of the laser - var hitInfo : RaycastHit = raycast.GetHitInfo (); - if (hitInfo.transform) { - lRenderer.SetPosition (1, (hitInfo.distance * Vector3.forward)); - GetComponent.().material.mainTextureScale.x = 0.1 * (hitInfo.distance); - GetComponent.().material.SetTextureScale ("_NoiseTex", Vector2 (0.1 * hitInfo.distance * noiseSize, noiseSize)); - - // Use point and normal to align a nice & rough hit plane - if (pointer) { - pointer.GetComponent.().enabled = true; - pointer.transform.position = hitInfo.point + (transform.position - hitInfo.point) * 0.01; - pointer.transform.rotation = Quaternion.LookRotation (hitInfo.normal, transform.up); - pointer.transform.eulerAngles.x = 90.0; - } - } - else { - if (pointer) - pointer.GetComponent.().enabled = false; - var maxDist : float = 200.0; - lRenderer.SetPosition (1, (maxDist * Vector3.forward)); - GetComponent.().material.mainTextureScale.x = 0.1 * (maxDist); - GetComponent.().material.SetTextureScale ("_NoiseTex", Vector2 (0.1 * (maxDist) * noiseSize, noiseSize)); - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/LaserScope.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/LaserScope.js.meta deleted file mode 100644 index 76592fa..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/LaserScope.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2aa4d88eb4eed41fd915afa70498e1a7 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/SelfIlluminationBlink.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/SelfIlluminationBlink.js deleted file mode 100644 index 8ef2889..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/SelfIlluminationBlink.js +++ /dev/null @@ -1,12 +0,0 @@ - -#pragma strict - -public var blink : float = 0.0f; - -function OnWillRenderObject () { - GetComponent.().sharedMaterial.SetFloat ("_SelfIllumStrength", blink); -} - -function Blink () { - blink = 1.0f - blink; -} \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/SelfIlluminationBlink.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/SelfIlluminationBlink.js.meta deleted file mode 100644 index 3bcc277..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Fx/SelfIlluminationBlink.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: bc1f526f6b3cc4adf97bae3794998cea -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/GameScore.cs b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/GameScore.cs deleted file mode 100644 index 5020ff4..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/GameScore.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -public class GameScore : MonoBehaviour -{ - static GameScore s_Instance; - - - static GameScore Instance - { - get - { - if (s_Instance == null) - { - s_Instance = (GameScore)FindObjectOfType(typeof(GameScore)); - } - - return s_Instance; - } - } - - - public void OnApplicationQuit() - { - s_Instance = null; - } - - - public string playerLayerName = "Player", enemyLayerName = "Enemies"; - - - int m_Deaths; - readonly Dictionary m_Kills = new Dictionary(); - float m_StartTime; - - - public static int Deaths - { - get - { - if (Instance == null) - { - return 0; - } - - return Instance.m_Deaths; - } - } - - - #if !UNITY_FLASH - public static ICollection KillTypes - { - get - { - if (Instance == null) - { - return new string[0]; - } - - return Instance.m_Kills.Keys; - } - } - #endif // if !UNITY_FLASH - - - public static int GetKills(string type) - { - if (Instance == null || !Instance.m_Kills.ContainsKey(type)) - { - return 0; - } - - return Instance.m_Kills[type]; - } - - - public static float GameTime - { - get - { - if (Instance == null) - { - return 0.0f; - } - - return Time.time - Instance.m_StartTime; - } - } - - - public static void RegisterDeath(GameObject deadObject) - { - if (Instance == null) - { - Debug.Log("Game score not loaded"); - return; - } - - int - playerLayer = LayerMask.NameToLayer(Instance.playerLayerName), - enemyLayer = LayerMask.NameToLayer(Instance.enemyLayerName); - - if (deadObject.layer == playerLayer) - { - Instance.m_Deaths++; - } - else if (deadObject.layer == enemyLayer) - { - Instance.m_Kills[deadObject.name] = Instance.m_Kills.ContainsKey(deadObject.name) ? Instance.m_Kills[deadObject.name] + 1 : 1; - } - } - - - public void OnLevelWasLoaded(int level) - { - if (m_StartTime == 0.0f) - { - m_StartTime = Time.time; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/GameScore.cs.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/GameScore.cs.meta deleted file mode 100644 index de80deb..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/GameScore.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b81a279071a454c63970e678a54bf52e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Managers.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Managers.meta deleted file mode 100644 index ff1bb67..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Managers.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: ee06c696d9fc367419b6b463c296fd3e -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Managers/Spawner.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Managers/Spawner.js deleted file mode 100644 index b4f8d49..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Managers/Spawner.js +++ /dev/null @@ -1,125 +0,0 @@ -#pragma strict - -static var spawner : Spawner; - -var caches : ObjectCache[]; - -var activeCachedObjects : Hashtable; - - -class ObjectCache { - var prefab : GameObject; - var cacheSize : int = 10; - - private var objects : GameObject[]; - private var cacheIndex : int = 0; - - function Initialize () - { - objects = new GameObject[cacheSize]; - - // Instantiate the objects in the array and set them to be inactive - for (var i = 0; i < cacheSize; i++) - { - objects[i] = MonoBehaviour.Instantiate (prefab) as GameObject; - objects[i].SetActive (false); - objects[i].name = objects[i].name + i; - } - } - - function GetNextObjectInCache () : GameObject { - var obj : GameObject = null; - - // The cacheIndex starts out at the position of the object created - // the longest time ago, so that one is usually free, - // but in case not, loop through the cache until we find a free one. - for (var i : int = 0; i < cacheSize; i++) { - obj = objects[cacheIndex]; - - // If we found an inactive object in the cache, use that. - if (!obj.activeSelf) - break; - - // If not, increment index and make it loop around - // if it exceeds the size of the cache - cacheIndex = (cacheIndex + 1) % cacheSize; - } - - // The object should be inactive. If it's not, log a warning and use - // the object created the longest ago even though it's still active. - if (obj.activeSelf) { - Debug.LogWarning ( - "Spawn of " + prefab.name + - " exceeds cache size of " + cacheSize + - "! Reusing already active object.", obj); - Spawner.Destroy (obj); - } - - // Increment index and make it loop around - // if it exceeds the size of the cache - cacheIndex = (cacheIndex + 1) % cacheSize; - - return obj; - } -} - -function Awake () { - // Set the global variable - spawner = this; - - // Total number of cached objects - var amount : int = 0; - - // Loop through the caches - for (var i = 0; i < caches.length; i++) { - // Initialize each cache - caches[i].Initialize (); - - // Count - amount += caches[i].cacheSize; - } - - // Create a hashtable with the capacity set to the amount of cached objects specified - activeCachedObjects = new Hashtable (amount); -} - -static function Spawn (prefab : GameObject, position : Vector3, rotation : Quaternion) : GameObject { - var cache : ObjectCache = null; - - // Find the cache for the specified prefab - if (spawner) { - for (var i = 0; i < spawner.caches.length; i++) { - if (spawner.caches[i].prefab == prefab) { - cache = spawner.caches[i]; - } - } - } - - // If there's no cache for this prefab type, just instantiate normally - if (cache == null) { - return Instantiate (prefab, position, rotation) as GameObject; - } - - // Find the next object in the cache - var obj : GameObject = cache.GetNextObjectInCache (); - - // Set the position and rotation of the object - obj.transform.position = position; - obj.transform.rotation = rotation; - - // Set the object to be active - obj.SetActive (true); - spawner.activeCachedObjects[obj] = true; - - return obj; -} - -static function Destroy (objectToDestroy : GameObject) { - if (spawner && spawner.activeCachedObjects.ContainsKey (objectToDestroy)) { - objectToDestroy.SetActive (false); - spawner.activeCachedObjects[objectToDestroy] = false; - } - else { - objectToDestroy.Destroy (objectToDestroy); - } -} \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Managers/Spawner.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Managers/Spawner.js.meta deleted file mode 100644 index 2aa19c5..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Managers/Spawner.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2ab0dadae0ad24c4c9ab8db71212a73f -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules.meta deleted file mode 100644 index 3b259d5..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: e964a38b856f751458d1f72a80a8566a -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/DestroyObject.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/DestroyObject.js deleted file mode 100644 index 92bfaf4..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/DestroyObject.js +++ /dev/null @@ -1,7 +0,0 @@ -#pragma strict - -var objectToDestroy : GameObject; - -function OnSignal () { - Spawner.Destroy (objectToDestroy); -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/DestroyObject.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/DestroyObject.js.meta deleted file mode 100644 index acb94f2..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/DestroyObject.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 96d8cc5dd1ca645bfaf494fe8499ee65 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/PlaySound.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/PlaySound.js deleted file mode 100644 index 4bc5855..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/PlaySound.js +++ /dev/null @@ -1,15 +0,0 @@ -#pragma strict - -var audioSource : AudioSource; -var sound : AudioClip; - -function Awake () { - if (!audioSource && GetComponent.()) - audioSource = GetComponent.(); -} - -function OnSignal () { - if (sound) - audioSource.clip = sound; - audioSource.Play (); -} \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/PlaySound.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/PlaySound.js.meta deleted file mode 100644 index 2393c59..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/PlaySound.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 3bc8e13a6337a4127830231edb1c17c1 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SignalSender.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SignalSender.js deleted file mode 100644 index 831c0d0..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SignalSender.js +++ /dev/null @@ -1,32 +0,0 @@ - -#pragma strict - -class ReceiverItem { - public var receiver : GameObject; - public var action : String = "OnSignal"; - public var delay : float; - - public function SendWithDelay (sender : MonoBehaviour) { - yield WaitForSeconds (delay); - if (receiver) - receiver.SendMessage (action); - else - Debug.LogWarning ("No receiver of signal \""+action+"\" on object "+sender.name+" ("+sender.GetType().Name+")", sender); - } -} - -class SignalSender { - public var onlyOnce : boolean; - public var receivers : ReceiverItem[]; - - private var hasFired : boolean = false; - - public function SendSignals (sender : MonoBehaviour) { - if (hasFired == false || onlyOnce == false) { - for (var i = 0; i < receivers.length; i++) { - sender.StartCoroutine (receivers[i].SendWithDelay(sender)); - } - hasFired = true; - } - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SignalSender.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SignalSender.js.meta deleted file mode 100644 index 4743151..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SignalSender.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d1f11ce43d3424aaca3d76884c778c74 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SpawnAtCheckpoint.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SpawnAtCheckpoint.js deleted file mode 100644 index 2f46503..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SpawnAtCheckpoint.js +++ /dev/null @@ -1,19 +0,0 @@ -#pragma strict -#pragma downcast - -var checkpoint : Transform; - -function OnSignal () { - transform.position = checkpoint.position; - transform.rotation = checkpoint.rotation; - - ResetHealthOnAll (); -} - -static function ResetHealthOnAll () { - var healthObjects : Health[] = FindObjectsOfType (Health); - for (var health : Health in healthObjects) { - health.dead = false; - health.health = health.maxHealth; - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SpawnAtCheckpoint.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SpawnAtCheckpoint.js.meta deleted file mode 100644 index 3dbc447..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SpawnAtCheckpoint.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a56da7f4d8d704d38878df0a3dc25256 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SpawnObject.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SpawnObject.js deleted file mode 100644 index a1a8be7..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SpawnObject.js +++ /dev/null @@ -1,27 +0,0 @@ -#pragma strict - -var objectToSpawn : GameObject; -var onDestroyedSignals : SignalSender; - -private var spawned : GameObject; - -// Keep disabled from the beginning -enabled = false; - -// When we get a signal, spawn the objectToSpawn and store the spawned object. -// Also enable this behaviour so the Update function will be run. -function OnSignal () { - spawned = Spawner.Spawn (objectToSpawn, transform.position, transform.rotation); - if (onDestroyedSignals.receivers.Length > 0) - enabled = true; -} - -// After the object is spawned, check each frame if it's still there. -// Once it's not, activate the onDestroyedSignals and disable again. -function Update () { - if (spawned == null || spawned.activeInHierarchy == false) - { - onDestroyedSignals.SendSignals (this); - enabled = false; - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SpawnObject.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SpawnObject.js.meta deleted file mode 100644 index 0f5d333..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/SpawnObject.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0589e866f6e934e0ab0b2e8fd77f31f3 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/TriggerOnMouseOrJoystick.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/TriggerOnMouseOrJoystick.js deleted file mode 100644 index 78fff42..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/TriggerOnMouseOrJoystick.js +++ /dev/null @@ -1,50 +0,0 @@ -#pragma strict - -public var mouseDownSignals : SignalSender; -public var mouseUpSignals : SignalSender; - -private var state : boolean = false; - -#if UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY -private var joysticks : Joystick[]; - -function Start () { - joysticks = FindObjectsOfType (Joystick) as Joystick[]; -} -#endif - -function Update () { -#if UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY - if (state == false && joysticks[0].tapCount > 0) { - mouseDownSignals.SendSignals (this); - state = true; - } - else if (joysticks[0].tapCount <= 0) { - mouseUpSignals.SendSignals (this); - state = false; - } -#else - #if !UNITY_EDITOR && (UNITY_XBOX360 || UNITY_PS3) - // On consoles use the right trigger to fire - var fireAxis : float = Input.GetAxis("TriggerFire"); - if (state == false && fireAxis >= 0.2) { - mouseDownSignals.SendSignals (this); - state = true; - } - else if (state == true && fireAxis < 0.2) { - mouseUpSignals.SendSignals (this); - state = false; - } - #else - if (state == false && Input.GetMouseButtonDown (0)) { - mouseDownSignals.SendSignals (this); - state = true; - } - - else if (state == true && Input.GetMouseButtonUp (0)) { - mouseUpSignals.SendSignals (this); - state = false; - } - #endif -#endif -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/TriggerOnMouseOrJoystick.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/TriggerOnMouseOrJoystick.js.meta deleted file mode 100644 index e835832..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Modules/TriggerOnMouseOrJoystick.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: da7fca1c8c5d14d4d92c3d7a92db64b5 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement.meta deleted file mode 100644 index 10bac72..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 4b9053fd574e4e94e8c44312c58f6792 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/FreeMovementMotor.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/FreeMovementMotor.js deleted file mode 100644 index 457a7d4..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/FreeMovementMotor.js +++ /dev/null @@ -1,48 +0,0 @@ -#pragma strict - -@script RequireComponent (Rigidbody) - -class FreeMovementMotor extends MovementMotor { - - //public var movement : MoveController; - public var walkingSpeed : float = 5.0; - public var walkingSnappyness : float = 50; - public var turningSmoothing : float = 0.3; - - function FixedUpdate () { - // Handle the movement of the character - var targetVelocity : Vector3 = movementDirection * walkingSpeed; - var deltaVelocity : Vector3 = targetVelocity - GetComponent.().velocity; - if (GetComponent.().useGravity) - deltaVelocity.y = 0; - GetComponent.().AddForce (deltaVelocity * walkingSnappyness, ForceMode.Acceleration); - - // Setup player to face facingDirection, or if that is zero, then the movementDirection - var faceDir : Vector3 = facingDirection; - if (faceDir == Vector3.zero) - faceDir = movementDirection; - - // Make the character rotate towards the target rotation - if (faceDir == Vector3.zero) { - GetComponent.().angularVelocity = Vector3.zero; - } - else { - var rotationAngle : float = AngleAroundAxis (transform.forward, faceDir, Vector3.up); - GetComponent.().angularVelocity = (Vector3.up * rotationAngle * turningSmoothing); - } - } - - // The angle between dirA and dirB around axis - static function AngleAroundAxis (dirA : Vector3, dirB : Vector3, axis : Vector3) { - // Project A and B onto the plane orthogonal target axis - dirA = dirA - Vector3.Project (dirA, axis); - dirB = dirB - Vector3.Project (dirB, axis); - - // Find (positive) angle between A and B - var angle : float = Vector3.Angle (dirA, dirB); - - // Return angle multiplied with 1 or -1 - return angle * (Vector3.Dot (axis, Vector3.Cross (dirA, dirB)) < 0 ? -1 : 1); - } - -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/FreeMovementMotor.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/FreeMovementMotor.js.meta deleted file mode 100644 index 0dd0a8f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/FreeMovementMotor.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e9f487a699bc54a4d9118822a0acad3a -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/Joystick.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/Joystick.js deleted file mode 100644 index 7cb165a..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/Joystick.js +++ /dev/null @@ -1,220 +0,0 @@ -#pragma strict - -@script RequireComponent (GUITexture) - -class Boundary { - var min : Vector2 = Vector2.zero; - var max : Vector2 = Vector2.zero; -} - -static private var joysticks : Joystick[]; // A static collection of all joysticks -static private var enumeratedJoysticks : boolean = false; -static private var tapTimeDelta : float = 0.3; // Time allowed between taps - -var touchPad : boolean; // Is this a TouchPad? -var touchZone : Rect; -var deadZone : float = 0; // Control when position is output -var normalize : boolean = false; // Normalize output after the dead-zone? -var position : Vector2; // [-1, 1] in x,y -var tapCount : int; // Current tap count - -private var lastFingerId = -1; // Finger last used for this joystick -private var tapTimeWindow : float; // How much time there is left for a tap to occur -private var fingerDownPos : Vector2; -private var fingerDownTime : float; -private var firstDeltaTime : float = 0.5; - -private var gui : GUITexture; // Joystick graphic -private var defaultRect : Rect; // Default position / extents of the joystick graphic -private var guiBoundary : Boundary = Boundary (); // Boundary for joystick graphic -private var guiTouchOffset : Vector2; // Offset to apply to touch input -private var guiCenter : Vector2; // Center of joystick - -#if !UNITY_IPHONE && !UNITY_ANDROID && !UNITY_WP8 && !UNITY_BLACKBERRY - -function Awake () { - gameObject.SetActive (false); -} - -#else - -function Start () { - // Cache this component at startup instead of looking up every frame - gui = GetComponent. (); - - // Store the default rect for the gui, so we can snap back to it - defaultRect = gui.pixelInset; - - defaultRect.x += transform.position.x * Screen.width;// + gui.pixelInset.x; // - Screen.width * 0.5; - defaultRect.y += transform.position.y * Screen.height;// - Screen.height * 0.5; - - transform.position.x = 0.0; - transform.position.y = 0.0; - - if (touchPad) { - // If a texture has been assigned, then use the rect ferom the gui as our touchZone - if (gui.texture) - touchZone = defaultRect; - } - else { - // This is an offset for touch input to match with the top left - // corner of the GUI - guiTouchOffset.x = defaultRect.width * 0.5; - guiTouchOffset.y = defaultRect.height * 0.5; - - // Cache the center of the GUI, since it doesn't change - guiCenter.x = defaultRect.x + guiTouchOffset.x; - guiCenter.y = defaultRect.y + guiTouchOffset.y; - - // Let's build the GUI boundary, so we can clamp joystick movement - guiBoundary.min.x = defaultRect.x - guiTouchOffset.x; - guiBoundary.max.x = defaultRect.x + guiTouchOffset.x; - guiBoundary.min.y = defaultRect.y - guiTouchOffset.y; - guiBoundary.max.y = defaultRect.y + guiTouchOffset.y; - } -} - -function Disable () { - gameObject.SetActive (false); - enumeratedJoysticks = false; -} - -function ResetJoystick () { - // Release the finger control and set the joystick back to the default position - gui.pixelInset = defaultRect; - lastFingerId = -1; - position = Vector2.zero; - fingerDownPos = Vector2.zero; - - if (touchPad) - gui.color.a = 0.025; -} - -function IsFingerDown () : boolean { - return (lastFingerId != -1); -} - -function LatchedFinger (fingerId : int) { - // If another joystick has latched this finger, then we must release it - if (lastFingerId == fingerId) - ResetJoystick (); -} - -function Update () { - if (!enumeratedJoysticks) { - // Collect all joysticks in the game, so we can relay finger latching messages - joysticks = FindObjectsOfType (Joystick) as Joystick[]; - enumeratedJoysticks = true; - } - - var count = Input.touchCount; - - // Adjust the tap time window while it still available - if (tapTimeWindow > 0) - tapTimeWindow -= Time.deltaTime; - else - tapCount = 0; - - if (count == 0) { - ResetJoystick (); - } - else { - for (var i : int = 0; i < count; i++) { - var touch : Touch = Input.GetTouch (i); - var guiTouchPos : Vector2 = touch.position - guiTouchOffset; - - var shouldLatchFinger = false; - if (touchPad) { - if (touchZone.Contains (touch.position)) - shouldLatchFinger = true; - } - else if (gui.HitTest (touch.position)) { - shouldLatchFinger = true; - } - - // Latch the finger if this is a new touch - if (shouldLatchFinger && (lastFingerId == -1 || lastFingerId != touch.fingerId)) { - - if (touchPad) { - gui.color.a = 0.15; - - lastFingerId = touch.fingerId; - fingerDownPos = touch.position; - fingerDownTime = Time.time; - } - - lastFingerId = touch.fingerId; - - // Accumulate taps if it is within the time window - if (tapTimeWindow > 0) { - tapCount++; - } - else { - tapCount = 1; - tapTimeWindow = tapTimeDelta; - } - - // Tell other joysticks we've latched this finger - for (var j : Joystick in joysticks) { - if (j != null && j != this) - j.LatchedFinger (touch.fingerId); - } - } - - if (lastFingerId == touch.fingerId) { - // Override the tap count with what the iPhone SDK reports if it is greater - // This is a workaround, since the iPhone SDK does not currently track taps - // for multiple touches - if (touch.tapCount > tapCount) - tapCount = touch.tapCount; - - if (touchPad) { - // For a touchpad, let's just set the position directly based on distance from initial touchdown - position.x = Mathf.Clamp ((touch.position.x - fingerDownPos.x) / (touchZone.width / 2), -1, 1); - position.y = Mathf.Clamp ((touch.position.y - fingerDownPos.y) / (touchZone.height / 2), -1, 1); - } - else { - // Change the location of the joystick graphic to match where the touch is - position.x = (touch.position.x - guiCenter.x) / guiTouchOffset.x; - position.y = (touch.position.y - guiCenter.y) / guiTouchOffset.y; - } - - if (touch.phase == TouchPhase.Ended || touch.phase == TouchPhase.Canceled) - ResetJoystick (); - } - } - } - - // Calculate the length. This involves a squareroot operation, - // so it's slightly expensive. We re-use this length for multiple - // things below to avoid doing the square-root more than one. - var length : float = position.magnitude; - - - if (length < deadZone) { - // If the length of the vector is smaller than the deadZone radius, - // set the position to the origin. - position = Vector2.zero; - } - else { - if (length > 1) { - // Normalize the vector if its length was greater than 1. - // Use the already calculated length instead of using Normalize(). - position = position / length; - } - else if (normalize) { - // Normalize the vector and multiply it with the length adjusted - // to compensate for the deadZone radius. - // This prevents the position from snapping from zero to the deadZone radius. - position = position / length * Mathf.InverseLerp (length, deadZone, 1); - } - } - - if (!touchPad) { - // Change the location of the joystick graphic to match the position - gui.pixelInset.x = (position.x - 1) * guiTouchOffset.x + guiCenter.x; - gui.pixelInset.y = (position.y - 1) * guiTouchOffset.y + guiCenter.y; - } -} - -#endif diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/Joystick.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/Joystick.js.meta deleted file mode 100644 index 01ec410..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/Joystick.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6efbc9189a79f4c6a8fd15a49bb59229 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/MovementMotor.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/MovementMotor.js deleted file mode 100644 index 3c5e58f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/MovementMotor.js +++ /dev/null @@ -1,20 +0,0 @@ -#pragma strict - -/* -This class can be used like an interface. -Inherit from it to define your own movement motor that can control -the movement of characters, enemies, or other entities. -*/ - -// The direction the character wants to move in, in world space. -// The vector should have a length between 0 and 1. -@HideInInspector -public var movementDirection : Vector3; - -// Simpler motors might want to drive movement based on a target purely -@HideInInspector -public var movementTarget : Vector3; - -// The direction the character wants to face towards, in world space. -@HideInInspector -public var facingDirection : Vector3; diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/MovementMotor.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/MovementMotor.js.meta deleted file mode 100644 index 5b9705d..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/MovementMotor.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7b8ae6d18282948edb7a0ae1a97e2bd4 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/PlayerMoveController.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/PlayerMoveController.js deleted file mode 100644 index fbfafda..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/PlayerMoveController.js +++ /dev/null @@ -1,272 +0,0 @@ -#pragma strict - -// Objects to drag in -public var motor : MovementMotor; -public var character : Transform; -public var cursorPrefab : GameObject; -public var joystickPrefab : GameObject; - -// Settings -public var cameraSmoothing : float = 0.01; -public var cameraPreview : float = 2.0f; - -// Cursor settings -public var cursorPlaneHeight : float = 0; -public var cursorFacingCamera : float = 0; -public var cursorSmallerWithDistance : float = 0; -public var cursorSmallerWhenClose : float = 1; - -// Private memeber data -private var mainCamera : Camera; - -private var cursorObject : Transform; -private var joystickLeft : Joystick; -private var joystickRight : Joystick; - -private var mainCameraTransform : Transform; -private var cameraVelocity : Vector3 = Vector3.zero; -private var cameraOffset : Vector3 = Vector3.zero; -private var initOffsetToPlayer : Vector3; - -// Prepare a cursor point varibale. This is the mouse position on PC and controlled by the thumbstick on mobiles. -private var cursorScreenPosition : Vector3; - -private var playerMovementPlane : Plane; - -private var joystickRightGO : GameObject; - -private var screenMovementSpace : Quaternion; -private var screenMovementForward : Vector3; -private var screenMovementRight : Vector3; - -function Awake () { - motor.movementDirection = Vector2.zero; - motor.facingDirection = Vector2.zero; - - // Set main camera - mainCamera = Camera.main; - mainCameraTransform = mainCamera.transform; - - // Ensure we have character set - // Default to using the transform this component is on - if (!character) - character = transform; - - initOffsetToPlayer = mainCameraTransform.position - character.position; - - #if UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY - if (joystickPrefab) { - // Create left joystick - var joystickLeftGO : GameObject = Instantiate (joystickPrefab) as GameObject; - joystickLeftGO.name = "Joystick Left"; - joystickLeft = joystickLeftGO.GetComponent. (); - - // Create right joystick - joystickRightGO = Instantiate (joystickPrefab) as GameObject; - joystickRightGO.name = "Joystick Right"; - joystickRight = joystickRightGO.GetComponent. (); - } - #elif !UNITY_FLASH - if (cursorPrefab) { - cursorObject = (Instantiate (cursorPrefab) as GameObject).transform; - } - #endif - - // Save camera offset so we can use it in the first frame - cameraOffset = mainCameraTransform.position - character.position; - - // Set the initial cursor position to the center of the screen - cursorScreenPosition = Vector3 (0.5 * Screen.width, 0.5 * Screen.height, 0); - - // caching movement plane - playerMovementPlane = new Plane (character.up, character.position + character.up * cursorPlaneHeight); -} - -function Start () { - #if UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY - // Move to right side of screen - var guiTex : GUITexture = joystickRightGO.GetComponent. (); - guiTex.pixelInset.x = Screen.width - guiTex.pixelInset.x - guiTex.pixelInset.width; - #endif - - // it's fine to calculate this on Start () as the camera is static in rotation - - screenMovementSpace = Quaternion.Euler (0, mainCameraTransform.eulerAngles.y, 0); - screenMovementForward = screenMovementSpace * Vector3.forward; - screenMovementRight = screenMovementSpace * Vector3.right; -} - -function OnDisable () { - if (joystickLeft) - joystickLeft.enabled = false; - - if (joystickRight) - joystickRight.enabled = false; -} - -function OnEnable () { - if (joystickLeft) - joystickLeft.enabled = true; - - if (joystickRight) - joystickRight.enabled = true; -} - -function Update () { - // HANDLE CHARACTER MOVEMENT DIRECTION - #if UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY - motor.movementDirection = joystickLeft.position.x * screenMovementRight + joystickLeft.position.y * screenMovementForward; - #else - motor.movementDirection = Input.GetAxis ("Horizontal") * screenMovementRight + Input.GetAxis ("Vertical") * screenMovementForward; - #endif - - // Make sure the direction vector doesn't exceed a length of 1 - // so the character can't move faster diagonally than horizontally or vertically - if (motor.movementDirection.sqrMagnitude > 1) - motor.movementDirection.Normalize(); - - - // HANDLE CHARACTER FACING DIRECTION AND SCREEN FOCUS POINT - - // First update the camera position to take into account how much the character moved since last frame - //mainCameraTransform.position = Vector3.Lerp (mainCameraTransform.position, character.position + cameraOffset, Time.deltaTime * 45.0f * deathSmoothoutMultiplier); - - // Set up the movement plane of the character, so screenpositions - // can be converted into world positions on this plane - //playerMovementPlane = new Plane (Vector3.up, character.position + character.up * cursorPlaneHeight); - - // optimization (instead of newing Plane): - - playerMovementPlane.normal = character.up; - playerMovementPlane.distance = -character.position.y + cursorPlaneHeight; - - // used to adjust the camera based on cursor or joystick position - - var cameraAdjustmentVector : Vector3 = Vector3.zero; - - #if UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY - - // On mobiles, use the thumb stick and convert it into screen movement space - motor.facingDirection = joystickRight.position.x * screenMovementRight + joystickRight.position.y * screenMovementForward; - - cameraAdjustmentVector = motor.facingDirection; - - #else - - #if !UNITY_EDITOR && (UNITY_XBOX360 || UNITY_PS3) - - // On consoles use the analog sticks - var axisX : float = Input.GetAxis("LookHorizontal"); - var axisY : float = Input.GetAxis("LookVertical"); - motor.facingDirection = axisX * screenMovementRight + axisY * screenMovementForward; - - cameraAdjustmentVector = motor.facingDirection; - - #else - - // On PC, the cursor point is the mouse position - var cursorScreenPosition : Vector3 = Input.mousePosition; - - // Find out where the mouse ray intersects with the movement plane of the player - var cursorWorldPosition : Vector3 = ScreenPointToWorldPointOnPlane (cursorScreenPosition, playerMovementPlane, mainCamera); - - var halfWidth : float = Screen.width / 2.0f; - var halfHeight : float = Screen.height / 2.0f; - var maxHalf : float = Mathf.Max (halfWidth, halfHeight); - - // Acquire the relative screen position - var posRel : Vector3 = cursorScreenPosition - Vector3 (halfWidth, halfHeight, cursorScreenPosition.z); - posRel.x /= maxHalf; - posRel.y /= maxHalf; - - cameraAdjustmentVector = posRel.x * screenMovementRight + posRel.y * screenMovementForward; - cameraAdjustmentVector.y = 0.0; - - // The facing direction is the direction from the character to the cursor world position - motor.facingDirection = (cursorWorldPosition - character.position); - motor.facingDirection.y = 0; - - // Draw the cursor nicely - HandleCursorAlignment (cursorWorldPosition); - - #endif - - #endif - - // HANDLE CAMERA POSITION - - // Set the target position of the camera to point at the focus point - var cameraTargetPosition : Vector3 = character.position + initOffsetToPlayer + cameraAdjustmentVector * cameraPreview; - - // Apply some smoothing to the camera movement - mainCameraTransform.position = Vector3.SmoothDamp (mainCameraTransform.position, cameraTargetPosition, cameraVelocity, cameraSmoothing); - - // Save camera offset so we can use it in the next frame - cameraOffset = mainCameraTransform.position - character.position; -} - -public static function PlaneRayIntersection (plane : Plane, ray : Ray) : Vector3 { - var dist : float; - plane.Raycast (ray, dist); - return ray.GetPoint (dist); -} - -public static function ScreenPointToWorldPointOnPlane (screenPoint : Vector3, plane : Plane, camera : Camera) : Vector3 { - // Set up a ray corresponding to the screen position - var ray : Ray = camera.ScreenPointToRay (screenPoint); - - // Find out where the ray intersects with the plane - return PlaneRayIntersection (plane, ray); -} - -function HandleCursorAlignment (cursorWorldPosition : Vector3) { - if (!cursorObject) - return; - - // HANDLE CURSOR POSITION - - // Set the position of the cursor object - cursorObject.position = cursorWorldPosition; - - #if !UNITY_FLASH - // Hide mouse cursor when within screen area, since we're showing game cursor instead - Cursor.visible = (Input.mousePosition.x < 0 || Input.mousePosition.x > Screen.width || Input.mousePosition.y < 0 || Input.mousePosition.y > Screen.height); - #endif - - - // HANDLE CURSOR ROTATION - - var cursorWorldRotation : Quaternion = cursorObject.rotation; - if (motor.facingDirection != Vector3.zero) - cursorWorldRotation = Quaternion.LookRotation (motor.facingDirection); - - // Calculate cursor billboard rotation - var cursorScreenspaceDirection : Vector3 = Input.mousePosition - mainCamera.WorldToScreenPoint (transform.position + character.up * cursorPlaneHeight); - cursorScreenspaceDirection.z = 0; - var cursorBillboardRotation : Quaternion = mainCameraTransform.rotation * Quaternion.LookRotation (cursorScreenspaceDirection, -Vector3.forward); - - // Set cursor rotation - cursorObject.rotation = Quaternion.Slerp (cursorWorldRotation, cursorBillboardRotation, cursorFacingCamera); - - - // HANDLE CURSOR SCALING - - // The cursor is placed in the world so it gets smaller with perspective. - // Scale it by the inverse of the distance to the camera plane to compensate for that. - var compensatedScale : float = 0.1 * Vector3.Dot (cursorWorldPosition - mainCameraTransform.position, mainCameraTransform.forward); - - // Make the cursor smaller when close to character - var cursorScaleMultiplier : float = Mathf.Lerp (0.7, 1.0, Mathf.InverseLerp (0.5, 4.0, motor.facingDirection.magnitude)); - - // Set the scale of the cursor - cursorObject.localScale = Vector3.one * Mathf.Lerp (compensatedScale, 1, cursorSmallerWithDistance) * cursorScaleMultiplier; - - // DEBUG - REMOVE LATER - if (Input.GetKey(KeyCode.O)) cursorFacingCamera += Time.deltaTime * 0.5; - if (Input.GetKey(KeyCode.P)) cursorFacingCamera -= Time.deltaTime * 0.5; - cursorFacingCamera = Mathf.Clamp01(cursorFacingCamera); - - if (Input.GetKey(KeyCode.K)) cursorSmallerWithDistance += Time.deltaTime * 0.5; - if (Input.GetKey(KeyCode.L)) cursorSmallerWithDistance -= Time.deltaTime * 0.5; - cursorSmallerWithDistance = Mathf.Clamp01(cursorSmallerWithDistance); -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/PlayerMoveController.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/PlayerMoveController.js.meta deleted file mode 100644 index bc0ffc7..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Movement/PlayerMoveController.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9d7c6dec62f844170bba875bf76e1dc4 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons.meta deleted file mode 100644 index ddfeda2..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 8b837384299528446bae732abe601e67 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/AutoFire.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/AutoFire.js deleted file mode 100644 index 585a8e6..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/AutoFire.js +++ /dev/null @@ -1,87 +0,0 @@ -#pragma strict - -@script RequireComponent (PerFrameRaycast) - -var bulletPrefab : GameObject; -var spawnPoint : Transform; -var frequency : float = 10; -var coneAngle : float = 1.5; -var firing : boolean = false; -var damagePerSecond : float = 20.0; -var forcePerSecond : float = 20.0; -var hitSoundVolume : float = 0.5; - -var muzzleFlashFront : GameObject; - -private var lastFireTime : float = -1; -private var raycast : PerFrameRaycast; - -function Awake () { - muzzleFlashFront.SetActive (false); - - raycast = GetComponent. (); - if (spawnPoint == null) - spawnPoint = transform; -} - -function Update () { - if (firing) { - - if (Time.time > lastFireTime + 1 / frequency) { - // Spawn visual bullet - var coneRandomRotation = Quaternion.Euler (Random.Range (-coneAngle, coneAngle), Random.Range (-coneAngle, coneAngle), 0); - var go : GameObject = Spawner.Spawn (bulletPrefab, spawnPoint.position, spawnPoint.rotation * coneRandomRotation) as GameObject; - var bullet : SimpleBullet = go.GetComponent. (); - - lastFireTime = Time.time; - - // Find the object hit by the raycast - var hitInfo : RaycastHit = raycast.GetHitInfo (); - if (hitInfo.transform) { - // Get the health component of the target if any - var targetHealth : Health = hitInfo.transform.GetComponent. (); - if (targetHealth) { - // Apply damage - targetHealth.OnDamage (damagePerSecond / frequency, -spawnPoint.forward); - } - - // Get the rigidbody if any - if (hitInfo.rigidbody) { - // Apply force to the target object at the position of the hit point - var force : Vector3 = transform.forward * (forcePerSecond / frequency); - hitInfo.rigidbody.AddForceAtPosition (force, hitInfo.point, ForceMode.Impulse); - } - - // Ricochet sound - //var sound : AudioClip = MaterialImpactManager.GetBulletHitSound (hitInfo.collider.sharedMaterial); - //AudioSource.PlayClipAtPoint (sound, hitInfo.point, hitSoundVolume); - - bullet.dist = hitInfo.distance; - } - else { - bullet.dist = 1000; - } - } - } -} - -function OnStartFire () { - if (Time.timeScale == 0) - return; - - firing = true; - - muzzleFlashFront.SetActive (true); - - if (GetComponent.()) - GetComponent.().Play (); -} - -function OnStopFire () { - firing = false; - - muzzleFlashFront.SetActive (false); - - if (GetComponent.()) - GetComponent.().Stop (); -} \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/AutoFire.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/AutoFire.js.meta deleted file mode 100644 index 6de2955..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/AutoFire.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: edbe95fd377dc49c48b1705091597601 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/Health.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/Health.js deleted file mode 100644 index 649f132..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/Health.js +++ /dev/null @@ -1,138 +0,0 @@ -#pragma strict - -public var maxHealth : float = 100.0; -public var health : float = 100.0; -public var regenerateSpeed : float = 0.0; -public var invincible : boolean = false; -public var dead : boolean = false; - -public var damagePrefab : GameObject; -public var damageEffectTransform : Transform; -public var damageEffectMultiplier : float = 1.0; -public var damageEffectCentered : boolean = true; - -public var scorchMarkPrefab : GameObject = null; -private var scorchMark : GameObject = null; - -public var damageSignals : SignalSender; -public var dieSignals : SignalSender; - -private var lastDamageTime : float = 0; -private var damageEffect : ParticleEmitter; -private var damageEffectCenterYOffset : float; - -private var colliderRadiusHeuristic : float = 1.0; - - -function Awake () { - enabled = false; - if (damagePrefab) { - if (damageEffectTransform == null) - damageEffectTransform = transform; - var effect : GameObject = Spawner.Spawn (damagePrefab, Vector3.zero, Quaternion.identity); - effect.transform.parent = damageEffectTransform; - effect.transform.localPosition = Vector3.zero; - damageEffect = effect.GetComponent.(); - var tempSize : Vector2 = Vector2(GetComponent.().bounds.extents.x,GetComponent.().bounds.extents.z); - colliderRadiusHeuristic = tempSize.magnitude * 0.5; - damageEffectCenterYOffset = GetComponent.().bounds.extents.y; - - } - if (scorchMarkPrefab) { - scorchMark = GameObject.Instantiate(scorchMarkPrefab, Vector3.zero, Quaternion.identity); - scorchMark.SetActive (false); - } -} - -function OnDamage (amount : float, fromDirection : Vector3) { - // Take no damage if invincible, dead, or if the damage is zero - if(invincible) - return; - if (dead) - return; - if (amount <= 0) - return; - - // Decrease health by damage and send damage signals - - // @HACK: this hack will be removed for the final game - // but makes playing and showing certain areas in the - // game a lot easier - /* - #if !UNITY_IPHONE && !UNITY_ANDROID && !UNITY_WP8 - if(gameObject.tag != "Player") - amount *= 10.0; - #endif - */ - - health -= amount; - damageSignals.SendSignals (this); - lastDamageTime = Time.time; - - // Enable so the Update function will be called - // if regeneration is enabled - if (regenerateSpeed > 0) - enabled = true; - - // Show damage effect if there is one - if (damageEffect) { - damageEffect.transform.rotation = Quaternion.LookRotation (fromDirection, Vector3.up); - if(!damageEffectCentered) { - var dir : Vector3 = fromDirection; - dir.y = 0.0; - damageEffect.transform.position = (transform.position + Vector3.up * damageEffectCenterYOffset) + colliderRadiusHeuristic * dir; - } - // @NOTE: due to popular demand (ethan, storm) we decided - // to make the amount damage independent ... - //var particleAmount = Random.Range (damageEffect.minEmission, damageEffect.maxEmission + 1); - //particleAmount = particleAmount * amount * damageEffectMultiplier; - damageEffect.Emit();// (particleAmount); - } - - // Die if no health left - if (health <= 0) - { -// GameScore.RegisterDeath (gameObject); - - health = 0; - dead = true; - dieSignals.SendSignals (this); - enabled = false; - - // scorch marks - if (scorchMark) { - scorchMark.SetActive (true); - // @NOTE: maybe we can justify a raycast here so we can place the mark - // on slopes with proper normal alignments - // @TODO: spawn a yield Sub() to handle placement, as we can - // spread calculations over several frames => cheap in total - var scorchPosition : Vector3 = GetComponent.().ClosestPointOnBounds (transform.position - Vector3.up * 100); - scorchMark.transform.position = scorchPosition + Vector3.up * 0.1; - scorchMark.transform.eulerAngles.y = Random.Range (0.0, 90.0); - } - } -} - -function OnEnable () { - Regenerate (); -} - -// Regenerate health - -function Regenerate () { - if (regenerateSpeed > 0.0f) { - while (enabled) { - if (Time.time > lastDamageTime + 3) { - health += regenerateSpeed; - - yield; - - if (health >= maxHealth) { - health = maxHealth; - enabled = false; - } - } - yield WaitForSeconds (1.0f); - } - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/Health.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/Health.js.meta deleted file mode 100644 index 0dcf65d..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/Health.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6616aa5ec43b64f87969bac954839e71 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/HealthFlash.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/HealthFlash.js deleted file mode 100644 index 906e2ce..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/HealthFlash.js +++ /dev/null @@ -1,22 +0,0 @@ - -#pragma strict - -public var playerHealth : Health; -public var healthMaterial : Material; - -private var healthBlink : float = 1.0f; -private var oneOverMaxHealth : float = 0.5f; - -function Start () { - oneOverMaxHealth = 1.0f / playerHealth.maxHealth; -} - -function Update () { - var relativeHealth : float = playerHealth.health * oneOverMaxHealth; - healthMaterial.SetFloat ("_SelfIllumination", relativeHealth * 2.0f * healthBlink); - - if (relativeHealth < 0.45f) - healthBlink = Mathf.PingPong (Time.time * 6.0f, 2.0f); - else - healthBlink = 1.0f; -} \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/HealthFlash.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/HealthFlash.js.meta deleted file mode 100644 index 396339f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/HealthFlash.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 25a41887c1f614a99bbf5dd2c3ede1d5 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/PerFrameRaycast.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/PerFrameRaycast.js deleted file mode 100644 index 4d8f7b6..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/PerFrameRaycast.js +++ /dev/null @@ -1,18 +0,0 @@ -#pragma strict - -private var hitInfo : RaycastHit; -private var tr : Transform; - -function Awake () { - tr = transform; -} - -function Update () { - // Cast a ray to find out the end point of the laser - hitInfo = RaycastHit (); - Physics.Raycast (tr.position, tr.forward, hitInfo); -} - -function GetHitInfo () : RaycastHit { - return hitInfo; -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/PerFrameRaycast.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/PerFrameRaycast.js.meta deleted file mode 100644 index 0ded867..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/PerFrameRaycast.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 52152dd6c99c14e64a97087106b52477 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/SimpleBullet.js b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/SimpleBullet.js deleted file mode 100644 index c8ea115..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/SimpleBullet.js +++ /dev/null @@ -1,21 +0,0 @@ -#pragma strict - -var speed : float = 10; -var lifeTime : float = 0.5; -var dist : float = 10000; - -private var spawnTime : float = 0.0; -private var tr : Transform; - -function OnEnable () { - tr = transform; - spawnTime = Time.time; -} - -function Update () { - tr.position += tr.forward * speed * Time.deltaTime; - dist -= speed * Time.deltaTime; - if (Time.time > spawnTime + lifeTime || dist < 0) { - Spawner.Destroy (gameObject); - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/SimpleBullet.js.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/SimpleBullet.js.meta deleted file mode 100644 index 533e2d1..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Scripts/Weapons/SimpleBullet.js.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 42948b8c903d84cca9ae54d9f2a1a1d6 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders.meta deleted file mode 100644 index 681acd3..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: d426f4f55fb97a248ac216fcec9cc7bf -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters.meta deleted file mode 100644 index 8b2269e..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: b3a36b75a3f1da44ab762505be44e718 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/AngryInclude.cginc b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/AngryInclude.cginc deleted file mode 100644 index e122b39..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/AngryInclude.cginc +++ /dev/null @@ -1,22 +0,0 @@ -// Upgrade NOTE: unity_Scale shader variable was removed; replaced 'unity_Scale.w' with '1.0' - - -#ifndef ANGRY_CG_INCLUDED -#define ANGRY_CG_INCLUDED - -#include "UnityCG.cginc" - -void WriteTangentSpaceData (appdata_full v, out half3 ts0, out half3 ts1, out half3 ts2) { - TANGENT_SPACE_ROTATION; - ts0 = mul(rotation, _Object2World[0].xyz * 1.0); - ts1 = mul(rotation, _Object2World[1].xyz * 1.0); - ts2 = mul(rotation, _Object2World[2].xyz * 1.0); -} - -half2 EthansFakeReflection (half4 vtx) { - half3 worldSpace = mul(_Object2World, vtx).xyz; - worldSpace = (-_WorldSpaceCameraPos * 0.6 + worldSpace) * 0.07; - return worldSpace.xz; -} - -#endif \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/AngryInclude.cginc.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/AngryInclude.cginc.meta deleted file mode 100644 index 32044f5..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/AngryInclude.cginc.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 79a10448ba009433ebaf9d089fa9242f diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/CharacterSelfIlluminationReflective.shader b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/CharacterSelfIlluminationReflective.shader deleted file mode 100644 index b1e73bf..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/CharacterSelfIlluminationReflective.shader +++ /dev/null @@ -1,174 +0,0 @@ - -/* - -the - -CharacterSelfIlluminationReflective - -performs optimized custom character lighting (self illumination enabled and - reflective (with a simple heuristic for the reflection mask)) - -*/ - -Shader "AngryBots/Character/CharacterSelfIlluminationReflective" { - - Properties { - _MainTex ("Base (RGB) Gloss (A)", 2D) = "grey" {} - _BumpMap ("Normalmap", 2D) = "bump" {} - _Cube ("Cube", CUBE) = "black" {} - _SelfIllumStrength ("_SelfIllumStrength", Range(0.0, 1.5)) = 1.0 - _RoomReflectionAmount ("RoomReflectionAmount", Range(0.0, 3.5)) = 3.0 - } - - CGINCLUDE - - #include "UnityCG.cginc" - #include "AngryInclude.cginc" - - uniform float4x4 _CameraToWorld; - uniform half4 _MainTex_ST; - uniform sampler2D _MainTex; - uniform sampler2D _BumpMap; - uniform samplerCUBE _Cube; - - uniform fixed _RoomReflectionAmount; - uniform fixed _SelfIllumStrength; - - half3 VertexLightsWorldSpace (half3 WP, half3 WN) - { - half3 lightColor = half3(0.0,0.0,0.0); - - // preface & optimization - half3 toLight0 = mul(_CameraToWorld, unity_LightPosition[0] * half4(1,1,-1,1)).xyz - WP; - half3 toLight1 = mul(_CameraToWorld, unity_LightPosition[1] * half4(1,1,-1,1)).xyz - WP; - half2 lengthSq2 = half2(dot(toLight0, toLight0), dot(toLight1, toLight1)); - - half2 atten2 = half2(1.0,1.0) + lengthSq2 * half2(unity_LightAtten[0].z, unity_LightAtten[1].z); - atten2 = 1.0 / atten2; - - // light #0 - half diff = saturate (dot (WN, normalize(toLight0))); - lightColor += unity_LightColor[0].rgb * (diff * atten2.x); - - // light #1 - diff = saturate (dot (WN, normalize(toLight1))); - lightColor += unity_LightColor[1].rgb * (diff * atten2.y); - - return lightColor * 1.75 + 0.2; - } - - ENDCG - - SubShader { - LOD 300 - Lighting on - Tags { "RenderType"="Opaque" "Reflection" = "RenderReflectionOpaque" "Queue"="Geometry" } - - Pass { - - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - struct v2f_full - { - half4 pos : POSITION; - half3 color : TEXCOORD0; - half2 uv : TEXCOORD1; - half3 viewDir : TEXCOORD2; - half3 tsBase0 : TEXCOORD3; - half3 tsBase1 : TEXCOORD4; - half3 tsBase2 : TEXCOORD5; - }; - - v2f_full vert (appdata_full v) - { - v2f_full o; - - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); - - half3 worldPos = mul(_Object2World, v.vertex).xyz; - half3 worldNormal = mul((half3x3)_Object2World, v.normal.xyz); - - o.color = VertexLightsWorldSpace(worldPos, worldNormal); - - o.uv.xy = TRANSFORM_TEX(v.texcoord, _MainTex); - o.viewDir = (_WorldSpaceCameraPos.xyz - worldPos); - - WriteTangentSpaceData(v, o.tsBase0,o.tsBase1,o.tsBase2); - - return o; - } - - fixed4 frag (v2f_full i) : COLOR - { - fixed4 tex = tex2D(_MainTex, i.uv.xy); - half3 nrml = UnpackNormal(tex2D(_BumpMap, i.uv.xy)); - half3 bumpedNormal = half3(dot(i.tsBase0,nrml), dot(i.tsBase1,nrml), dot(i.tsBase2,nrml)); - - half3 reflDir = reflect(i.viewDir, bumpedNormal); - fixed4 refl = texCUBE (_Cube, reflDir); - half4 outColor = tex; - outColor.rgb *= i.color + tex.a * _SelfIllumStrength; - outColor += refl * _RoomReflectionAmount * saturate(tex.b - 0.225); - return outColor; - } - - ENDCG - } - } - - SubShader { - LOD 190 - Lighting on - Tags { "RenderType"="Opaque" "Reflection" = "RenderReflectionOpaque" "Queue"="Geometry" } - - Pass { - - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - struct v2f - { - half4 pos : POSITION; - half3 color : TEXCOORD0; - half2 uv : TEXCOORD1; - half3 reflDir : TEXCOORD2; - }; - - v2f vert (appdata_base v) - { - v2f o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); - - half3 worldPos = mul(_Object2World, v.vertex).xyz; - half3 worldNormal = mul((half3x3)_Object2World, v.normal.xyz); - - o.color = VertexLightsWorldSpace(worldPos, worldNormal); - - o.uv.xy = TRANSFORM_TEX(v.texcoord,_MainTex); - o.reflDir = (_WorldSpaceCameraPos.xyz - worldPos); - o.reflDir = reflect (o.reflDir, worldNormal); - - return o; - } - - fixed4 frag (v2f i) : COLOR - { - fixed4 tex = tex2D(_MainTex, i.uv.xy); - fixed4 refl = texCUBE (_Cube, i.reflDir); - half4 outColor = tex; - outColor.rgb *= i.color + tex.a * _SelfIllumStrength; - outColor += refl * _RoomReflectionAmount * saturate(tex.b - 0.225); - return outColor; - } - - ENDCG - } - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/CharacterSelfIlluminationReflective.shader.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/CharacterSelfIlluminationReflective.shader.meta deleted file mode 100644 index 237060f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/CharacterSelfIlluminationReflective.shader.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 8de45c360a2d542f4be2d61da2beba10 -ShaderImporter: - defaultTextures: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/EnemySelfIlluminationReflective.shader b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/EnemySelfIlluminationReflective.shader deleted file mode 100644 index 4e40f09..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/EnemySelfIlluminationReflective.shader +++ /dev/null @@ -1,163 +0,0 @@ - -/* - -the - -EnemySelfIlluminationReflective - -is a cheaper and less accurate version of the -CharacterSelfIlluminationReflective shader but pretty -much the same on highest quality setting - -*/ - -Shader "AngryBots/Character/EnemySelfIlluminationReflective" { - - Properties { - _MainTex ("Base (RGB) Gloss (A)", 2D) = "grey" {} - _BumpMap ("Normalmap", 2D) = "bump" {} - _Cube ("Cube", CUBE) = "black" {} - _SelfIllumStrength ("_SelfIllumStrength", Range(0.0, 1.5)) = 1.0 - } - - CGINCLUDE - - #include "UnityCG.cginc" - #include "AngryInclude.cginc" - - uniform half4 _MainTex_ST; - uniform sampler2D _MainTex; - uniform samplerCUBE _Cube; - uniform fixed _SelfIllumStrength; - uniform sampler2D _BumpMap; - uniform float4x4 _CameraToWorld; - - half3 VertexLightsWorldSpace (half3 WP, half3 WN) - { - half3 lightColor = half3(0.0,0.0,0.0); - - // preface & optimization - half3 toLight0 = mul(_CameraToWorld, unity_LightPosition[0] * half4(1,1,-1,1)).xyz - WP; - half3 toLight1 = mul(_CameraToWorld, unity_LightPosition[1] * half4(1,1,-1,1)).xyz - WP; - half2 lengthSq2 = half2(dot(toLight0, toLight0), dot(toLight1, toLight1)); - - half2 atten2 = half2(1.0,1.0) + lengthSq2 * half2(unity_LightAtten[0].z, unity_LightAtten[1].z); - atten2 = 1.0 / atten2; - - // light #0 - half diff = saturate (dot (WN, normalize(toLight0))); - lightColor += unity_LightColor[0].rgb * (diff * atten2.x); - - // light #1 - diff = saturate (dot (WN, normalize(toLight1))); - lightColor += unity_LightColor[1].rgb * (diff * atten2.y); - - return lightColor * 1.75 + 0.2; - } - - ENDCG - - SubShader { - LOD 300 - Lighting on - Tags { "RenderType"="Opaque" "Reflection" = "RenderReflectionOpaque" "Queue"="Geometry" } - - Pass { - - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - struct v2f_full - { - half4 pos : POSITION; - half3 color : TEXCOORD0; - half2 uv : TEXCOORD1; - half3 viewDir : TEXCOORD2; - half3 tsBase0 : TEXCOORD3; - half3 tsBase1 : TEXCOORD4; - half3 tsBase2 : TEXCOORD5; - }; - - v2f_full vert (appdata_full v) - { - v2f_full o; - - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); - - half3 worldPos = mul(_Object2World, v.vertex).xyz; - half3 worldNormal = mul((half3x3)_Object2World, v.normal.xyz); - - o.color = VertexLightsWorldSpace(worldPos, worldNormal); - - o.uv.xy = TRANSFORM_TEX(v.texcoord, _MainTex); - o.viewDir = (_WorldSpaceCameraPos.xyz - worldPos); - - WriteTangentSpaceData(v, o.tsBase0,o.tsBase1,o.tsBase2); - - return o; - } - - fixed4 frag (v2f_full i) : COLOR - { - fixed4 tex = tex2D(_MainTex, i.uv.xy); - half3 nrml = UnpackNormal(tex2D(_BumpMap, i.uv.xy)); - half3 bumpedNormal = half3(dot(i.tsBase0,nrml), dot(i.tsBase1,nrml), dot(i.tsBase2,nrml)); - half3 reflDir = reflect(i.viewDir, bumpedNormal); - fixed4 refl = texCUBE (_Cube, reflDir); - fixed4 outColor = half4((i.color + tex.a * _SelfIllumStrength) * tex, 1.0); - outColor += refl * 3.0 * saturate(tex.g - 0.25) * (1.0 - tex.a); - return outColor; - } - - ENDCG - } - } - - SubShader { - LOD 190 - Lighting on - Tags { "RenderType"="Opaque" "Reflection" = "RenderReflectionOpaque" "Queue"="Geometry" } - - Pass { - - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - struct v2f - { - half4 pos : POSITION; - half4 color : TEXCOORD0; - half2 uv : TEXCOORD1; - half3 reflDir : TEXCOORD2; - }; - - v2f vert (appdata_base v) - { - v2f o; - o.color = (unity_LightColor[0] + unity_LightColor[1]) * 0.2; // heuristic for the lighting, works 'ok' in AngryBots, but is not a general solution - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); - o.uv.xy = TRANSFORM_TEX(v.texcoord, _MainTex); - o.reflDir = WorldSpaceViewDir (v.vertex); - o.reflDir = reflect (o.reflDir, mul((half3x3)_Object2World, v.normal.xyz)); - return o; - } - - fixed4 frag (v2f i) : COLOR - { - fixed4 tex = tex2D(_MainTex, i.uv.xy); - fixed4 refl = texCUBE (_Cube, i.reflDir); - fixed4 outColor = (i.color + tex.a * _SelfIllumStrength) * tex; - outColor += refl * 3.0 * saturate(tex.g - 0.25) * (1.0 - tex.a); - return outColor; - } - - ENDCG - } - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/EnemySelfIlluminationReflective.shader.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/EnemySelfIlluminationReflective.shader.meta deleted file mode 100644 index def8e3d..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/EnemySelfIlluminationReflective.shader.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: b6adcc18389e141f68abe08051c54567 -ShaderImporter: - defaultTextures: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/Fallback.shader b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/Fallback.shader deleted file mode 100644 index 124ca9c..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/Fallback.shader +++ /dev/null @@ -1,72 +0,0 @@ -// Upgrade NOTE: commented out 'half4 unity_LightmapST', a built-in variable -// Upgrade NOTE: commented out 'sampler2D unity_Lightmap', a built-in variable -// Upgrade NOTE: replaced tex2D unity_Lightmap with UNITY_SAMPLE_TEX2D - - - -Shader "AngryBots/Fallback" { - -Properties { - _MainTex ("Base", 2D) = "white" {} -} - - -CGINCLUDE - -struct v2f -{ - half4 pos : SV_POSITION; - half2 uv : TEXCOORD0; - half2 uv2 : TEXCOORD1; -}; - -#include "AngryInclude.cginc" - -sampler2D _MainTex; - -ENDCG - -SubShader { - Tags { "RenderType"="Opaque" } - LOD 140 - - Pass { - CGPROGRAM - - // half4 unity_LightmapST; - // sampler2D unity_Lightmap; - half4 _MainTex_ST; - - v2f vert (appdata_full v) - { - v2f o; - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); - o.uv = TRANSFORM_TEX(v.texcoord, _MainTex); - o.uv2 = v.texcoord1 * unity_LightmapST.xy + unity_LightmapST.zw; - return o; - } - - fixed4 frag (v2f i) : COLOR0 - { - fixed4 tex = tex2D (_MainTex, i.uv); - #ifdef LIGHTMAP_ON - fixed3 lm = DecodeLightmap (UNITY_SAMPLE_TEX2D(unity_Lightmap, i.uv2)); - tex.rgb *= lm; - #else - tex.rgb *= 0.65; - #endif - return tex; - } - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON - - ENDCG - } -} - -FallBack Off -} - diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/Fallback.shader.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/Fallback.shader.meta deleted file mode 100644 index a3d3180..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/Fallback.shader.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 29ddf4444ca8645d681e4ca451421c8d -ShaderImporter: - defaultTextures: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/PlanarRealtimeReflection.shader b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/PlanarRealtimeReflection.shader deleted file mode 100644 index 5439d3b..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/PlanarRealtimeReflection.shader +++ /dev/null @@ -1,161 +0,0 @@ -// Upgrade NOTE: commented out 'half4 unity_LightmapST', a built-in variable -// Upgrade NOTE: commented out 'sampler2D unity_Lightmap', a built-in variable -// Upgrade NOTE: replaced tex2D unity_Lightmap with UNITY_SAMPLE_TEX2D - - -/* - -(realtime & planar) reflection shader. - -handles simple planar (y is up) bump displacement of planar reflections. - -*/ - -Shader "AngryBots/PlanarRealtimeReflection" { - Properties { - _MainTex ("Base", 2D) = "white" {} - _ReflectionTex ("Internal reflection", 2D) = "black" {} - _CubeReflTex ("Cube", CUBE) = "black" {} - _Normals ("Normal", 2D) = "bump" {} - } - - CGINCLUDE - - #include "UnityCG.cginc" - - sampler2D _MainTex; - sampler2D _ReflectionTex; - sampler2D _Normals; - samplerCUBE _CubeReflTex; - - struct v2f { - half4 pos : SV_POSITION; - half2 uv : TEXCOORD0; - half4 scr : TEXCOORD1; - half2 uvLM : TEXCOORD2; - }; - - struct v2f_full { - half4 pos : SV_POSITION; - half2 uv : TEXCOORD0; - half4 scr : TEXCOORD1; - half3 tsBase0 : TEXCOORD2; - half3 tsBase1 : TEXCOORD3; - half3 tsBase2 : TEXCOORD4; - half3 viewDir : TEXCOORD5; - half2 uvLM : TEXCOORD6; - }; - - ENDCG - - SubShader { - LOD 400 - - Tags { "RenderType"="Opaque" } - Fog { Mode Off } - - Pass { - - CGPROGRAM - - #include "AngryInclude.cginc" - - uniform half4 _MainTex_ST; - // half4 unity_LightmapST; - // sampler2D unity_Lightmap; - - v2f_full vert(appdata_full v) - { - v2f_full o; - - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); - - o.uv.xy = TRANSFORM_TEX(v.texcoord.xy, _MainTex); - - o.scr = ComputeScreenPos(o.pos); - - o.uvLM = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; - - WriteTangentSpaceData(v, o.tsBase0,o.tsBase1,o.tsBase2); - o.viewDir = normalize(WorldSpaceViewDir(v.vertex)); - - return o; - } - - half4 frag( v2f_full i ) : COLOR - { - half3 normals = UnpackNormal(tex2D(_Normals, i.uv.xy)); - half3 bumpedNormal = half3(dot(i.tsBase0,normals), dot(i.tsBase1,normals), dot(i.tsBase2,normals)); - - half3 reflectVector = reflect(-i.viewDir.xyz, bumpedNormal.xyz); - - half4 color = tex2D(_MainTex, i.uv); - i.scr = i.scr/i.scr.w; - - fixed3 lm = DecodeLightmap (UNITY_SAMPLE_TEX2D(unity_Lightmap, i.uvLM.xy)); - color.rgb *= lm; - - i.scr.xy += normals.xy; - return color + tex2D(_ReflectionTex, i.scr.xy) + texCUBE(_CubeReflTex, reflectVector) * 0.1; - } - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - ENDCG - - } - } - - SubShader { - LOD 200 - - Tags { "RenderType"="Opaque" } - Fog { Mode Off } - - Pass { - - CGPROGRAM - - uniform half4 _MainTex_ST; - // half4 unity_LightmapST; - // sampler2D unity_Lightmap; - - v2f vert(appdata_full v) - { - v2f o; - - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); - - o.uv = TRANSFORM_TEX(v.texcoord, _MainTex); - o.uvLM = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; - - o.scr = ComputeScreenPos(o.pos); - - return o; - } - - fixed4 frag( v2f i ) : COLOR - { - fixed4 color = tex2D(_MainTex, i.uv); - - fixed3 lm = DecodeLightmap(UNITY_SAMPLE_TEX2D(unity_Lightmap, i.uvLM)); - color.rgb *= lm; - - half2 screen = (i.scr.xy / i.scr.w); - - return color + tex2D(_ReflectionTex, screen) * color.a; - } - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - ENDCG - - } - } - - FallBack "AngryBots/Fallback" -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/PlanarRealtimeReflection.shader.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/PlanarRealtimeReflection.shader.meta deleted file mode 100644 index 63744a5..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/PlanarRealtimeReflection.shader.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 91083837e9bad4a5f8211c02db74526e -ShaderImporter: - defaultTextures: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/ReflectiveBackgroundPlanar.shader b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/ReflectiveBackgroundPlanar.shader deleted file mode 100644 index cee83a7..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/ReflectiveBackgroundPlanar.shader +++ /dev/null @@ -1,160 +0,0 @@ -// Upgrade NOTE: commented out 'half4 unity_LightmapST', a built-in variable -// Upgrade NOTE: commented out 'sampler2D unity_Lightmap', a built-in variable -// Upgrade NOTE: replaced tex2D unity_Lightmap with UNITY_SAMPLE_TEX2D - - -/* - -one of the most common shader in AngryBots, requires lightmap - -handles simple CUBE map reflections (higher end) or -fake planar (y is up) reflections (low end) - -*/ - -Shader "AngryBots/ReflectiveBackgroundPlanarGeometry" { - -Properties { - _MainTex ("Base", 2D) = "white" {} - _Cube ("Cube", Cube) = "" {} - _2DReflect ("2D Reflection", 2D) = "" {} - _Normal("Normal", 2D) = "bump" {} - _EmissionLM ("Emission (Lightmapper)", Float) = 0 -} - -CGINCLUDE - -// interpolator structs - -struct v2f -{ - half4 pos : SV_POSITION; - half2 uv : TEXCOORD0; - half2 uv2 : TEXCOORD1; - half2 uvLM : TEXCOORD2; -}; - -struct v2f_full -{ - half4 pos : SV_POSITION; - half2 uv : TEXCOORD0; - half3 worldViewDir : TEXCOORD1; - half3 tsBase0 : TEXCOORD2; - half3 tsBase1 : TEXCOORD3; - half3 tsBase2 : TEXCOORD4; - half2 uvLM : TEXCOORD5; -}; - -#include "AngryInclude.cginc" - -sampler2D _MainTex; -samplerCUBE _Cube; -sampler2D _2DReflect; -sampler2D _Normal; - -ENDCG - - -SubShader { - Tags { "RenderType"="Opaque" } - LOD 300 - - Pass { - CGPROGRAM - - half4 _MainTex_ST; - // half4 unity_LightmapST; - // sampler2D unity_Lightmap; - - v2f_full vert (appdata_full v) - { - v2f_full o; - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); - o.uv = TRANSFORM_TEX(v.texcoord,_MainTex); - - o.uvLM = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; - - o.worldViewDir = normalize(WorldSpaceViewDir(v.vertex)); - - WriteTangentSpaceData(v, o.tsBase0, o.tsBase1, o.tsBase2); - - return o; - } - - - fixed4 frag (v2f_full i) : COLOR0 - { - half3 nrml = UnpackNormal(tex2D(_Normal, i.uv.xy)); - half3 bumpedNormal = half3(dot(i.tsBase0,nrml), dot(i.tsBase1,nrml), dot(i.tsBase2,nrml)); - - half3 reflectVector = reflect(normalize(-i.worldViewDir.xyz), normalize(bumpedNormal.xyz)); - - half4 refl = texCUBE(_Cube, (reflectVector)); - - fixed4 tex = tex2D (_MainTex, i.uv.xy); - - tex += refl * tex.a; - - fixed3 lm = DecodeLightmap (UNITY_SAMPLE_TEX2D(unity_Lightmap, i.uvLM.xy)); - tex.rgb *= lm; - - return tex; - - } - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - ENDCG - } -} - -SubShader { - Tags { "RenderType"="Opaque" } - LOD 200 - - Pass { - CGPROGRAM - - half4 _MainTex_ST; - // half4 unity_LightmapST; - // sampler2D unity_Lightmap; - - v2f vert (appdata_full v) - { - v2f o; - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); - o.uv = TRANSFORM_TEX (v.texcoord, _MainTex); - o.uvLM = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; - o.uv2 = EthansFakeReflection (v.vertex); - - return o; - } - - fixed4 frag (v2f i) : COLOR0 - { - fixed4 tex = tex2D (_MainTex, i.uv); - - fixed4 refl = tex2D (_2DReflect, i.uv2); - tex += refl * tex.a; - - #ifdef LIGHTMAP_ON - fixed3 lm = DecodeLightmap (UNITY_SAMPLE_TEX2D (unity_Lightmap, i.uvLM)); - tex.rgb *= lm; - #endif - - return tex; - } - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON - - ENDCG - } -} - -FallBack "AngryBots/Fallback" -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/ReflectiveBackgroundPlanar.shader.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/ReflectiveBackgroundPlanar.shader.meta deleted file mode 100644 index f8bf3ac..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/ReflectiveBackgroundPlanar.shader.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: d3fe6e8745b794a77bfeb9a10c0fdddb -ShaderImporter: - defaultTextures: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/SuperSimpleSelfIllumination.shader b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/SuperSimpleSelfIllumination.shader deleted file mode 100644 index 0da39a3..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/SuperSimpleSelfIllumination.shader +++ /dev/null @@ -1,55 +0,0 @@ -/* - -illum shader. - -self illumination based on base texture alpha channel. - -*/ - -Shader "AngryBots/SimpleSelfIllumination" { - -Properties { - _MainTex ("Base", 2D) = "grey" {} - _SelfIllumination ("Self Illumination", Range(0.0,2.0)) = 1.0 -} - -SubShader { - Pass { - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - - #include "UnityCG.cginc" - - uniform half4 _MainTex_ST; - uniform sampler2D _MainTex; - uniform fixed _SelfIllumination; - - struct v2f - { - half4 pos : POSITION; - half2 uv : TEXCOORD0; - }; - - v2f vert (appdata_base v) - { - v2f o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); - o.uv.xy = TRANSFORM_TEX(v.texcoord,_MainTex); - - return o; - } - - half4 frag (v2f i) : COLOR - { - fixed4 tex = tex2D(_MainTex, i.uv.xy); - return tex * tex.a * _SelfIllumination; - } - - ENDCG - } -} - -FallBack Off -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/SuperSimpleSelfIllumination.shader.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/SuperSimpleSelfIllumination.shader.meta deleted file mode 100644 index 5f9b2a1..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/BackgroundAndCharacters/SuperSimpleSelfIllumination.shader.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: df67c9bbb62a547f89e7224c115f0f12 -ShaderImporter: - defaultTextures: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx.meta deleted file mode 100644 index fa064b1..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: b07d5f1bc66f2cd45a52c218d59381a8 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Additive.shader b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Additive.shader deleted file mode 100644 index 27aa4ec..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Additive.shader +++ /dev/null @@ -1,59 +0,0 @@ - -Shader "AngryBots/FX/Additive" { - Properties { - _MainTex ("Base", 2D) = "white" {} - _TintColor ("TintColor", Color) = (1.0, 1.0, 1.0, 1.0) - } - - CGINCLUDE - - #include "UnityCG.cginc" - - sampler2D _MainTex; - fixed4 _TintColor; - - half4 _MainTex_ST; - - struct v2f { - half4 pos : SV_POSITION; - half2 uv : TEXCOORD0; - }; - - v2f vert(appdata_full v) { - v2f o; - - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); - o.uv.xy = TRANSFORM_TEX(v.texcoord, _MainTex); - - return o; - } - - fixed4 frag( v2f i ) : COLOR { - return tex2D (_MainTex, i.uv.xy) * _TintColor; - } - - ENDCG - - SubShader { - Tags { "RenderType" = "Transparent" "Reflection" = "RenderReflectionTransparentAdd" "Queue" = "Transparent"} - Cull Off - Lighting Off - ZWrite Off - Fog { Mode Off } - Blend One One - - Pass { - - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - ENDCG - - } - - } - FallBack Off -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Additive.shader.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Additive.shader.meta deleted file mode 100644 index f405153..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Additive.shader.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: bbf40922523a2483584b1c4e6b1132ea -ShaderImporter: - defaultTextures: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Cursor.shader b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Cursor.shader deleted file mode 100644 index fa5c4b9..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Cursor.shader +++ /dev/null @@ -1,58 +0,0 @@ - -Shader "AngryBots/FX/Cursor" { - Properties { - _MainTex ("Base", 2D) = "white" {} - } - - CGINCLUDE - - #include "UnityCG.cginc" - - sampler2D _MainTex; - - half4 _MainTex_ST; - - struct v2f { - half4 pos : SV_POSITION; - half2 uv : TEXCOORD0; - }; - - v2f vert(appdata_full v) { - v2f o; - - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); - o.uv.xy = TRANSFORM_TEX(v.texcoord, _MainTex); - - return o; - } - - fixed4 frag( v2f i ) : COLOR { - return tex2D (_MainTex, i.uv.xy); - } - - ENDCG - - SubShader { - Tags { "RenderType" = "Transparent" "Queue" = "Transparent+100"} - Cull Off - Lighting Off - ZWrite Off - ZTest Always - Fog { Mode Off } - Blend SrcAlpha OneMinusSrcAlpha - - Pass { - - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - ENDCG - - } - - } - FallBack Off -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Cursor.shader.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Cursor.shader.meta deleted file mode 100644 index 52da017..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Cursor.shader.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: fd219401e0edb4c1aafda4903ecdcb8e -ShaderImporter: - defaultTextures: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/LaserScope.shader b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/LaserScope.shader deleted file mode 100644 index 3ffb86c..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/LaserScope.shader +++ /dev/null @@ -1,63 +0,0 @@ - -Shader "AngryBots/FX/LaserScope" { - Properties { - _MainTex ("MainTex", 2D) = "white" - _NoiseTex ("NoiseTex", 2D) = "white" - } - - CGINCLUDE - - #include "UnityCG.cginc" - - sampler2D _MainTex; - sampler2D _NoiseTex; - - half4 _MainTex_ST; - half4 _NoiseTex_ST; - - fixed4 _TintColor; - - struct v2f { - half4 pos : SV_POSITION; - half4 uv : TEXCOORD0; - }; - - v2f vert(appdata_full v) - { - v2f o; - - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); - o.uv.xy = TRANSFORM_TEX(v.texcoord, _MainTex); - o.uv.zw = TRANSFORM_TEX(v.texcoord, _NoiseTex); - - return o; - } - - fixed4 frag( v2f i ) : COLOR - { - return tex2D (_MainTex, i.uv.xy) * tex2D (_NoiseTex, i.uv.zw); - } - - ENDCG - - SubShader { - Tags { "RenderType" = "Transparent" "Reflection" = "LaserScope" "Queue" = "Transparent"} - Cull Off - ZWrite Off - Blend SrcAlpha One - - Pass { - - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - ENDCG - - } - - } - FallBack Off -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/LaserScope.shader.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/LaserScope.shader.meta deleted file mode 100644 index beff205..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/LaserScope.shader.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: f97e84bb5d33542f18a19a75fc878eb5 -ShaderImporter: - defaultTextures: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Multiply.shader b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Multiply.shader deleted file mode 100644 index b97ac3d..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Multiply.shader +++ /dev/null @@ -1,55 +0,0 @@ - -Shader "AngryBots/FX/Multiply" { - Properties { - _MainTex ("Base", 2D) = "white" {} - } - - CGINCLUDE - - #include "UnityCG.cginc" - - sampler2D _MainTex; - - struct v2f { - half4 pos : SV_POSITION; - half2 uv : TEXCOORD0; - }; - - v2f vert(appdata_full v) { - v2f o; - - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); - o.uv.xy = v.texcoord.xy; - - return o; - } - - fixed4 frag( v2f i ) : COLOR { - return tex2D (_MainTex, i.uv.xy); - } - - ENDCG - - SubShader { - Tags { "RenderType" = "Transparent" "Queue" = "Transparent" } - Cull Off - Lighting Off - ZWrite Off - Fog { Mode Off } - Blend Zero SrcColor - - Pass { - - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - ENDCG - - } - - } - FallBack Off -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Multiply.shader.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Multiply.shader.meta deleted file mode 100644 index a3433b9..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/Multiply.shader.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 9f64a9d4ccf54440db2d1452fb040528 -ShaderImporter: - defaultTextures: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleAdditive.shader b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleAdditive.shader deleted file mode 100644 index 3cdd9b8..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleAdditive.shader +++ /dev/null @@ -1,60 +0,0 @@ - -Shader "AngryBots/Particle/Additive" { - Properties { - _MainTex ("Base", 2D) = "white" {} - _TintColor ("TintColor", Color) = (1.0, 1.0, 1.0, 1.0) - } - - CGINCLUDE - - #include "UnityCG.cginc" - - sampler2D _MainTex; - fixed4 _TintColor; - half4 _MainTex_ST; - - struct v2f { - half4 pos : SV_POSITION; - half2 uv : TEXCOORD0; - fixed4 vertexColor : COLOR; - }; - - v2f vert(appdata_full v) { - v2f o; - - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); - o.uv = TRANSFORM_TEX(v.texcoord, _MainTex); - o.vertexColor = v.color * _TintColor; - - return o; - } - - fixed4 frag( v2f i ) : COLOR { - return tex2D (_MainTex, i.uv.xy) * i.vertexColor; - } - - ENDCG - - SubShader { - Tags { "RenderType" = "Transparent" "Queue" = "Transparent"} - Cull Off - Lighting Off - ZWrite Off - Fog { Mode Off } - Blend One One - - Pass { - - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - ENDCG - - } - - } - FallBack Off -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleAdditive.shader.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleAdditive.shader.meta deleted file mode 100644 index 118713e..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleAdditive.shader.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: e364bec85c316420092937bb9d21855e -ShaderImporter: - defaultTextures: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleAdditiveBlend.shader b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleAdditiveBlend.shader deleted file mode 100644 index e735438..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleAdditiveBlend.shader +++ /dev/null @@ -1,60 +0,0 @@ - -Shader "AngryBots/Particle/AdditiveBlend" { - Properties { - _MainTex ("Base", 2D) = "white" {} - _TintColor ("TintColor", Color) = (1.0, 1.0, 1.0, 1.0) - } - - CGINCLUDE - - #include "UnityCG.cginc" - - sampler2D _MainTex; - fixed4 _TintColor; - half4 _MainTex_ST; - - struct v2f { - half4 pos : SV_POSITION; - half2 uv : TEXCOORD0; - fixed4 vertexColor : COLOR; - }; - - v2f vert(appdata_full v) { - v2f o; - - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); - o.uv = TRANSFORM_TEX(v.texcoord, _MainTex); - o.vertexColor = v.color * _TintColor; - - return o; - } - - fixed4 frag( v2f i ) : COLOR { - return tex2D (_MainTex, i.uv.xy) * i.vertexColor; - } - - ENDCG - - SubShader { - Tags { "RenderType" = "Transparent" "Queue" = "Transparent"} - Cull Off - Lighting Off - ZWrite Off - Fog { Mode Off } - Blend SrcAlpha One - - Pass { - - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - ENDCG - - } - - } - FallBack Off -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleAdditiveBlend.shader.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleAdditiveBlend.shader.meta deleted file mode 100644 index 495319f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleAdditiveBlend.shader.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: c2135471d096b4d9eb2c6cad707c7e9f -ShaderImporter: - defaultTextures: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleBlend.shader b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleBlend.shader deleted file mode 100644 index 7545f3f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleBlend.shader +++ /dev/null @@ -1,59 +0,0 @@ - -Shader "AngryBots/Particle/AlphaBlend" { - Properties { - _MainTex ("Base", 2D) = "white" {} - _TintColor ("TintColor", Color) = (1.0, 1.0, 1.0, 1.0) - } - - CGINCLUDE - - #include "UnityCG.cginc" - - sampler2D _MainTex; - fixed4 _TintColor; - - struct v2f { - half4 pos : SV_POSITION; - half2 uv : TEXCOORD0; - fixed4 vertexColor : COLOR; - }; - - v2f vert(appdata_full v) { - v2f o; - - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); - o.uv.xy = v.texcoord.xy; - o.vertexColor = v.color * _TintColor; - - return o; - } - - fixed4 frag( v2f i ) : COLOR { - return tex2D (_MainTex, i.uv.xy) * i.vertexColor; - } - - ENDCG - - SubShader { - Tags { "RenderType" = "Transparent" "Queue" = "Transparent"} - Cull Off - Lighting Off - ZWrite Off - Fog { Mode Off } - Blend SrcAlpha OneMinusSrcAlpha - - Pass { - - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - ENDCG - - } - - } - FallBack Off -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleBlend.shader.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleBlend.shader.meta deleted file mode 100644 index 519995d..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Shaders/Fx/ParticleBlend.shader.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: ed6efa9ef80ec48cba573a745bcfb023 -ShaderImporter: - defaultTextures: [] - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds.meta deleted file mode 100644 index 43c2493..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 692c47a0c60b19346afc4e6121a2ed35 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy.meta deleted file mode 100644 index 3d5938a..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 9af8612e9c3ce8645887fb0d363d45dc -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_AlertSound.wav b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_AlertSound.wav deleted file mode 100644 index 1861157..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_AlertSound.wav and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_AlertSound.wav.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_AlertSound.wav.meta deleted file mode 100644 index f3ea215..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_AlertSound.wav.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2e8d592978491b44dbc307eaa276a47c -AudioImporter: - serializedVersion: 4 - format: 0 - quality: -1 - stream: 1 - 3D: 1 - forceToMono: 0 - useHardware: 0 - loopable: 0 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_DestroyedExplosion.wav b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_DestroyedExplosion.wav deleted file mode 100644 index e9420c9..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_DestroyedExplosion.wav and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_DestroyedExplosion.wav.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_DestroyedExplosion.wav.meta deleted file mode 100644 index 487be4e..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_DestroyedExplosion.wav.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e9c49907ada66bb48976b9f5b8080943 -AudioImporter: - serializedVersion: 4 - format: 0 - quality: -1 - stream: 1 - 3D: 1 - forceToMono: 0 - useHardware: 0 - loopable: 0 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_Proximity.wav b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_Proximity.wav deleted file mode 100644 index ab67ce8..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_Proximity.wav and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_Proximity.wav.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_Proximity.wav.meta deleted file mode 100644 index 540b52b..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_Proximity.wav.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 276dcbe5660b78e4cb1253cd4ad8d999 -AudioImporter: - serializedVersion: 4 - format: 0 - quality: -1 - stream: 1 - 3D: 1 - forceToMono: 0 - useHardware: 0 - loopable: 0 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_SelfDestruct.wav b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_SelfDestruct.wav deleted file mode 100644 index aaec6f4..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_SelfDestruct.wav and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_SelfDestruct.wav.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_SelfDestruct.wav.meta deleted file mode 100644 index a10b022..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_SelfDestruct.wav.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 5b62d96894fd3834da4bae15eeade12e -AudioImporter: - serializedVersion: 4 - format: 0 - quality: -1 - stream: 0 - 3D: 1 - forceToMono: 0 - useHardware: 0 - loopable: 0 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_skidding.wav b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_skidding.wav deleted file mode 100644 index 9b796c9..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_skidding.wav and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_skidding.wav.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_skidding.wav.meta deleted file mode 100644 index e9cc1ec..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Enemy/enemy_Spider_skidding.wav.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 7eda02acc7af1ff41a60d180366b6d8f -AudioImporter: - serializedVersion: 4 - format: 0 - quality: -1 - stream: 1 - 3D: 1 - forceToMono: 0 - useHardware: 0 - loopable: 0 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player.meta deleted file mode 100644 index d0d9065..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: d9d009e7913ac5048bf2c1e1cef07a37 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_hit.wav b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_hit.wav deleted file mode 100644 index 34680e9..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_hit.wav and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_hit.wav.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_hit.wav.meta deleted file mode 100644 index 0e9d2f8..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_hit.wav.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8eb80fa98d85ce34fae7affcdfb64c6c -AudioImporter: - serializedVersion: 4 - format: 0 - quality: -1 - stream: 1 - 3D: 1 - forceToMono: 0 - useHardware: 0 - loopable: 0 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_killed_1.wav b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_killed_1.wav deleted file mode 100644 index 2827dc4..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_killed_1.wav and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_killed_1.wav.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_killed_1.wav.meta deleted file mode 100644 index cd4af0f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_killed_1.wav.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f0c98d0d5c7ecd54391e3bd2fa4f9be2 -AudioImporter: - serializedVersion: 4 - format: 0 - quality: -1 - stream: 1 - 3D: 1 - forceToMono: 0 - useHardware: 0 - loopable: 0 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_shooting.wav b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_shooting.wav deleted file mode 100644 index 7b7e326..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_shooting.wav and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_shooting.wav.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_shooting.wav.meta deleted file mode 100644 index 341d566..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Sounds/Player/player_shooting.wav.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c7b8685e162577f41b72736b13f8be7a -AudioImporter: - serializedVersion: 4 - format: 0 - quality: -1 - stream: 1 - 3D: 1 - forceToMono: 0 - useHardware: 0 - loopable: 0 - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures.meta deleted file mode 100644 index 29ca9e8..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: f9d01290883590240a1cd15dc0c1d956 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects.meta deleted file mode 100644 index 89665bf..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 1aa7f26097c5c8a4ab7b61afe0ccee09 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/HealthBar.tif b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/HealthBar.tif deleted file mode 100644 index 6ad7d03..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/HealthBar.tif and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/HealthBar.tif.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/HealthBar.tif.meta deleted file mode 100644 index 2dbaf33..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/HealthBar.tif.meta +++ /dev/null @@ -1,44 +0,0 @@ -fileFormatVersion: 2 -guid: a7a58464376c2cb4c8be8ae606afff46 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: -1 - buildTargetSettings: [] - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/LaserDot.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/LaserDot.psd deleted file mode 100644 index a8aa841..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/LaserDot.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/LaserDot.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/LaserDot.psd.meta deleted file mode 100644 index ccbc85b..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/LaserDot.psd.meta +++ /dev/null @@ -1,60 +0,0 @@ -fileFormatVersion: 2 -guid: 965609fd66e81484aafb4fc0e102d1cc -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -3 - maxTextureSize: 32 - textureSettings: - filterMode: 1 - aniso: 3 - mipBias: -1 - wrapMode: 1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 32 - textureFormat: -3 - compressionQuality: 50 - - buildTarget: Standalone - maxTextureSize: 32 - textureFormat: -3 - compressionQuality: 50 - - buildTarget: iPhone - maxTextureSize: 32 - textureFormat: -3 - compressionQuality: 50 - - buildTarget: Android - maxTextureSize: 32 - textureFormat: -3 - compressionQuality: 50 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/LaserTexture.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/LaserTexture.psd deleted file mode 100644 index 44ddb08..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/LaserTexture.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/LaserTexture.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/LaserTexture.psd.meta deleted file mode 100644 index 89491da..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/LaserTexture.psd.meta +++ /dev/null @@ -1,60 +0,0 @@ -fileFormatVersion: 2 -guid: df534e0918b424979a6037b4aa5a207b -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 64 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: Standalone - maxTextureSize: 64 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: iPhone - maxTextureSize: 64 - textureFormat: -1 - compressionQuality: 50 - - buildTarget: Android - maxTextureSize: 64 - textureFormat: -1 - compressionQuality: 50 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Materials.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Materials.meta deleted file mode 100644 index f533556..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Materials.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: d8242da0607094646a24312bb13de4a0 -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Materials/SimpleNoise.mat b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Materials/SimpleNoise.mat deleted file mode 100644 index 863a723..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Materials/SimpleNoise.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Materials/SimpleNoise.mat.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Materials/SimpleNoise.mat.meta deleted file mode 100644 index e670d3c..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Materials/SimpleNoise.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: cf6374f8000857c458d4902e2cfa34b3 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Reflections.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Reflections.meta deleted file mode 100644 index 63ae08a..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Reflections.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 059f9630194553b4bb2eff3efd0a8510 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Reflections/CubeMaps.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Reflections/CubeMaps.meta deleted file mode 100644 index d445c6a..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Reflections/CubeMaps.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: bc899741848f50147894d6159d698885 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Reflections/CubeMaps/LobbyRoom.cubemap b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Reflections/CubeMaps/LobbyRoom.cubemap deleted file mode 100644 index 6e0aaf2..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Reflections/CubeMaps/LobbyRoom.cubemap and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Reflections/CubeMaps/LobbyRoom.cubemap.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Reflections/CubeMaps/LobbyRoom.cubemap.meta deleted file mode 100644 index e592d68..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/Reflections/CubeMaps/LobbyRoom.cubemap.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: b66d7d28b3db14f7382a2887575a3439 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/SimpleNoise.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/SimpleNoise.psd deleted file mode 100644 index d4c244e..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/SimpleNoise.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/SimpleNoise.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/SimpleNoise.psd.meta deleted file mode 100644 index 93d6da5..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Effects/SimpleNoise.psd.meta +++ /dev/null @@ -1,60 +0,0 @@ -fileFormatVersion: 2 -guid: d1bd32e2f0342418a81f73b582e0b4a2 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -2 - maxTextureSize: 32 - textureSettings: - filterMode: 1 - aniso: 1 - mipBias: -1 - wrapMode: 0 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 32 - textureFormat: -2 - compressionQuality: 50 - - buildTarget: Standalone - maxTextureSize: 32 - textureFormat: -2 - compressionQuality: 50 - - buildTarget: iPhone - maxTextureSize: 32 - textureFormat: -2 - compressionQuality: 50 - - buildTarget: Android - maxTextureSize: 32 - textureFormat: -2 - compressionQuality: 50 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Minebot.tif b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Minebot.tif deleted file mode 100644 index f18ca8f..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Minebot.tif and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Minebot.tif.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Minebot.tif.meta deleted file mode 100644 index 5967764..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Minebot.tif.meta +++ /dev/null @@ -1,64 +0,0 @@ -fileFormatVersion: 2 -guid: d7ab2029fbe34d0499a26f57de1f51d6 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 512 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 512 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Standalone - maxTextureSize: 512 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: iPhone - maxTextureSize: 256 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Android - maxTextureSize: 256 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: FlashPlayer - maxTextureSize: 512 - textureFormat: -1 - compressionQuality: 20 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Player.tif b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Player.tif deleted file mode 100644 index e3f0135..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Player.tif and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Player.tif.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Player.tif.meta deleted file mode 100644 index 23157f1..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Player.tif.meta +++ /dev/null @@ -1,64 +0,0 @@ -fileFormatVersion: 2 -guid: 15e8834927ec3e445a626ae399fd97db -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 1024 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Standalone - maxTextureSize: 1024 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: iPhone - maxTextureSize: 256 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Android - maxTextureSize: 256 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: FlashPlayer - maxTextureSize: 1024 - textureFormat: -1 - compressionQuality: 30 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/ThumbStickPad.psd b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/ThumbStickPad.psd deleted file mode 100644 index 45ecdb3..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/ThumbStickPad.psd and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/ThumbStickPad.psd.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/ThumbStickPad.psd.meta deleted file mode 100644 index 43cbea8..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/ThumbStickPad.psd.meta +++ /dev/null @@ -1,60 +0,0 @@ -fileFormatVersion: 2 -guid: 3daa66d28163141a98814c55ab93f9ed -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - linearTexture: 1 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -3 - maxTextureSize: 256 - textureSettings: - filterMode: 1 - aniso: 1 - mipBias: -1 - wrapMode: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 1 - textureType: 2 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 128 - textureFormat: -3 - compressionQuality: 50 - - buildTarget: Standalone - maxTextureSize: 128 - textureFormat: -3 - compressionQuality: 50 - - buildTarget: iPhone - maxTextureSize: 128 - textureFormat: -3 - compressionQuality: 50 - - buildTarget: Android - maxTextureSize: 128 - textureFormat: -3 - compressionQuality: 50 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Weapon.tif b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Weapon.tif deleted file mode 100644 index 06d18fd..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Weapon.tif and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Weapon.tif.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Weapon.tif.meta deleted file mode 100644 index 509e84d..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AngryBotsTests/Textures/Weapon.tif.meta +++ /dev/null @@ -1,64 +0,0 @@ -fileFormatVersion: 2 -guid: de0f43d22fb984a41882402bdca3174a -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: 0 - buildTargetSettings: - - buildTarget: Web - maxTextureSize: 512 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Standalone - maxTextureSize: 512 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: iPhone - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: Android - maxTextureSize: 128 - textureFormat: -1 - compressionQuality: -1 - - buildTarget: FlashPlayer - maxTextureSize: 1024 - textureFormat: -1 - compressionQuality: 0 - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AssertionExampleScene.unity b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AssertionExampleScene.unity deleted file mode 100644 index 2562b39..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AssertionExampleScene.unity and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AssertionExampleScene.unity.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AssertionExampleScene.unity.meta deleted file mode 100644 index 5d3e9cf..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/AssertionExampleScene.unity.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 15e9f6c9f302e4f4f89b1c745fc59c29 -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/CodeBasedAssertionExample.cs b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/CodeBasedAssertionExample.cs deleted file mode 100644 index 54579a3..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/CodeBasedAssertionExample.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using UnityTest; - -[IntegrationTest.DynamicTestAttribute("ExampleIntegrationTests")] -[IntegrationTest.SucceedWithAssertions] -public class CodeBasedAssertionExample : MonoBehaviour -{ - public float FloatField = 3; - - public GameObject goReference; - - public void Awake() - { - // An assertion that will compare a foat value from a custom component attached to a GameObject to a constant variable equal to 3. - // The comparasment will happen Start method and every 5 frames in the Update method - // Additionally, the comparer is configured to have accuracy of 0.1 for floating euqlity check. - IAssertionComponentConfigurator configurator; - var c = AssertionComponent.Create(out configurator, CheckMethod.Update | CheckMethod.Start, gameObject, "CodeBasedAssertionExample.FloatField", 3f); - configurator.UpdateCheckRepeatFrequency = 5; - c.floatingPointError = 0.1; - c.compareTypes = FloatComparer.CompareTypes.Equal; - - // Create an assertion that will fail is the FloatField from InitAssertions component of gameObject will change it's value - AssertionComponent.Create(CheckMethod.Update | CheckMethod.Start, gameObject, "CodeBasedAssertionExample.FloatField"); - - // Validate the gameObject.transform.y is always equal to 3 (defined in this component) - transform.position = new Vector3(0, 3, 0); - AssertionComponent.Create(CheckMethod.Update, gameObject, "CodeBasedAssertionExample.FloatField", gameObject, "transform.position.y"); - - // Check with the goReference field from this component is not set to null - goReference = gameObject; - var gc = AssertionComponent.Create(CheckMethod.Update, gameObject, "CodeBasedAssertionExample.goReference", null); - gc.compareType = GeneralComparer.CompareType.ANotEqualsB; - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/CodeBasedAssertionExample.cs.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/CodeBasedAssertionExample.cs.meta deleted file mode 100644 index 7c70fc7..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/CodeBasedAssertionExample.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 31a2431552d506445af31d7322ccb758 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/CustomComponent.cs b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/CustomComponent.cs deleted file mode 100644 index f879b13..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/CustomComponent.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class CustomComponent : MonoBehaviour - { - public float MyFloatProp { get; set; } - public float MyFloatField = 3; - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/CustomComponent.cs.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/CustomComponent.cs.meta deleted file mode 100644 index e1093f5..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/CustomComponent.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0e28554b1d63f2945b90ee1bfdae9045 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/DynamicIntegrationTest.cs b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/DynamicIntegrationTest.cs deleted file mode 100644 index 0772d55..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/DynamicIntegrationTest.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -[IntegrationTest.DynamicTestAttribute("ExampleIntegrationTests")] -// [IntegrationTest.Ignore] -[IntegrationTest.ExpectExceptions(false, typeof(ArgumentException))] -[IntegrationTest.SucceedWithAssertions] -[IntegrationTest.TimeoutAttribute(1)] -[IntegrationTest.ExcludePlatformAttribute(RuntimePlatform.Android, RuntimePlatform.LinuxPlayer)] -public class DynamicIntegrationTest : MonoBehaviour -{ - public void Start() - { - IntegrationTest.Pass(gameObject); - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/DynamicIntegrationTest.cs.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/DynamicIntegrationTest.cs.meta deleted file mode 100644 index c7b7553..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/DynamicIntegrationTest.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 382c8acec5676c047a67ed73ff0597f2 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/ExampleIntegrationTests.unity b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/ExampleIntegrationTests.unity deleted file mode 100644 index 80d6eea..0000000 Binary files a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/ExampleIntegrationTests.unity and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/ExampleIntegrationTests.unity.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/ExampleIntegrationTests.unity.meta deleted file mode 100644 index 1b63eba..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/ExampleIntegrationTests.unity.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 7f1b585d76653294caf31cf7b688c70c -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/ThrowCustomException.cs b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/ThrowCustomException.cs deleted file mode 100644 index 1845393..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/ThrowCustomException.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -public class ThrowCustomException : MonoBehaviour -{ - public void Start() - { - throw new CustomException(); - } - - private class CustomException : Exception - { - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/ThrowCustomException.cs.meta b/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/ThrowCustomException.cs.meta deleted file mode 100644 index 73e326f..0000000 --- a/example_project/Assets/UnityTestTools/Examples/IntegrationTestsFrameworkExamples/ThrowCustomException.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 944b8af45475eb847a80e8e6de431fcf -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/UnitTestExamples.meta b/example_project/Assets/UnityTestTools/Examples/UnitTestExamples.meta deleted file mode 100644 index 92dd31e..0000000 --- a/example_project/Assets/UnityTestTools/Examples/UnitTestExamples.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 4e5e1964cf638d1418429b74c3d35091 -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/UnitTestExamples/Editor.meta b/example_project/Assets/UnityTestTools/Examples/UnitTestExamples/Editor.meta deleted file mode 100644 index dd04f5c..0000000 --- a/example_project/Assets/UnityTestTools/Examples/UnitTestExamples/Editor.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 9f2ce5ef02a6e4045ab2c26ad282dea6 -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/Examples/UnitTestExamples/Editor/SampleTests.cs b/example_project/Assets/UnityTestTools/Examples/UnitTestExamples/Editor/SampleTests.cs deleted file mode 100644 index 8e9f70e..0000000 --- a/example_project/Assets/UnityTestTools/Examples/UnitTestExamples/Editor/SampleTests.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using NUnit.Framework; -using UnityEngine; - -namespace UnityTest -{ - [TestFixture] - [Category("Sample Tests")] - internal class SampleTests - { - [Test] - [Category("Failing Tests")] - public void ExceptionTest() - { - throw new Exception("Exception throwing test"); - } - - [Test] - [Ignore("Ignored test")] - public void IgnoredTest() - { - throw new Exception("Ignored this test"); - } - - [Test] - [MaxTime(100)] - [Category("Failing Tests")] - public void SlowTest() - { - Thread.Sleep(200); - } - - [Test] - [Category("Failing Tests")] - public void FailingTest() - { - Assert.Fail(); - } - - [Test] - [Category("Failing Tests")] - public void InconclusiveTest() - { - Assert.Inconclusive(); - } - - [Test] - public void PassingTest() - { - Assert.Pass(); - } - - [Test] - public void ParameterizedTest([Values(1, 2, 3)] int a) - { - Assert.Pass(); - } - - [Test] - public void RangeTest([NUnit.Framework.Range(1, 10, 3)] int x) - { - Assert.Pass(); - } - - [Test] - [Culture("pl-PL")] - public void CultureSpecificTest() - { - } - - [Test] - [ExpectedException(typeof(ArgumentException), ExpectedMessage = "expected message")] - public void ExpectedExceptionTest() - { - throw new ArgumentException("expected message"); - } - - [Datapoint] - public double zero = 0; - [Datapoint] - public double positive = 1; - [Datapoint] - public double negative = -1; - [Datapoint] - public double max = double.MaxValue; - [Datapoint] - public double infinity = double.PositiveInfinity; - - [Theory] - public void SquareRootDefinition(double num) - { - Assume.That(num >= 0.0 && num < double.MaxValue); - - var sqrt = Math.Sqrt(num); - - Assert.That(sqrt >= 0.0); - Assert.That(sqrt * sqrt, Is.EqualTo(num).Within(0.000001)); - } - } -} diff --git a/example_project/Assets/UnityTestTools/Examples/UnitTestExamples/Editor/SampleTests.cs.meta b/example_project/Assets/UnityTestTools/Examples/UnitTestExamples/Editor/SampleTests.cs.meta deleted file mode 100644 index 18a2818..0000000 --- a/example_project/Assets/UnityTestTools/Examples/UnitTestExamples/Editor/SampleTests.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4341aba9dbf1e514f8efbdb1e95b583e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework.meta deleted file mode 100644 index da22872..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 241054a0fe63fbb4bb51609fce9b3112 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.Mdb.dll b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.Mdb.dll deleted file mode 100644 index 161d2fd..0000000 Binary files a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.Mdb.dll and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.Mdb.dll.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.Mdb.dll.meta deleted file mode 100644 index 4be4950..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.Mdb.dll.meta +++ /dev/null @@ -1,20 +0,0 @@ -fileFormatVersion: 2 -guid: 713231d47408a06408a45470c967bae8 -timeCreated: 1441797177 -licenseType: Store -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 0 - settings: {} - Editor: - enabled: 1 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.dll b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.dll deleted file mode 100644 index f55f7a5..0000000 Binary files a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.dll and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.dll.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.dll.meta deleted file mode 100644 index 1123a8a..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.dll.meta +++ /dev/null @@ -1,20 +0,0 @@ -fileFormatVersion: 2 -guid: 28fc22990733f8f4ea1137f15e363609 -timeCreated: 1441797177 -licenseType: Store -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 0 - settings: {} - Editor: - enabled: 1 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner.meta deleted file mode 100644 index c65a67d..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: da93545c3ab1aa043bcfb22281b1f66c -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/DTOFormatter.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/DTOFormatter.cs deleted file mode 100644 index f974b7c..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/DTOFormatter.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Text; -using UnityEngine; - -namespace UnityTest -{ - - public class DTOFormatter { - - private interface ITransferInterface - { - void Transfer(ref ResultDTO.MessageType val); - void Transfer(ref TestResultState val); - void Transfer(ref byte val); - void Transfer(ref bool val); - void Transfer(ref int val); - void Transfer(ref float val); - void Transfer(ref double val); - void Transfer(ref string val); - } - - private class Writer : ITransferInterface - { - private readonly Stream _stream; - public Writer(Stream stream) { _stream = stream; } - - private void WriteConvertedNumber(byte[] bytes) - { - if(BitConverter.IsLittleEndian) - Array.Reverse(bytes); - _stream.Write(bytes, 0, bytes.Length); - } - - public void Transfer(ref ResultDTO.MessageType val) { _stream.WriteByte((byte)val); } - public void Transfer(ref TestResultState val) { _stream.WriteByte((byte)val); } - public void Transfer(ref byte val) { _stream.WriteByte(val); } - public void Transfer(ref bool val) { _stream.WriteByte((byte)(val ? 0x01 : 0x00)); } - public void Transfer(ref int val) { WriteConvertedNumber(BitConverter.GetBytes(val)); } - public void Transfer(ref float val) { WriteConvertedNumber(BitConverter.GetBytes(val)); } - public void Transfer(ref double val) { WriteConvertedNumber(BitConverter.GetBytes(val)); } - - public void Transfer(ref string val) - { - var bytes = Encoding.BigEndianUnicode.GetBytes(val); - int length = bytes.Length; - Transfer(ref length); - _stream.Write(bytes, 0, bytes.Length); - } - } - - private class Reader : ITransferInterface - { - private readonly Stream _stream; - public Reader(Stream stream) { _stream = stream; } - - private byte[] ReadConvertedNumber(int size) - { - byte[] buffer = new byte[size]; - _stream.Read (buffer, 0, buffer.Length); - if(BitConverter.IsLittleEndian) - Array.Reverse(buffer); - return buffer; - } - - public void Transfer(ref ResultDTO.MessageType val) { val = (ResultDTO.MessageType)_stream.ReadByte(); } - public void Transfer(ref TestResultState val) { val = (TestResultState)_stream.ReadByte(); } - public void Transfer(ref byte val) { val = (byte)_stream.ReadByte(); } - public void Transfer(ref bool val) { val = (_stream.ReadByte() != 0); } - public void Transfer(ref int val) { val = BitConverter.ToInt32(ReadConvertedNumber(4), 0); } - public void Transfer(ref float val) { val = BitConverter.ToSingle(ReadConvertedNumber(4), 0); } - public void Transfer(ref double val) { val = BitConverter.ToDouble(ReadConvertedNumber(8), 0); } - - public void Transfer(ref string val) - { - int length = 0; - Transfer (ref length); - var bytes = new byte[length]; - int remain = length; - int index = 0; - do { - int bytesRead = _stream.Read(bytes, index, remain); - remain -= bytesRead; - index += bytesRead; - } while (remain > 0); - val = Encoding.BigEndianUnicode.GetString(bytes); - } - } - - private void Transfer(ResultDTO dto, ITransferInterface transfer) - { - transfer.Transfer(ref dto.messageType); - - transfer.Transfer(ref dto.levelCount); - transfer.Transfer(ref dto.loadedLevel); - transfer.Transfer(ref dto.loadedLevelName); - - if(dto.messageType == ResultDTO.MessageType.Ping - || dto.messageType == ResultDTO.MessageType.RunStarted - || dto.messageType == ResultDTO.MessageType.RunFinished - || dto.messageType == ResultDTO.MessageType.RunInterrupted - || dto.messageType == ResultDTO.MessageType.AllScenesFinished) - return; - - transfer.Transfer(ref dto.testName); - transfer.Transfer(ref dto.testTimeout); - - if(dto.messageType == ResultDTO.MessageType.TestStarted) - return; - - if(transfer is Reader) - dto.testResult = new SerializableTestResult(); - SerializableTestResult str = (SerializableTestResult)dto.testResult; - - transfer.Transfer(ref str.resultState); - transfer.Transfer(ref str.message); - transfer.Transfer(ref str.executed); - transfer.Transfer(ref str.name); - transfer.Transfer(ref str.fullName); - transfer.Transfer(ref str.id); - transfer.Transfer(ref str.isSuccess); - transfer.Transfer(ref str.duration); - transfer.Transfer(ref str.stackTrace); - } - - public void Serialize (Stream stream, ResultDTO dto) - { - Transfer(dto, new Writer(stream)); - } - - public object Deserialize (Stream stream) - { - var result = (ResultDTO)FormatterServices.GetSafeUninitializedObject(typeof(ResultDTO)); - Transfer (result, new Reader(stream)); - return result; - } - } - -} \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/DTOFormatter.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/DTOFormatter.cs.meta deleted file mode 100644 index f83bde0..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/DTOFormatter.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7ae2470508a854b1c9df5375d03f8f58 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor.meta deleted file mode 100644 index bd38839..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: caee08596a5965747b8edfde19e2f873 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Batch.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Batch.cs deleted file mode 100644 index da55f1d..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Batch.cs +++ /dev/null @@ -1,200 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using UnityEditor; -using UnityEditorInternal; -using UnityEngine; -using UnityTest.IntegrationTests; -using UnityEditor.SceneManagement; - -namespace UnityTest -{ - public static partial class Batch - { - const string k_ResultFilePathParam = "-resultFilePath="; - private const string k_TestScenesParam = "-testscenes="; - private const string k_OtherBuildScenesParam = "-includeBuildScenes="; - const string k_TargetPlatformParam = "-targetPlatform="; - const string k_ResultFileDirParam = "-resultsFileDirectory="; - - public static int returnCodeTestsOk = 0; - public static int returnCodeTestsFailed = 2; - public static int returnCodeRunError = 3; - - public static void RunIntegrationTests() - { - var targetPlatform = GetTargetPlatform(); - var otherBuildScenes = GetSceneListFromParam (k_OtherBuildScenesParam); - - var testScenes = GetSceneListFromParam(k_TestScenesParam); - if (testScenes.Count == 0) - testScenes = FindTestScenesInProject(); - - RunIntegrationTests(targetPlatform, testScenes, otherBuildScenes); - } - - public static void RunIntegrationTests(BuildTarget ? targetPlatform) - { - var sceneList = FindTestScenesInProject(); - RunIntegrationTests(targetPlatform, sceneList, new List()); - } - - - public static void RunIntegrationTests(BuildTarget? targetPlatform, List testScenes, List otherBuildScenes) - { - if (targetPlatform.HasValue) - BuildAndRun(targetPlatform.Value, testScenes, otherBuildScenes); - else - RunInEditor(testScenes, otherBuildScenes); - } - - private static void BuildAndRun(BuildTarget target, List testScenes, List otherBuildScenes) - { - var resultFilePath = GetParameterArgument(k_ResultFileDirParam); - - const int port = 0; - var ipList = TestRunnerConfigurator.GetAvailableNetworkIPs(); - - var config = new PlatformRunnerConfiguration - { - buildTarget = target, - buildScenes = otherBuildScenes, - testScenes = testScenes, - projectName = "IntegrationTests", - resultsDir = resultFilePath, - sendResultsOverNetwork = InternalEditorUtility.inBatchMode, - ipList = ipList, - port = port - }; - - if (Application.isWebPlayer) - { - config.sendResultsOverNetwork = false; - Debug.Log("You can't use WebPlayer as active platform for running integration tests. Switching to Standalone"); - EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows); - } - - PlatformRunner.BuildAndRunInPlayer(config); - } - - private static void RunInEditor(List testScenes, List otherBuildScenes) - { - CheckActiveBuildTarget(); - - NetworkResultsReceiver.StopReceiver(); - if (testScenes == null || testScenes.Count == 0) - { - Debug.Log("No test scenes on the list"); - EditorApplication.Exit(returnCodeRunError); - return; - } - - string previousScenesXml = ""; - var serializer = new System.Xml.Serialization.XmlSerializer(typeof(EditorBuildSettingsScene[])); - using(StringWriter textWriter = new StringWriter()) - { - serializer.Serialize(textWriter, EditorBuildSettings.scenes); - previousScenesXml = textWriter.ToString(); - } - - EditorBuildSettings.scenes = (testScenes.Concat(otherBuildScenes).ToList()).Select(s => new EditorBuildSettingsScene(s, true)).ToArray(); - EditorSceneManager.OpenScene(testScenes.First()); - GuiHelper.SetConsoleErrorPause(false); - - var config = new PlatformRunnerConfiguration - { - resultsDir = GetParameterArgument(k_ResultFileDirParam), - ipList = TestRunnerConfigurator.GetAvailableNetworkIPs(), - port = PlatformRunnerConfiguration.TryToGetFreePort(), - runInEditor = true - }; - - var settings = new PlayerSettingConfigurator(true); - settings.AddConfigurationFile(TestRunnerConfigurator.integrationTestsNetwork, string.Join("\n", config.GetConnectionIPs())); - settings.AddConfigurationFile(TestRunnerConfigurator.testScenesToRun, string.Join ("\n", testScenes.ToArray())); - settings.AddConfigurationFile(TestRunnerConfigurator.previousScenes, previousScenesXml); - - NetworkResultsReceiver.StartReceiver(config); - - EditorApplication.isPlaying = true; - } - - private static string GetParameterArgument(string parameterName) - { - foreach (var arg in Environment.GetCommandLineArgs()) - { - if (arg.ToLower().StartsWith(parameterName.ToLower())) - { - return arg.Substring(parameterName.Length); - } - } - return null; - } - - static void CheckActiveBuildTarget() - { - var notSupportedPlatforms = new[] { "MetroPlayer", "WebPlayer", "WebPlayerStreamed" }; - if (notSupportedPlatforms.Contains(EditorUserBuildSettings.activeBuildTarget.ToString())) - { - Debug.Log("activeBuildTarget can not be " - + EditorUserBuildSettings.activeBuildTarget + - " use buildTarget parameter to open Unity."); - } - } - - private static BuildTarget ? GetTargetPlatform() - { - string platformString = null; - BuildTarget buildTarget; - foreach (var arg in Environment.GetCommandLineArgs()) - { - if (arg.ToLower().StartsWith(k_TargetPlatformParam.ToLower())) - { - platformString = arg.Substring(k_ResultFilePathParam.Length); - break; - } - } - try - { - if (platformString == null) return null; - buildTarget = (BuildTarget)Enum.Parse(typeof(BuildTarget), platformString); - } - catch - { - return null; - } - return buildTarget; - } - - private static List FindTestScenesInProject() - { - var integrationTestScenePattern = "*Test?.unity"; - return Directory.GetFiles("Assets", integrationTestScenePattern, SearchOption.AllDirectories).ToList(); - } - - private static List GetSceneListFromParam(string param) - { - var sceneList = new List(); - foreach (var arg in Environment.GetCommandLineArgs()) - { - if (arg.ToLower().StartsWith(param.ToLower())) - { - var scenesFromParam = arg.Substring(param.Length).Split(','); - foreach (var scene in scenesFromParam) - { - var sceneName = scene; - if (!sceneName.EndsWith(".unity")) - sceneName += ".unity"; - var foundScenes = Directory.GetFiles(Directory.GetCurrentDirectory(), sceneName, SearchOption.AllDirectories); - if (foundScenes.Length == 1) - sceneList.Add(foundScenes[0].Substring(Directory.GetCurrentDirectory().Length + 1)); - else - Debug.Log(sceneName + " not found or multiple entries found"); - } - } - } - return sceneList.Where(s => !string.IsNullOrEmpty(s)).Distinct().ToList(); - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Batch.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Batch.cs.meta deleted file mode 100644 index 248a6ce..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Batch.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 29d4fb050362c5b43aea52342045543a -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/EditorReferencesUtil.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/EditorReferencesUtil.cs deleted file mode 100644 index 3d762b8..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/EditorReferencesUtil.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using UnityEditor; -using UnityEngine; -using Object = UnityEngine.Object; - -namespace UnityTest -{ - public static class EditorReferencesUtil - { - - public static List FindScenesWhichContainAsset(string file) - { - string assetPath = GetAssetPathFromFileNameAndExtension (file); - Object cur = AssetDatabase.LoadAssetAtPath(assetPath, typeof(Object)); - return AllScenes.Where(a => ADependsOnB(a, cur)).ToList(); - } - - private static string CleanPathSeparators(string s) - { - const string forwardSlash = "/"; - const string backSlash = "\\"; - return s.Replace(backSlash, forwardSlash); - } - - private static string GetRelativeAssetPathFromFullPath(string fullPath) - { - fullPath = CleanPathSeparators(fullPath); - if (fullPath.Contains(Application.dataPath)) - { - return fullPath.Replace(Application.dataPath, "Assets"); - } - Debug.LogWarning("Path does not point to a location within Assets: " + fullPath); - return null; - } - - private static string GetAssetPathFromFileNameAndExtension(string assetName) - { - string[] assets = AssetDatabase.FindAssets (Path.GetFileNameWithoutExtension (assetName)); - string assetPath = null; - - foreach (string guid in assets) { - string relativePath = AssetDatabase.GUIDToAssetPath (guid); - - if (Path.GetFileName (relativePath) == Path.GetFileName (assetName)) - assetPath = relativePath; - } - - return assetPath; - } - - private static List DirSearch(DirectoryInfo d, string searchFor) - { - List founditems = d.GetFiles(searchFor).ToList(); - - // Add (by recursing) subdirectory items. - DirectoryInfo[] dis = d.GetDirectories(); - foreach (DirectoryInfo di in dis) - founditems.AddRange(DirSearch(di, searchFor)); - - return (founditems); - } - - private static List AllScenes - { - get - { - // get every single one of the files in the Assets folder. - List files = DirSearch(new DirectoryInfo(Application.dataPath), "*.unity"); - - // now make them all into Asset references. - List assetRefs = new List(); - - foreach (FileInfo fi in files) - { - if (fi.Name.StartsWith(".")) - continue; // Unity ignores dotfiles. - assetRefs.Add(AssetDatabase.LoadMainAssetAtPath(GetRelativeAssetPathFromFullPath(fi.FullName))); - } - return assetRefs; - } - } - - private static bool ADependsOnB(Object obj, Object selectedObj) - { - if (selectedObj == null) return false; - - //optionally, exclude self. - if (selectedObj == obj) return false; - - Object[] dependencies = EditorUtility.CollectDependencies(new Object[1] { obj }); - if (dependencies.Length < 2) return false; // if there's only one, it's us. - - foreach (Object dep in dependencies) - if (dep == selectedObj) - return true; - return false; - } - } -} \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/EditorReferencesUtil.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/EditorReferencesUtil.cs.meta deleted file mode 100644 index 78bcfab..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/EditorReferencesUtil.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: aad501c968b324cf3a8d1c52eb09ca04 -timeCreated: 1437322927 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/GuiHelper.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/GuiHelper.cs deleted file mode 100644 index 7c213ba..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/GuiHelper.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text.RegularExpressions; -using Mono.Cecil; -using Mono.Cecil.Cil; -using Mono.Cecil.Mdb; -using Mono.Collections.Generic; -using UnityEditor; -using UnityEditorInternal; -using UnityEngine; - -namespace UnityTest -{ - public static class GuiHelper - { - public static bool GetConsoleErrorPause() - { - Assembly assembly = Assembly.GetAssembly(typeof(SceneView)); - Type type = assembly.GetType("UnityEditorInternal.LogEntries"); - PropertyInfo method = type.GetProperty("consoleFlags"); - var result = (int)method.GetValue(new object(), new object[] { }); - return (result & (1 << 2)) != 0; - } - - public static void SetConsoleErrorPause(bool b) - { - Assembly assembly = Assembly.GetAssembly(typeof(SceneView)); - Type type = assembly.GetType("UnityEditorInternal.LogEntries"); - MethodInfo method = type.GetMethod("SetConsoleFlag"); - method.Invoke(new object(), new object[] { 1 << 2, b }); - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/GuiHelper.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/GuiHelper.cs.meta deleted file mode 100644 index 596d39f..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/GuiHelper.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b0b95014154ef554485afc9c0316556d -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsHierarchyAnnotation.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsHierarchyAnnotation.cs deleted file mode 100644 index 4aa5dc4..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsHierarchyAnnotation.cs +++ /dev/null @@ -1,44 +0,0 @@ -using UnityEngine; -using System.Collections; -using UnityEditor; - -namespace UnityTest -{ - - [InitializeOnLoad] - public class IntegrationTestsHierarchyAnnotation { - - static IntegrationTestsHierarchyAnnotation() - { - EditorApplication.hierarchyWindowItemOnGUI += DoAnnotationGUI; - } - - public static void DoAnnotationGUI(int id, Rect rect) - { - var obj = EditorUtility.InstanceIDToObject(id) as GameObject; - if(!obj) return; - - var tc = obj.GetComponent(); - if(!tc) return; - - if (!EditorApplication.isPlayingOrWillChangePlaymode - && rect.Contains(Event.current.mousePosition) - && Event.current.type == EventType.MouseDown - && Event.current.button == 1) - { - IntegrationTestRendererBase.DrawContextMenu(tc); - Event.current.Use (); - } - - EditorGUIUtility.SetIconSize(new Vector2(15, 15)); - var result = IntegrationTestsRunnerWindow.GetResultForTest(tc); - if (result != null) - { - var icon = result.Executed ? IntegrationTestRendererBase.GetIconForResult(result.resultType) : Icons.UnknownImg; - EditorGUI.LabelField(new Rect(rect.xMax - 18, rect.yMin - 2, rect.width, rect.height), new GUIContent(icon)); - } - EditorGUIUtility.SetIconSize(Vector2.zero); - } - } - -} \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsHierarchyAnnotation.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsHierarchyAnnotation.cs.meta deleted file mode 100644 index 4154bdc..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsHierarchyAnnotation.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 219cdb080b08741948fc5deb8c7d47f0 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerSettings.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerSettings.cs deleted file mode 100644 index 1e8e466..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerSettings.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; - -namespace UnityTest -{ - public class IntegrationTestsRunnerSettings : ProjectSettingsBase - { - public bool blockUIWhenRunning = true; - public bool pauseOnTestFailure; - - public void ToggleBlockUIWhenRunning () - { - blockUIWhenRunning = !blockUIWhenRunning; - Save (); - } - - public void TogglePauseOnTestFailure() - { - pauseOnTestFailure = !pauseOnTestFailure; - Save (); - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerSettings.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerSettings.cs.meta deleted file mode 100644 index d18086a..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerSettings.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5d01dc4c8f278da489d7d54c83f19cb9 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerWindow.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerWindow.cs deleted file mode 100644 index 2a5ed8d..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerWindow.cs +++ /dev/null @@ -1,590 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using UnityEditor; -using UnityEngine; -using UnityTest.IntegrationTestRunner; -using UnityEngine.SceneManagement; - -namespace UnityTest -{ - [Serializable] - public class IntegrationTestsRunnerWindow : EditorWindow, IHasCustomMenu - { - #region GUI Contents - private readonly GUIContent m_GUICreateNewTest = new GUIContent("Create", "Create new test"); - private readonly GUIContent m_GUIRunSelectedTests = new GUIContent("Run Selected", "Run selected test(s)"); - private readonly GUIContent m_GUIRunAllTests = new GUIContent("Run All", "Run all tests"); - private readonly GUIContent m_GUIBlockUI = new GUIContent("Block UI when running", "Block UI when running tests"); - private readonly GUIContent m_GUIPauseOnFailure = new GUIContent("Pause on test failure"); - #endregion - - #region runner steerign vars - private static IntegrationTestsRunnerWindow s_Instance; - [SerializeField] private List m_TestsToRun; - [SerializeField] private List m_DynamicTestsToRun; - [SerializeField] private bool m_ReadyToRun; - private bool m_IsBuilding; - public static bool selectedInHierarchy; - private float m_HorizontalSplitBarPosition = 200; - private Vector2 m_TestInfoScroll, m_TestListScroll; - private IntegrationTestRendererBase[] m_TestLines; - private string m_CurrectSceneName; - private TestFilterSettings m_FilterSettings; - - Vector2 m_resultTextSize; - string m_resultText; - GameObject m_lastSelectedGO; - int m_resultTestMaxLength = 15000; - - [SerializeField] private GameObject m_SelectedLine; - [SerializeField] private List m_ResultList = new List(); - [SerializeField] private List m_FoldMarkers = new List(); - - private IntegrationTestsRunnerSettings m_Settings; - - #endregion - - - static IntegrationTestsRunnerWindow() - { - InitBackgroundRunners(); - } - - private static void InitBackgroundRunners() - { - EditorApplication.hierarchyWindowItemOnGUI -= OnHierarchyWindowItemDraw; - EditorApplication.hierarchyWindowItemOnGUI += OnHierarchyWindowItemDraw; - EditorApplication.hierarchyWindowChanged -= OnHierarchyChangeUpdate; - EditorApplication.hierarchyWindowChanged += OnHierarchyChangeUpdate; - EditorApplication.update -= BackgroundSceneChangeWatch; - EditorApplication.update += BackgroundSceneChangeWatch; - EditorApplication.playmodeStateChanged -= OnPlaymodeStateChanged; - EditorApplication.playmodeStateChanged += OnPlaymodeStateChanged; - } - - private static void OnPlaymodeStateChanged() - { - if (s_Instance && EditorApplication.isPlaying == EditorApplication.isPlayingOrWillChangePlaymode) - s_Instance.RebuildTestList(); - } - - public void OnDestroy() - { - EditorApplication.hierarchyWindowItemOnGUI -= OnHierarchyWindowItemDraw; - EditorApplication.update -= BackgroundSceneChangeWatch; - EditorApplication.hierarchyWindowChanged -= OnHierarchyChangeUpdate; - EditorApplication.playmodeStateChanged -= OnPlaymodeStateChanged; - - TestComponent.DestroyAllDynamicTests(); - } - - private static void BackgroundSceneChangeWatch() - { - if (!s_Instance) return; - var currentScene = SceneManager.GetActiveScene().path; - if (s_Instance.m_CurrectSceneName != null && s_Instance.m_CurrectSceneName == currentScene) return; - if (EditorApplication.isPlayingOrWillChangePlaymode) return; - TestComponent.DestroyAllDynamicTests(); - s_Instance.m_CurrectSceneName = currentScene; - s_Instance.m_ResultList.Clear(); - s_Instance.RebuildTestList(); - } - - public void OnEnable() - { - titleContent = new GUIContent("Integration Tests"); - s_Instance = this; - - m_Settings = ProjectSettingsBase.Load(); - m_FilterSettings = new TestFilterSettings("UnityTest.IntegrationTestsRunnerWindow"); - - InitBackgroundRunners(); - if (!EditorApplication.isPlayingOrWillChangePlaymode && !m_ReadyToRun) RebuildTestList(); - } - - public void OnSelectionChange() - { - if (EditorApplication.isPlayingOrWillChangePlaymode - || Selection.objects == null - || Selection.objects.Length == 0) return; - - if (Selection.gameObjects.Length == 1) - { - var go = Selection.gameObjects.Single(); - var temp = go.transform; - while (temp != null) - { - var tc = temp.GetComponent(); - if (tc != null) break; - temp = temp.parent; - } - - if (temp != null) - { - SelectInHierarchy(temp.gameObject); - Selection.activeGameObject = temp.gameObject; - m_SelectedLine = temp.gameObject; - } - } - } - - public static void OnHierarchyChangeUpdate() - { - if (!s_Instance || s_Instance.m_TestLines == null || EditorApplication.isPlayingOrWillChangePlaymode) return; - - // create a test runner if it doesn't exist - TestRunner.GetTestRunner(); - - // make tests are not places under a go that is not a test itself - foreach (var test in TestComponent.FindAllTestsOnScene()) - { - if (test.gameObject.transform.parent != null && test.gameObject.transform.parent.gameObject.GetComponent() == null) - { - test.gameObject.transform.parent = null; - Debug.LogWarning("Tests need to be on top of the hierarchy or directly under another test."); - } - } - if (selectedInHierarchy) selectedInHierarchy = false; - else s_Instance.RebuildTestList(); - } - - public static TestResult GetResultForTest(TestComponent tc) - { - if(!s_Instance) return new TestResult(tc); - return s_Instance.m_ResultList.FirstOrDefault(r => r.GameObject == tc.gameObject); - } - - public static void OnHierarchyWindowItemDraw(int id, Rect rect) - { - var o = EditorUtility.InstanceIDToObject(id); - if (o is GameObject) - { - var go = o as GameObject; - - if (Event.current.type == EventType.MouseDown - && Event.current.button == 0 - && rect.Contains(Event.current.mousePosition)) - { - var temp = go.transform; - while (temp != null) - { - var c = temp.GetComponent(); - if (c != null) break; - temp = temp.parent; - } - if (temp != null) SelectInHierarchy(temp.gameObject); - } - } - } - - private static void SelectInHierarchy(GameObject gameObject) - { - if (!s_Instance) return; - if (gameObject == s_Instance.m_SelectedLine && gameObject.activeInHierarchy) return; - if (EditorApplication.isPlayingOrWillChangePlaymode) return; - if (!gameObject.activeSelf) - { - selectedInHierarchy = true; - gameObject.SetActive(true); - } - - var tests = TestComponent.FindAllTestsOnScene(); - var skipList = gameObject.GetComponentsInChildren(typeof(TestComponent), true).ToList(); - tests.RemoveAll(skipList.Contains); - foreach (var test in tests) - { - var enable = test.GetComponentsInChildren(typeof(TestComponent), true).Any(c => c.gameObject == gameObject); - if (test.gameObject.activeSelf != enable) test.gameObject.SetActive(enable); - } - } - - private void RunTests(IList tests) - { - if (!tests.Any() || EditorApplication.isCompiling || EditorApplication.isPlayingOrWillChangePlaymode) - return; - FocusWindowIfItsOpen(GetType()); - - var testComponents = tests.Where(t => t is TestComponent).Cast().ToList(); - var dynaminTests = testComponents.Where(t => t.dynamic).ToList(); - m_DynamicTestsToRun = dynaminTests.Select(c => c.dynamicTypeName).ToList(); - testComponents.RemoveAll(dynaminTests.Contains); - - m_TestsToRun = testComponents.Select( tc => tc.gameObject ).ToList(); - - m_ReadyToRun = true; - TestComponent.DisableAllTests(); - - EditorApplication.isPlaying = true; - } - - public void Update() - { - if (m_ReadyToRun && EditorApplication.isPlaying) - { - m_ReadyToRun = false; - var testRunner = TestRunner.GetTestRunner(); - testRunner.TestRunnerCallback.Add(new RunnerCallback(this)); - var testComponents = m_TestsToRun.Select(go => go.GetComponent()).ToList(); - testRunner.InitRunner(testComponents, m_DynamicTestsToRun); - } - } - - private void RebuildTestList() - { - m_TestLines = null; - if (!TestComponent.AnyTestsOnScene() - && !TestComponent.AnyDynamicTestForCurrentScene()) return; - - if (!EditorApplication.isPlayingOrWillChangePlaymode) - { - var dynamicTestsOnScene = TestComponent.FindAllDynamicTestsOnScene(); - var dynamicTestTypes = TestComponent.GetTypesWithHelpAttribute(SceneManager.GetActiveScene().path); - - foreach (var dynamicTestType in dynamicTestTypes) - { - var existingTests = dynamicTestsOnScene.Where(component => component.dynamicTypeName == dynamicTestType.AssemblyQualifiedName); - if (existingTests.Any()) - { - var testComponent = existingTests.Single(); - foreach (var c in testComponent.gameObject.GetComponents()) - { - var type = Type.GetType(testComponent.dynamicTypeName); - if (c is TestComponent || c is Transform || type.IsInstanceOfType(c)) continue; - DestroyImmediate(c); - } - dynamicTestsOnScene.Remove(existingTests.Single()); - continue; - } - TestComponent.CreateDynamicTest(dynamicTestType); - } - - foreach (var testComponent in dynamicTestsOnScene) - DestroyImmediate(testComponent.gameObject); - } - - var topTestList = TestComponent.FindAllTopTestsOnScene(); - - var newResultList = new List(); - m_TestLines = ParseTestList(topTestList, newResultList); - - var oldDynamicResults = m_ResultList.Where(result => result.dynamicTest); - foreach (var oldResult in m_ResultList) - { - var result = newResultList.Find(r => r.Id == oldResult.Id); - if (result == null) continue; - result.Update(oldResult); - } - newResultList.AddRange(oldDynamicResults.Where(r => !newResultList.Contains(r))); - m_ResultList = newResultList; - - IntegrationTestRendererBase.RunTest = RunTests; - IntegrationTestGroupLine.FoldMarkers = m_FoldMarkers; - IntegrationTestLine.Results = m_ResultList; - - m_FilterSettings.UpdateCounters(m_ResultList.Cast()); - - m_FoldMarkers.RemoveAll(o => o == null); - - selectedInHierarchy = true; - Repaint(); - } - - - private IntegrationTestRendererBase[] ParseTestList(List testList, List results) - { - var tempList = new List(); - foreach (var testObject in testList) - { - if (!testObject.IsTestGroup()) - { - var result = new TestResult(testObject); - if (results != null) - results.Add(result); - tempList.Add(new IntegrationTestLine(testObject.gameObject, result)); - continue; - } - var group = new IntegrationTestGroupLine(testObject.gameObject); - var children = testObject.gameObject.GetComponentsInChildren(typeof(TestComponent), true).Cast().ToList(); - children = children.Where(c => c.gameObject.transform.parent == testObject.gameObject.transform).ToList(); - group.AddChildren(ParseTestList(children, results)); - tempList.Add(group); - } - tempList.Sort(); - return tempList.ToArray(); - } - - public void OnGUI() - { - if (BuildPipeline.isBuildingPlayer) - { - m_IsBuilding = true; - } - else if (m_IsBuilding) - { - m_IsBuilding = false; - Repaint(); - } - - PrintHeadPanel(); - - EditorGUILayout.BeginVertical(Styles.testList); - m_TestListScroll = EditorGUILayout.BeginScrollView(m_TestListScroll); - bool repaint = PrintTestList(m_TestLines); - GUILayout.FlexibleSpace(); - EditorGUILayout.EndScrollView(); - EditorGUILayout.EndVertical(); - - RenderDetails(); - - if (repaint) Repaint(); - } - - public void PrintHeadPanel() - { - EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); - EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode); - if (GUILayout.Button(m_GUIRunAllTests, EditorStyles.toolbarButton)) - { - RunTests(TestComponent.FindAllTestsOnScene().Cast().ToList()); - } - EditorGUI.BeginDisabledGroup(!Selection.gameObjects.Any (t => t.GetComponent(typeof(ITestComponent)))); - if (GUILayout.Button(m_GUIRunSelectedTests, EditorStyles.toolbarButton)) - { - RunTests(Selection.gameObjects.Select(t => t.GetComponent(typeof(TestComponent))).Cast().ToList()); - } - EditorGUI.EndDisabledGroup(); - if (GUILayout.Button(m_GUICreateNewTest, EditorStyles.toolbarButton)) - { - var test = TestComponent.CreateTest(); - if (Selection.gameObjects.Length == 1 - && Selection.activeGameObject != null - && Selection.activeGameObject.GetComponent()) - { - test.transform.parent = Selection.activeGameObject.transform.parent; - } - Selection.activeGameObject = test; - RebuildTestList(); - } - EditorGUI.EndDisabledGroup(); - - GUILayout.FlexibleSpace (); - - m_FilterSettings.OnGUI (); - - EditorGUILayout.EndHorizontal (); - } - - public void AddItemsToMenu(GenericMenu menu) - { - menu.AddItem(m_GUIBlockUI, m_Settings.blockUIWhenRunning, m_Settings.ToggleBlockUIWhenRunning); - menu.AddItem(m_GUIPauseOnFailure, m_Settings.pauseOnTestFailure, m_Settings.TogglePauseOnTestFailure); - } - - private bool PrintTestList(IntegrationTestRendererBase[] renderedLines) - { - if (renderedLines == null) return false; - - var filter = m_FilterSettings.BuildRenderingOptions(); - - bool repaint = false; - foreach (var renderedLine in renderedLines) - { - repaint |= renderedLine.Render(filter); - } - return repaint; - } - - private void RenderDetails() - { - var ctrlId = GUIUtility.GetControlID(FocusType.Passive); - - Rect rect = GUILayoutUtility.GetLastRect(); - rect.y = rect.height + rect.y - 1; - rect.height = 3; - - EditorGUIUtility.AddCursorRect(rect, MouseCursor.ResizeVertical); - var e = Event.current; - switch (e.type) - { - case EventType.MouseDown: - if (GUIUtility.hotControl == 0 && rect.Contains(e.mousePosition)) - GUIUtility.hotControl = ctrlId; - break; - case EventType.MouseDrag: - if (GUIUtility.hotControl == ctrlId) - { - m_HorizontalSplitBarPosition -= e.delta.y; - if (m_HorizontalSplitBarPosition < 20) m_HorizontalSplitBarPosition = 20; - Repaint(); - } - break; - case EventType.MouseUp: - if (GUIUtility.hotControl == ctrlId) - GUIUtility.hotControl = 0; - break; - } - - m_TestInfoScroll = EditorGUILayout.BeginScrollView(m_TestInfoScroll, GUILayout.MinHeight(m_HorizontalSplitBarPosition)); - - if (m_SelectedLine != null) - UpdateResultText(m_SelectedLine); - - EditorGUILayout.SelectableLabel(m_resultText, Styles.info, - GUILayout.ExpandHeight(true), - GUILayout.ExpandWidth(true), - GUILayout.MinWidth(m_resultTextSize.x), - GUILayout.MinHeight(m_resultTextSize.y)); - EditorGUILayout.EndScrollView(); - } - - private void UpdateResultText(GameObject go) - { - if(go == m_lastSelectedGO) return; - m_lastSelectedGO = go; - var result = m_ResultList.Find(r => r.GameObject == go); - if (result == null) - { - m_resultText = string.Empty; - m_resultTextSize = Styles.info.CalcSize(new GUIContent(string.Empty)); - return; - } - var sb = new StringBuilder(result.Name.Trim()); - if (!string.IsNullOrEmpty(result.messages)) - { - sb.Append("\n---\n"); - sb.Append(result.messages.Trim()); - } - if (!string.IsNullOrEmpty(result.stacktrace)) - { - sb.Append("\n---\n"); - sb.Append(result.stacktrace.Trim()); - } - if(sb.Length>m_resultTestMaxLength) - { - sb.Length = m_resultTestMaxLength; - sb.AppendFormat("...\n\n---MESSAGE TRUNCATED AT {0} CHARACTERS---", m_resultTestMaxLength); - } - m_resultText = sb.ToString().Trim(); - m_resultTextSize = Styles.info.CalcSize(new GUIContent(m_resultText)); - } - - public void OnInspectorUpdate() - { - if (focusedWindow != this) Repaint(); - } - - private void SetCurrentTest(TestComponent tc) - { - foreach (var line in m_TestLines) - line.SetCurrentTest(tc); - } - - class RunnerCallback : ITestRunnerCallback - { - private readonly IntegrationTestsRunnerWindow m_Window; - private int m_TestNumber; - private int m_CurrentTestNumber; - - private readonly bool m_ConsoleErrorOnPauseValue; - private readonly bool m_RunInBackground; - private TestComponent m_CurrentTest; - - public RunnerCallback(IntegrationTestsRunnerWindow window) - { - m_Window = window; - - m_ConsoleErrorOnPauseValue = GuiHelper.GetConsoleErrorPause(); - GuiHelper.SetConsoleErrorPause(false); - m_RunInBackground = PlayerSettings.runInBackground; - PlayerSettings.runInBackground = true; - } - - public void RunStarted(string platform, List testsToRun) - { - EditorApplication.update += OnEditorUpdate; - m_TestNumber = testsToRun.Count; - foreach (var test in testsToRun) - { - var result = m_Window.m_ResultList.Find(r => r.TestComponent == test); - if (result != null) result.Reset(); - } - } - - public void RunFinished(List testResults) - { - m_Window.SetCurrentTest(null); - m_CurrentTest = null; - EditorApplication.update -= OnEditorUpdate; - EditorApplication.isPlaying = false; - EditorUtility.ClearProgressBar(); - GuiHelper.SetConsoleErrorPause(m_ConsoleErrorOnPauseValue); - PlayerSettings.runInBackground = m_RunInBackground; - } - - public void AllScenesFinished() - { - - } - - public void TestStarted(TestResult test) - { - m_Window.SetCurrentTest(test.TestComponent); - m_CurrentTest = test.TestComponent; - } - - - public void TestFinished(TestResult test) - { - m_CurrentTestNumber++; - - var result = m_Window.m_ResultList.Find(r => r.Id == test.Id); - if (result != null) - result.Update(test); - else - m_Window.m_ResultList.Add(test); - - if(test.IsFailure && m_Window.m_Settings.pauseOnTestFailure) - { - EditorUtility.ClearProgressBar(); - EditorApplication.isPaused = true; - } - } - - public void TestRunInterrupted(List testsNotRun) - { - Debug.Log("Test run interrupted"); - RunFinished(new List()); - } - - private void OnEditorUpdate() - { - if(!EditorApplication.isPlaying) - { - TestRunInterrupted(null); - return; - } - - if (m_Window.m_Settings.blockUIWhenRunning - && m_CurrentTest != null - && !EditorApplication.isPaused - && EditorUtility.DisplayCancelableProgressBar("Integration Test Runner", - "Running " + m_CurrentTest.Name, - (float)m_CurrentTestNumber / m_TestNumber)) - { - TestRunInterrupted(null); - } - } - } - - [MenuItem("Unity Test Tools/Integration Test Runner %#&t")] - public static IntegrationTestsRunnerWindow ShowWindow() - { - var w = GetWindow(typeof(IntegrationTestsRunnerWindow)); - w.Show(); - return w as IntegrationTestsRunnerWindow; - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerWindow.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerWindow.cs.meta deleted file mode 100644 index 86b5775..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerWindow.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2c898357efb599944818326bb43ba879 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner.meta deleted file mode 100644 index b7631ee..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: c44e9167d633ee94bb6e078238178308 -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/NetworkResultsReceiver.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/NetworkResultsReceiver.cs deleted file mode 100644 index f3be338..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/NetworkResultsReceiver.cs +++ /dev/null @@ -1,261 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using UnityEditor; -using UnityEditorInternal; -using UnityEngine; - -namespace UnityTest -{ - [Serializable] - public class NetworkResultsReceiver : EditorWindow - { - public static NetworkResultsReceiver Instance; - - private string m_StatusLabel; - private TcpListener m_Listener; - - [SerializeField] - private PlatformRunnerConfiguration m_Configuration; - - private List m_TestResults = new List(); - - #region steering variables - private bool m_RunFinished; - private bool m_Repaint; - - private TimeSpan m_TestTimeout = TimeSpan.Zero; - private DateTime m_LastMessageReceived; - private bool m_Running; - - public TimeSpan ReceiveMessageTimeout = TimeSpan.FromSeconds(30); - private readonly TimeSpan m_InitialConnectionTimeout = TimeSpan.FromSeconds(300); - private bool m_TestFailed; - #endregion - - private void AcceptCallback(TcpClient client) - { - m_Repaint = true; - ResultDTO dto; - try - { - m_LastMessageReceived = DateTime.Now; - using (var stream = client.GetStream()) - { - var bf = new DTOFormatter(); - dto = (ResultDTO)bf.Deserialize(stream); - stream.Close(); - } - client.Close(); - } - catch (ObjectDisposedException e) - { - Debug.LogException(e); - m_StatusLabel = "Got disconnected"; - return; - } - catch (Exception e) - { - Debug.LogException(e); - return; - } - - switch (dto.messageType) - { - case ResultDTO.MessageType.TestStarted: - m_StatusLabel = dto.testName; - m_TestTimeout = TimeSpan.FromSeconds(dto.testTimeout); - break; - case ResultDTO.MessageType.TestFinished: - m_TestResults.Add(dto.testResult); - m_TestTimeout = TimeSpan.Zero; - if (dto.testResult.Executed && dto.testResult.ResultState != TestResultState.Ignored && !dto.testResult.IsSuccess) - m_TestFailed = true; - break; - case ResultDTO.MessageType.RunStarted: - m_TestResults = new List(); - m_StatusLabel = "Run started: " + dto.loadedLevelName; - break; - case ResultDTO.MessageType.RunFinished: - WriteResultsToLog(dto, m_TestResults); - if (!string.IsNullOrEmpty(m_Configuration.resultsDir)) - { - var platform = m_Configuration.runInEditor ? "Editor" : m_Configuration.buildTarget.ToString(); - var resultWriter = new XmlResultWriter(dto.loadedLevelName, platform, m_TestResults.ToArray()); - try - { - if (!Directory.Exists(m_Configuration.resultsDir)) - { - Directory.CreateDirectory(m_Configuration.resultsDir); - } - var filePath = Path.Combine(m_Configuration.resultsDir, dto.loadedLevelName + ".xml"); - File.WriteAllText(filePath, resultWriter.GetTestResult()); - } - catch (Exception e) - { - Debug.LogException(e); - } - } - break; - case ResultDTO.MessageType.AllScenesFinished: - m_Running = false; - m_RunFinished = true; - break; - case ResultDTO.MessageType.Ping: - break; - } - } - - private void WriteResultsToLog(ResultDTO dto, List list) - { - string result = "Run finished for: " + dto.loadedLevelName; - var failCount = list.Count(t => t.Executed && !t.IsSuccess); - if (failCount == 0) - result += "\nAll tests passed"; - else - result += "\n" + failCount + " tests failed"; - - if (failCount == 0) - Debug.Log(result); - else - Debug.LogWarning(result); - } - - public void Update() - { - if (EditorApplication.isCompiling - && m_Listener != null) - { - m_Running = false; - m_Listener.Stop(); - return; - } - - if (m_Running) - { - try - { - if (m_Listener != null && m_Listener.Pending()) - { - using (var client = m_Listener.AcceptTcpClient()) - { - AcceptCallback(client); - client.Close(); - } - } - } - catch (InvalidOperationException e) - { - m_StatusLabel = "Exception happened: " + e.Message; - Repaint(); - Debug.LogException(e); - } - } - - if (m_Running) - { - var adjustedtestTimeout = m_TestTimeout.Add(m_TestTimeout); - var timeout = ReceiveMessageTimeout > adjustedtestTimeout ? ReceiveMessageTimeout : adjustedtestTimeout; - if ((DateTime.Now - m_LastMessageReceived) > timeout) - { - Debug.LogError("Timeout when waiting for test results"); - m_RunFinished = true; - } - } - if (m_RunFinished) - { - if (InternalEditorUtility.inBatchMode) - EditorApplication.Exit(m_TestFailed ? Batch.returnCodeTestsFailed : Batch.returnCodeTestsOk); - Close(); - } - if (m_Repaint) Repaint(); - } - - public void OnEnable() - { - minSize = new Vector2(300, 100); - titleContent = new GUIContent("Test run monitor"); - Instance = this; - m_StatusLabel = "Initializing..."; - if (EditorApplication.isCompiling) return; - EnableServer(); - } - - private void EnableServer() - { - if (m_Configuration == null) throw new Exception("No result receiver server configuration."); - - var ipAddress = IPAddress.Any; - if (m_Configuration.ipList != null && m_Configuration.ipList.Count == 1) - ipAddress = IPAddress.Parse(m_Configuration.ipList.Single()); - - var ipAddStr = Equals(ipAddress, IPAddress.Any) ? "[All interfaces]" : ipAddress.ToString(); - - m_Listener = new TcpListener(ipAddress, m_Configuration.port); - m_StatusLabel = "Waiting for connection on: " + ipAddStr + ":" + m_Configuration.port; - - try - { - m_Listener.Start(100); - } - catch (SocketException e) - { - m_StatusLabel = "Exception happened: " + e.Message; - Repaint(); - Debug.LogException(e); - } - m_Running = true; - m_LastMessageReceived = DateTime.Now + m_InitialConnectionTimeout; - } - - public void OnDisable() - { - Instance = null; - if (m_Listener != null) - m_Listener.Stop(); - } - - public void OnGUI() - { - EditorGUILayout.LabelField("Status:", EditorStyles.boldLabel); - EditorGUILayout.LabelField(m_StatusLabel); - GUILayout.FlexibleSpace(); - if (GUILayout.Button("Stop")) - { - StopReceiver(); - if (InternalEditorUtility.inBatchMode) - EditorApplication.Exit(Batch.returnCodeRunError); - } - } - - public static void StartReceiver(PlatformRunnerConfiguration configuration) - { - var w = (NetworkResultsReceiver)GetWindow(typeof(NetworkResultsReceiver), false); - w.SetConfiguration(configuration); - if (!EditorApplication.isCompiling) - { - w.EnableServer(); - } - w.Show(true); - } - - private void SetConfiguration(PlatformRunnerConfiguration configuration) - { - m_Configuration = configuration; - } - - public static void StopReceiver() - { - if (Instance == null) return; - try{ - Instance.Close(); - }catch(Exception e){ - Debug.LogException(e); - DestroyImmediate(Instance); - } - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/NetworkResultsReceiver.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/NetworkResultsReceiver.cs.meta deleted file mode 100644 index cfc201e..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/NetworkResultsReceiver.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ade4197221f35dc44adb7649f99af2e7 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunner.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunner.cs deleted file mode 100644 index 2f649b0..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunner.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Sockets; -using UnityEditor; -using UnityEditorInternal; -using UnityEngine; -using System.Linq; - -namespace UnityTest.IntegrationTests -{ - public class PlatformRunner - { - public static BuildTarget defaultBuildTarget - { - get - { - var target = EditorPrefs.GetString("ITR-platformRunnerBuildTarget"); - BuildTarget buildTarget; - try - { - buildTarget = (BuildTarget)Enum.Parse(typeof(BuildTarget), target); - } - catch - { - return GetDefaultBuildTarget(); - } - return buildTarget; - } - set { EditorPrefs.SetString("ITR-platformRunnerBuildTarget", value.ToString()); } - } - - [MenuItem("Unity Test Tools/Platform Runner/Run current scene %#&r")] - public static void BuildAndRunCurrentScene() - { - Debug.Log("Building and running current test for " + defaultBuildTarget); - BuildAndRunInPlayer(new PlatformRunnerConfiguration(defaultBuildTarget)); - } - - [MenuItem("Unity Test Tools/Platform Runner/Run on platform %#r")] - public static void RunInPlayer() - { - var w = EditorWindow.GetWindow(typeof(PlatformRunnerSettingsWindow)); - w.Show(); - } - - public static void BuildAndRunInPlayer(PlatformRunnerConfiguration configuration) - { - NetworkResultsReceiver.StopReceiver(); - - var settings = new PlayerSettingConfigurator(false); - - if (configuration.sendResultsOverNetwork) - { - try - { - var l = new TcpListener(IPAddress.Any, configuration.port); - l.Start(); - configuration.port = ((IPEndPoint)l.Server.LocalEndPoint).Port; - l.Stop(); - } - catch (SocketException e) - { - Debug.LogException(e); - if (InternalEditorUtility.inBatchMode) - EditorApplication.Exit(Batch.returnCodeRunError); - } - } - - if (InternalEditorUtility.inBatchMode) - settings.AddConfigurationFile(TestRunnerConfigurator.batchRunFileMarker, ""); - - if (configuration.sendResultsOverNetwork) - settings.AddConfigurationFile(TestRunnerConfigurator.integrationTestsNetwork, - string.Join("\n", configuration.GetConnectionIPs())); - - settings.AddConfigurationFile (TestRunnerConfigurator.testScenesToRun, string.Join ("\n", configuration.testScenes.ToArray())); - - settings.ChangeSettingsForIntegrationTests(); - - AssetDatabase.Refresh(); - - var result = BuildPipeline.BuildPlayer(configuration.testScenes.Concat(configuration.buildScenes).ToArray(), - configuration.GetTempPath(), - configuration.buildTarget, - BuildOptions.AutoRunPlayer | BuildOptions.Development); - - settings.RevertSettingsChanges(); - settings.RemoveAllConfigurationFiles(); - - AssetDatabase.Refresh(); - - if (!string.IsNullOrEmpty(result)) - { - if (InternalEditorUtility.inBatchMode) - EditorApplication.Exit(Batch.returnCodeRunError); - return; - } - - if (configuration.sendResultsOverNetwork) - NetworkResultsReceiver.StartReceiver(configuration); - else if (InternalEditorUtility.inBatchMode) - EditorApplication.Exit(Batch.returnCodeTestsOk); - } - - private static BuildTarget GetDefaultBuildTarget() - { - switch (EditorUserBuildSettings.selectedBuildTargetGroup) - { - case BuildTargetGroup.Android: - return BuildTarget.Android; - case BuildTargetGroup.WebPlayer: - return BuildTarget.WebPlayer; - default: - { - switch (Application.platform) - { - case RuntimePlatform.WindowsPlayer: - return BuildTarget.StandaloneWindows; - case RuntimePlatform.OSXPlayer: - return BuildTarget.StandaloneOSXIntel; - case RuntimePlatform.LinuxPlayer: - return BuildTarget.StandaloneLinux; - } - return BuildTarget.WebPlayer; - } - } - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunner.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunner.cs.meta deleted file mode 100644 index 5ecced0..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunner.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a3581fa3f207a8a4c9988b9f59a510d3 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerConfiguration.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerConfiguration.cs deleted file mode 100644 index 1c0a785..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerConfiguration.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using UnityEditor; -using UnityEngine; -using UnityEngine.SceneManagement; - -[Serializable] -public class PlatformRunnerConfiguration -{ - public List buildScenes; - public List testScenes; - public BuildTarget buildTarget; - public bool runInEditor; - public string projectName = SceneManager.GetActiveScene().path; - - public string resultsDir = null; - public bool sendResultsOverNetwork; - public List ipList; - public int port; - - public PlatformRunnerConfiguration(BuildTarget buildTarget) - { - this.buildTarget = buildTarget; - projectName = SceneManager.GetActiveScene().path; - } - - public PlatformRunnerConfiguration() - : this(BuildTarget.StandaloneWindows) - { - } - - public string GetTempPath() - { - if (string.IsNullOrEmpty(projectName)) - projectName = Path.GetTempFileName(); - - var path = Path.Combine("Temp", projectName); - switch (buildTarget) - { - case BuildTarget.StandaloneWindows: - case BuildTarget.StandaloneWindows64: - return path + ".exe"; - case BuildTarget.StandaloneOSXIntel: - return path + ".app"; - case BuildTarget.Android: - return path + ".apk"; - default: - if (buildTarget.ToString() == "BlackBerry" || buildTarget.ToString() == "BB10") - return path + ".bar"; - return path; - } - } - - public string[] GetConnectionIPs() - { - return ipList.Select(ip => ip + ":" + port).ToArray(); - } - - public static int TryToGetFreePort() - { - var port = -1; - try - { - var l = new TcpListener(IPAddress.Any, 0); - l.Start(); - port = ((IPEndPoint)l.Server.LocalEndPoint).Port; - l.Stop(); - } - catch (SocketException e) - { - Debug.LogException(e); - } - return port; - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerConfiguration.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerConfiguration.cs.meta deleted file mode 100644 index f747c6e..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerConfiguration.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b98fe8c3761da2d4b8cfd8bd6df7050f -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettings.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettings.cs deleted file mode 100644 index 8b54c3a..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettings.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using UnityEngine; - -namespace UnityTest -{ - public class PlatformRunnerSettings : ProjectSettingsBase - { - public string resultsPath; - public bool sendResultsOverNetwork = true; - public int port = 0; - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettings.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettings.cs.meta deleted file mode 100644 index 1cc9a28..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettings.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 964f5f0db2c95bb41aa3dc3beba1f06b -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettingsWindow.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettingsWindow.cs deleted file mode 100644 index 5ae9d07..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettingsWindow.cs +++ /dev/null @@ -1,318 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using UnityEditor; -using UnityEngine; -using Object = UnityEngine.Object; -using UnityEngine.SceneManagement; - -namespace UnityTest.IntegrationTests -{ - [Serializable] - public class PlatformRunnerSettingsWindow : EditorWindow - { - private BuildTarget m_BuildTarget; - - private List m_IntegrationTestScenes; - private List m_OtherScenesToBuild; - private List m_AllScenesInProject; - - private Vector2 m_ScrollPosition; - private readonly List m_Interfaces = new List(); - private readonly List m_SelectedScenes = new List(); - - private int m_SelectedInterface; - [SerializeField] - private bool m_AdvancedNetworkingSettings; - - private PlatformRunnerSettings m_Settings; - - private string m_SelectedSceneInAll; - private string m_SelectedSceneInTest; - private string m_SelectedSceneInBuild; - - readonly GUIContent m_Label = new GUIContent("Results target directory", "Directory where the results will be saved. If no value is specified, the results will be generated in project's data folder."); - - public PlatformRunnerSettingsWindow() - { - if (m_OtherScenesToBuild == null) - m_OtherScenesToBuild = new List (); - - if (m_IntegrationTestScenes == null) - m_IntegrationTestScenes = new List (); - - titleContent = new GUIContent("Platform runner"); - m_BuildTarget = PlatformRunner.defaultBuildTarget; - position.Set(position.xMin, position.yMin, 200, position.height); - m_AllScenesInProject = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.unity", SearchOption.AllDirectories).ToList(); - m_AllScenesInProject.Sort(); - var currentScene = (Directory.GetCurrentDirectory() + SceneManager.GetActiveScene().path).Replace("\\", "").Replace("/", ""); - var currentScenePath = m_AllScenesInProject.Where(s => s.Replace("\\", "").Replace("/", "") == currentScene); - m_SelectedScenes.AddRange(currentScenePath); - - m_Interfaces.Add("(Any)"); - m_Interfaces.AddRange(TestRunnerConfigurator.GetAvailableNetworkIPs()); - m_Interfaces.Add("127.0.0.1"); - - LoadFromPrefereneces (); - } - - public void OnEnable() - { - m_Settings = ProjectSettingsBase.Load(); - - // If not configured pre populate with all scenes that have test components on game objects - // This needs to be done outsie of constructor - if (m_IntegrationTestScenes.Count == 0) - m_IntegrationTestScenes = GetScenesWithTestComponents (m_AllScenesInProject); - } - - public void OnGUI() - { - EditorGUILayout.BeginVertical(); - GUIContent label; - - /* We have three lists here, The tests to run, supporting scenes to include in the build and the list of all scenes so users can - * pick the scenes they want to include. The motiviation here is that test scenes may require to additively load other scenes as part of the tests - */ - EditorGUILayout.BeginHorizontal (); - - // Integration Tests To Run - EditorGUILayout.BeginVertical (); - - label = new GUIContent("Tests:", "All Integration Test scenes that you wish to run on the platform"); - EditorGUILayout.LabelField(label, EditorStyles.boldLabel, GUILayout.Height(20f)); - - EditorGUI.BeginDisabledGroup(string.IsNullOrEmpty(m_SelectedSceneInTest)); - if (GUILayout.Button("Remove Integration Test")) { - m_IntegrationTestScenes.Remove(m_SelectedSceneInTest); - m_SelectedSceneInTest = ""; - } - EditorGUI.EndDisabledGroup(); - - DrawVerticalSceneList (ref m_IntegrationTestScenes, ref m_SelectedSceneInTest); - EditorGUILayout.EndVertical (); - - // Extra scenes to include in build - EditorGUILayout.BeginVertical (); - label = new GUIContent("Other Scenes in Build:", "If your Integration Tests additivly load any other scenes then you want to include them here so they are part of the build"); - EditorGUILayout.LabelField(label, EditorStyles.boldLabel, GUILayout.Height(20f)); - - - EditorGUI.BeginDisabledGroup(string.IsNullOrEmpty(m_SelectedSceneInBuild)); - if (GUILayout.Button("Remove From Build")) { - m_OtherScenesToBuild.Remove(m_SelectedSceneInBuild); - m_SelectedSceneInBuild = ""; - } - EditorGUI.EndDisabledGroup(); - - DrawVerticalSceneList (ref m_OtherScenesToBuild, ref m_SelectedSceneInBuild); - EditorGUILayout.EndVertical (); - - EditorGUILayout.Separator (); - - // All Scenes - EditorGUILayout.BeginVertical (); - label = new GUIContent("Availble Scenes", "These are all the scenes within your project, please select some to run tests"); - EditorGUILayout.LabelField(label, EditorStyles.boldLabel, GUILayout.Height(20f)); - - - EditorGUILayout.BeginHorizontal (); - EditorGUI.BeginDisabledGroup(string.IsNullOrEmpty(m_SelectedSceneInAll)); - if (GUILayout.Button("Add As Test")) { - if (!m_IntegrationTestScenes.Contains (m_SelectedSceneInAll) && !m_OtherScenesToBuild.Contains (m_SelectedSceneInAll)) { - m_IntegrationTestScenes.Add(m_SelectedSceneInAll); - } - } - - if (GUILayout.Button("Add to Build")) { - if (!m_IntegrationTestScenes.Contains (m_SelectedSceneInAll) && !m_OtherScenesToBuild.Contains (m_SelectedSceneInAll)) { - m_OtherScenesToBuild.Add(m_SelectedSceneInAll); - } - } - EditorGUI.EndDisabledGroup(); - - EditorGUILayout.EndHorizontal (); - - DrawVerticalSceneList (ref m_AllScenesInProject, ref m_SelectedSceneInAll); - EditorGUILayout.EndVertical (); - - // ButtoNetworkResultsReceiverns to edit scenes in lists - - - EditorGUILayout.EndHorizontal (); - - GUILayout.Space(3); - - // Select target platform - m_BuildTarget = (BuildTarget)EditorGUILayout.EnumPopup("Build tests for", m_BuildTarget); - - if (PlatformRunner.defaultBuildTarget != m_BuildTarget) - { - if (GUILayout.Button("Make default target platform")) - { - PlatformRunner.defaultBuildTarget = m_BuildTarget; - } - } - GUI.enabled = true; - - // Select various Network settings - DrawSetting(); - var build = GUILayout.Button("Build and run tests"); - EditorGUILayout.EndVertical(); - - if (build) - { - BuildAndRun (); - } - } - - private void DrawVerticalSceneList(ref List sourceList, ref string selectString) - { - m_ScrollPosition = EditorGUILayout.BeginScrollView(m_ScrollPosition, Styles.testList); - EditorGUI.indentLevel++; - foreach (var scenePath in sourceList) - { - var path = Path.GetFileNameWithoutExtension(scenePath); - var guiContent = new GUIContent(path, scenePath); - var rect = GUILayoutUtility.GetRect(guiContent, EditorStyles.label); - if (rect.Contains(Event.current.mousePosition)) - { - if (Event.current.type == EventType.mouseDown && Event.current.button == 0) - { - selectString = scenePath; - Event.current.Use(); - } - } - var style = new GUIStyle(EditorStyles.label); - - if (selectString == scenePath) - style.normal.textColor = new Color(0.3f, 0.5f, 0.85f); - EditorGUI.LabelField(rect, guiContent, style); - } - EditorGUI.indentLevel--; - EditorGUILayout.EndScrollView(); - } - - public static List GetScenesWithTestComponents(List allScenes) - { - List results = EditorReferencesUtil.FindScenesWhichContainAsset("TestComponent.cs"); - List integrationTestScenes = new List(); - - foreach (Object obj in results) { - string result = allScenes.FirstOrDefault(s => s.Contains(obj.name)); - if (!string.IsNullOrEmpty(result)) - integrationTestScenes.Add(result); - } - - return integrationTestScenes; - } - - private void DrawSetting() - { - EditorGUI.BeginChangeCheck(); - - EditorGUILayout.BeginHorizontal(); - m_Settings.resultsPath = EditorGUILayout.TextField(m_Label, m_Settings.resultsPath); - if (GUILayout.Button("Search", EditorStyles.miniButton, GUILayout.Width(50))) - { - var selectedPath = EditorUtility.SaveFolderPanel("Result files destination", m_Settings.resultsPath, ""); - if (!string.IsNullOrEmpty(selectedPath)) - m_Settings.resultsPath = Path.GetFullPath(selectedPath); - } - EditorGUILayout.EndHorizontal(); - - if (!string.IsNullOrEmpty(m_Settings.resultsPath)) - { - Uri uri; - if (!Uri.TryCreate(m_Settings.resultsPath, UriKind.Absolute, out uri) || !uri.IsFile || uri.IsWellFormedOriginalString()) - { - EditorGUILayout.HelpBox("Invalid URI path", MessageType.Warning); - } - } - - m_Settings.sendResultsOverNetwork = EditorGUILayout.Toggle("Send results to editor", m_Settings.sendResultsOverNetwork); - EditorGUI.BeginDisabledGroup(!m_Settings.sendResultsOverNetwork); - m_AdvancedNetworkingSettings = EditorGUILayout.Foldout(m_AdvancedNetworkingSettings, "Advanced network settings"); - if (m_AdvancedNetworkingSettings) - { - m_SelectedInterface = EditorGUILayout.Popup("Network interface", m_SelectedInterface, m_Interfaces.ToArray()); - EditorGUI.BeginChangeCheck(); - m_Settings.port = EditorGUILayout.IntField("Network port", m_Settings.port); - if (EditorGUI.EndChangeCheck()) - { - if (m_Settings.port > IPEndPoint.MaxPort) - m_Settings.port = IPEndPoint.MaxPort; - else if (m_Settings.port < IPEndPoint.MinPort) - m_Settings.port = IPEndPoint.MinPort; - } - } - - EditorGUI.EndDisabledGroup(); - - if (EditorGUI.EndChangeCheck()) - { - m_Settings.Save(); - } - } - - private void BuildAndRun() - { - SaveToPreferences (); - - var config = new PlatformRunnerConfiguration - { - buildTarget = m_BuildTarget, - buildScenes = m_OtherScenesToBuild, - testScenes = m_IntegrationTestScenes, - projectName = m_IntegrationTestScenes.Count > 1 ? "IntegrationTests" : Path.GetFileNameWithoutExtension(SceneManager.GetActiveScene().path), - resultsDir = m_Settings.resultsPath, - sendResultsOverNetwork = m_Settings.sendResultsOverNetwork, - ipList = m_Interfaces.Skip(1).ToList(), - port = m_Settings.port - }; - - if (m_SelectedInterface > 0) - config.ipList = new List {m_Interfaces.ElementAt(m_SelectedInterface)}; - - PlatformRunner.BuildAndRunInPlayer(config); - Close (); - } - - public void OnLostFocus() { - SaveToPreferences (); - } - - public void OnDestroy() { - SaveToPreferences (); - } - - private void SaveToPreferences() - { - EditorPrefs.SetString (Animator.StringToHash (Application.dataPath + "uttTestScenes").ToString (), String.Join (",",m_IntegrationTestScenes.ToArray())); - EditorPrefs.SetString (Animator.StringToHash (Application.dataPath + "uttBuildScenes").ToString (), String.Join (",",m_OtherScenesToBuild.ToArray())); - } - - private void LoadFromPrefereneces() - { - string storedTestScenes = EditorPrefs.GetString (Animator.StringToHash (Application.dataPath + "uttTestScenes").ToString ()); - string storedBuildScenes = EditorPrefs.GetString (Animator.StringToHash (Application.dataPath + "uttBuildScenes").ToString ()); - - List parsedTestScenes = storedTestScenes.Split (',').ToList (); - List parsedBuildScenes = storedBuildScenes.Split (',').ToList (); - - // Sanity check scenes actually exist - foreach (string str in parsedTestScenes) { - if (m_AllScenesInProject.Contains(str)) - m_IntegrationTestScenes.Add(str); - } - - foreach (string str in parsedBuildScenes) { - if (m_AllScenesInProject.Contains(str)) - m_OtherScenesToBuild.Add(str); - } - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettingsWindow.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettingsWindow.cs.meta deleted file mode 100644 index 8fed609..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettingsWindow.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 3819282b0887bc742911b89745080acb -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlayerSettingConfigurator.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlayerSettingConfigurator.cs deleted file mode 100644 index 77aea81..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlayerSettingConfigurator.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using UnityEditor; -using UnityEngine; - -namespace UnityTest -{ - class PlayerSettingConfigurator - { - private string resourcesPath { - get { return m_Temp ? k_TempPath : m_ProjectResourcesPath; } - } - - private readonly string m_ProjectResourcesPath = Path.Combine("Assets", "Resources"); - const string k_TempPath = "Temp"; - private readonly bool m_Temp; - - private ResolutionDialogSetting m_DisplayResolutionDialog; - private bool m_RunInBackground; - private bool m_FullScreen; - private bool m_ResizableWindow; - private readonly List m_TempFileList = new List(); - - public PlayerSettingConfigurator(bool saveInTempFolder) - { - m_Temp = saveInTempFolder; - } - - public void ChangeSettingsForIntegrationTests() - { - m_DisplayResolutionDialog = PlayerSettings.displayResolutionDialog; - PlayerSettings.displayResolutionDialog = ResolutionDialogSetting.Disabled; - - m_RunInBackground = PlayerSettings.runInBackground; - PlayerSettings.runInBackground = true; - - m_FullScreen = PlayerSettings.defaultIsFullScreen; - PlayerSettings.defaultIsFullScreen = false; - - m_ResizableWindow = PlayerSettings.resizableWindow; - PlayerSettings.resizableWindow = true; - } - - public void RevertSettingsChanges() - { - PlayerSettings.defaultIsFullScreen = m_FullScreen; - PlayerSettings.runInBackground = m_RunInBackground; - PlayerSettings.displayResolutionDialog = m_DisplayResolutionDialog; - PlayerSettings.resizableWindow = m_ResizableWindow; - } - - public void AddConfigurationFile(string fileName, string content) - { - var resourcesPathExists = Directory.Exists(resourcesPath); - if (!resourcesPathExists) AssetDatabase.CreateFolder("Assets", "Resources"); - - var filePath = Path.Combine(resourcesPath, fileName); - File.WriteAllText(filePath, content); - - m_TempFileList.Add(filePath); - } - - public void RemoveAllConfigurationFiles() - { - foreach (var filePath in m_TempFileList) - AssetDatabase.DeleteAsset(filePath); - if (Directory.Exists(resourcesPath) - && Directory.GetFiles(resourcesPath).Length == 0) - AssetDatabase.DeleteAsset(resourcesPath); - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlayerSettingConfigurator.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlayerSettingConfigurator.cs.meta deleted file mode 100644 index 732b8be..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlayerSettingConfigurator.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c7adbe43058d54047b6109b2e66894fd -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer.meta deleted file mode 100644 index ccb3c14..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 5944b82e46f1682439d20b4c3a4f029c -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestGroupLine.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestGroupLine.cs deleted file mode 100644 index a7d8619..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestGroupLine.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEngine; - -namespace UnityTest -{ - class IntegrationTestGroupLine : IntegrationTestRendererBase - { - public static List FoldMarkers; - private IntegrationTestRendererBase[] m_Children; - - public IntegrationTestGroupLine(GameObject gameObject) : base(gameObject) - { - } - - protected internal override void DrawLine(Rect rect, GUIContent label, bool isSelected, RenderingOptions options) - { - EditorGUI.BeginChangeCheck(); - var isClassFolded = !EditorGUI.Foldout(rect, !Folded, label, isSelected ? Styles.selectedFoldout : Styles.foldout); - if (EditorGUI.EndChangeCheck()) Folded = isClassFolded; - } - - private bool Folded - { - get { return FoldMarkers.Contains(m_GameObject); } - - set - { - if (value) FoldMarkers.Add(m_GameObject); - else FoldMarkers.RemoveAll(s => s == m_GameObject); - } - } - - protected internal override void Render(int indend, RenderingOptions options) - { - base.Render(indend, options); - if (!Folded) - foreach (var child in m_Children) - child.Render(indend + 1, options); - } - - protected internal override TestResult.ResultType GetResult() - { - bool ignored = false; - bool success = false; - foreach (var child in m_Children) - { - var result = child.GetResult(); - - if (result == TestResult.ResultType.Failed || result == TestResult.ResultType.FailedException || result == TestResult.ResultType.Timeout) - return TestResult.ResultType.Failed; - if (result == TestResult.ResultType.Success) - success = true; - else if (result == TestResult.ResultType.Ignored) - ignored = true; - else - ignored = false; - } - if (success) return TestResult.ResultType.Success; - if (ignored) return TestResult.ResultType.Ignored; - return TestResult.ResultType.NotRun; - } - - protected internal override bool IsVisible(RenderingOptions options) - { - return m_Children.Any(c => c.IsVisible(options)); - } - - public override bool SetCurrentTest(TestComponent tc) - { - m_IsRunning = false; - foreach (var child in m_Children) - m_IsRunning |= child.SetCurrentTest(tc); - return m_IsRunning; - } - - public void AddChildren(IntegrationTestRendererBase[] parseTestList) - { - m_Children = parseTestList; - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestGroupLine.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestGroupLine.cs.meta deleted file mode 100644 index 0051064..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestGroupLine.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f6dc74195aa98ef4da8901199cda4a63 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestLine.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestLine.cs deleted file mode 100644 index e0b5d1a..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestLine.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEditor; -using UnityEngine; - -namespace UnityTest -{ - class IntegrationTestLine : IntegrationTestRendererBase - { - public static List Results; - protected TestResult m_Result; - - public IntegrationTestLine(GameObject gameObject, TestResult testResult) : base(gameObject) - { - m_Result = testResult; - } - - protected internal override void DrawLine(Rect rect, GUIContent label, bool isSelected, RenderingOptions options) - { - if(Event.current.type != EventType.repaint) - return; - - Styles.testName.Draw (rect, label, false, false, false, isSelected); - - if (m_Result.IsTimeout) - { - float min, max; - Styles.testName.CalcMinMaxWidth(label, out min, out max); - var timeoutRect = new Rect(rect); - timeoutRect.x += min - 12; - Styles.testName.Draw(timeoutRect, s_GUITimeoutIcon, false, false, false, isSelected); - } - } - - protected internal override TestResult.ResultType GetResult() - { - if (!m_Result.Executed && test.ignored) return TestResult.ResultType.Ignored; - return m_Result.resultType; - } - - protected internal override bool IsVisible(RenderingOptions options) - { - if (!string.IsNullOrEmpty(options.nameFilter) && !m_GameObject.name.ToLower().Contains(options.nameFilter.ToLower())) return false; - if (!options.showSucceeded && m_Result.IsSuccess) return false; - if (!options.showFailed && m_Result.IsFailure) return false; - if (!options.showNotRunned && !m_Result.Executed) return false; - if (!options.showIgnored && test.ignored) return false; - return true; - } - - public override bool SetCurrentTest(TestComponent tc) - { - m_IsRunning = test == tc; - return m_IsRunning; - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestLine.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestLine.cs.meta deleted file mode 100644 index 25c9f11..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestLine.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 212be02e4a7da194688b08ab0c946fbd -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestRendererBase.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestRendererBase.cs deleted file mode 100644 index 5b02698..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestRendererBase.cs +++ /dev/null @@ -1,161 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEngine; -using Object = UnityEngine.Object; - -namespace UnityTest -{ - public abstract class IntegrationTestRendererBase : IComparable - { - public static Action> RunTest; - - protected static bool s_Refresh; - - private static readonly GUIContent k_GUIRunSelected = new GUIContent("Run Selected"); - private static readonly GUIContent k_GUIRun = new GUIContent("Run"); - private static readonly GUIContent k_GUIDelete = new GUIContent("Delete"); - private static readonly GUIContent k_GUIDeleteSelected = new GUIContent("Delete selected"); - - protected static GUIContent s_GUITimeoutIcon = new GUIContent(Icons.StopwatchImg, "Timeout"); - - protected GameObject m_GameObject; - public TestComponent test; - private readonly string m_Name; - - protected IntegrationTestRendererBase(GameObject gameObject) - { - test = gameObject.GetComponent(typeof(TestComponent)) as TestComponent; - if (test == null) throw new ArgumentException("Provided GameObject is not a test object"); - m_GameObject = gameObject; - m_Name = test.Name; - } - - public int CompareTo(IntegrationTestRendererBase other) - { - return test.CompareTo(other.test); - } - - public bool Render(RenderingOptions options) - { - s_Refresh = false; - EditorGUIUtility.SetIconSize(new Vector2(15, 15)); - Render(0, options); - EditorGUIUtility.SetIconSize(Vector2.zero); - return s_Refresh; - } - - protected internal virtual void Render(int indend, RenderingOptions options) - { - if (!IsVisible(options)) return; - EditorGUILayout.BeginHorizontal(); - GUILayout.Space(indend * 10); - - var tempColor = GUI.color; - if (m_IsRunning) - { - var frame = Mathf.Abs(Mathf.Cos(Time.realtimeSinceStartup * 4)) * 0.6f + 0.4f; - GUI.color = new Color(1, 1, 1, frame); - } - - var isSelected = Selection.gameObjects.Contains(m_GameObject); - - var value = GetResult(); - var icon = GetIconForResult(value); - - var label = new GUIContent(m_Name, icon); - var labelRect = GUILayoutUtility.GetRect(label, EditorStyles.label, GUILayout.ExpandWidth(true), GUILayout.Height(18)); - - OnLeftMouseButtonClick(labelRect); - OnContextClick(labelRect); - DrawLine(labelRect, label, isSelected, options); - - if (m_IsRunning) GUI.color = tempColor; - EditorGUILayout.EndHorizontal(); - } - - protected void OnSelect() - { - if (!Event.current.control && !Event.current.command) - { - Selection.objects = new Object[0]; - GUIUtility.keyboardControl = 0; - } - - if ((Event.current.control || Event.current.command) && Selection.gameObjects.Contains(test.gameObject)) - Selection.objects = Selection.gameObjects.Where(o => o != test.gameObject).ToArray(); - else - Selection.objects = Selection.gameObjects.Concat(new[] { test.gameObject }).ToArray(); - } - - protected void OnLeftMouseButtonClick(Rect rect) - { - if (rect.Contains(Event.current.mousePosition) && Event.current.type == EventType.mouseDown && Event.current.button == 0) - { - rect.width = 20; - if (rect.Contains(Event.current.mousePosition)) return; - Event.current.Use(); - OnSelect(); - } - } - - protected void OnContextClick(Rect rect) - { - if (rect.Contains(Event.current.mousePosition) && Event.current.type == EventType.ContextClick) - { - DrawContextMenu(test); - } - } - - public static void DrawContextMenu(TestComponent testComponent) - { - if (EditorApplication.isPlayingOrWillChangePlaymode) return; - - var selectedTests = Selection.gameObjects.Where(go => go.GetComponent(typeof(TestComponent))); - var manySelected = selectedTests.Count() > 1; - - var m = new GenericMenu(); - if (manySelected) - { - // var testsToRun - m.AddItem(k_GUIRunSelected, false, data => RunTest(selectedTests.Select(o => o.GetComponent(typeof(TestComponent))).Cast().ToList()), null); - } - m.AddItem(k_GUIRun, false, data => RunTest(new[] { testComponent }), null); - m.AddSeparator(""); - m.AddItem(manySelected ? k_GUIDeleteSelected : k_GUIDelete, false, data => RemoveTests(selectedTests.ToArray()), null); - m.ShowAsContext(); - } - - private static void RemoveTests(GameObject[] testsToDelete) - { - foreach (var t in testsToDelete) - { - Undo.DestroyObjectImmediate(t); - } - } - - public static Texture GetIconForResult(TestResult.ResultType resultState) - { - switch (resultState) - { - case TestResult.ResultType.Success: - return Icons.SuccessImg; - case TestResult.ResultType.Timeout: - case TestResult.ResultType.Failed: - case TestResult.ResultType.FailedException: - return Icons.FailImg; - case TestResult.ResultType.Ignored: - return Icons.IgnoreImg; - default: - return Icons.UnknownImg; - } - } - - protected internal bool m_IsRunning; - protected internal abstract void DrawLine(Rect rect, GUIContent label, bool isSelected, RenderingOptions options); - protected internal abstract TestResult.ResultType GetResult(); - protected internal abstract bool IsVisible(RenderingOptions options); - public abstract bool SetCurrentTest(TestComponent tc); - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestRendererBase.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestRendererBase.cs.meta deleted file mode 100644 index 1fb186e..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/IntegrationTestRendererBase.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 604645a3b57179a4d873906b625ef8ec -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/RenderingOptions.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/RenderingOptions.cs deleted file mode 100644 index 5d16efc..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/RenderingOptions.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class RenderingOptions - { - public string nameFilter; - public bool showSucceeded; - public bool showFailed; - public bool showIgnored; - public bool showNotRunned; - public string[] categories; - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/RenderingOptions.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/RenderingOptions.cs.meta deleted file mode 100644 index 6ecfc38..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Renderer/RenderingOptions.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5c0aec4b4a6d1b047a98e8cc213e1a36 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/TestComponentEditor.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/TestComponentEditor.cs deleted file mode 100644 index 1b30f55..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/TestComponentEditor.cs +++ /dev/null @@ -1,129 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEngine; -using Object = UnityEngine.Object; -using UnityEditor.SceneManagement; - -namespace UnityTest -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(TestComponent))] - public class TestComponentEditor : Editor - { - private SerializedProperty m_ExpectException; - private SerializedProperty m_ExpectedExceptionList; - private SerializedProperty m_Ignored; - private SerializedProperty m_SucceedAssertions; - private SerializedProperty m_SucceedWhenExceptionIsThrown; - private SerializedProperty m_Timeout; - - #region GUI Contens - - private readonly GUIContent m_GUIExpectException = new GUIContent("Expect exception", "Should the test expect an exception"); - private readonly GUIContent m_GUIExpectExceptionList = new GUIContent("Expected exception list", "A comma separated list of exception types which will not fail the test when thrown"); - private readonly GUIContent m_GUIIgnore = new GUIContent("Ignore", "Ignore the tests in runs"); - private readonly GUIContent m_GUIIncludePlatforms = new GUIContent("Included platforms", "Platform on which the test should run"); - private readonly GUIContent m_GUISuccedOnAssertions = new GUIContent("Succeed on assertions", "Succeed after all assertions are executed"); - private readonly GUIContent m_GUISucceedWhenExceptionIsThrown = new GUIContent("Succeed when exception is thrown", "Should the test succeed when an expected exception is thrown"); - private readonly GUIContent m_GUITestName = new GUIContent("Test name", "Name of the test (is equal to the GameObject name)"); - private readonly GUIContent m_GUITimeout = new GUIContent("Timeout", "Number of seconds after which the test will timeout"); - - #endregion - - public void OnEnable() - { - m_Timeout = serializedObject.FindProperty("timeout"); - m_Ignored = serializedObject.FindProperty("ignored"); - m_SucceedAssertions = serializedObject.FindProperty("succeedAfterAllAssertionsAreExecuted"); - m_ExpectException = serializedObject.FindProperty("expectException"); - m_ExpectedExceptionList = serializedObject.FindProperty("expectedExceptionList"); - m_SucceedWhenExceptionIsThrown = serializedObject.FindProperty("succeedWhenExceptionIsThrown"); - } - - public override void OnInspectorGUI() - { - var component = (TestComponent)target; - - if (component.dynamic) - { - if(GUILayout.Button("Reload dynamic tests")) - { - TestComponent.DestroyAllDynamicTests(); - Selection.objects = new Object[0]; - IntegrationTestsRunnerWindow.selectedInHierarchy = false; - GUIUtility.ExitGUI(); - return; - } - EditorGUILayout.HelpBox("This is a test generated from code. No changes in the component will be persisted.", MessageType.Info); - } - - if (component.IsTestGroup()) - { - EditorGUI.BeginChangeCheck(); - var newGroupName = EditorGUILayout.TextField(m_GUITestName, component.name); - if (EditorGUI.EndChangeCheck()) component.name = newGroupName; - - serializedObject.ApplyModifiedProperties(); - return; - } - - serializedObject.Update(); - - EditorGUI.BeginDisabledGroup(serializedObject.isEditingMultipleObjects); - - EditorGUI.BeginChangeCheck(); - var newName = EditorGUILayout.TextField(m_GUITestName, component.name); - if (EditorGUI.EndChangeCheck()) component.name = newName; - - if (component.platformsToIgnore == null) - { - component.platformsToIgnore = GetListOfIgnoredPlatforms(Enum.GetNames(typeof(TestComponent.IncludedPlatforms)), (int)component.includedPlatforms); - } - - var enumList = Enum.GetNames(typeof(RuntimePlatform)); - var flags = GetFlagList(enumList, component.platformsToIgnore); - flags = EditorGUILayout.MaskField(m_GUIIncludePlatforms, flags, enumList, EditorStyles.popup); - var newList = GetListOfIgnoredPlatforms(enumList, flags); - if (!component.dynamic) - component.platformsToIgnore = newList; - EditorGUI.EndDisabledGroup(); - - EditorGUILayout.PropertyField(m_Timeout, m_GUITimeout); - EditorGUILayout.PropertyField(m_Ignored, m_GUIIgnore); - EditorGUILayout.PropertyField(m_SucceedAssertions, m_GUISuccedOnAssertions); - EditorGUILayout.PropertyField(m_ExpectException, m_GUIExpectException); - - EditorGUI.BeginDisabledGroup(!m_ExpectException.boolValue); - EditorGUILayout.PropertyField(m_ExpectedExceptionList, m_GUIExpectExceptionList); - EditorGUILayout.PropertyField(m_SucceedWhenExceptionIsThrown, m_GUISucceedWhenExceptionIsThrown); - EditorGUI.EndDisabledGroup(); - - if (!component.dynamic) - serializedObject.ApplyModifiedProperties(); - if (GUI.changed) - EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); - } - - private string[] GetListOfIgnoredPlatforms(string[] enumList, int flags) - { - var notSelectedPlatforms = new List(); - for (int i = 0; i < enumList.Length; i++) - { - var sel = (flags & (1 << i)) != 0; - if (!sel) notSelectedPlatforms.Add(enumList[i]); - } - return notSelectedPlatforms.ToArray(); - } - - private int GetFlagList(string[] enumList, string[] platformsToIgnore) - { - int flags = ~0; - for (int i = 0; i < enumList.Length; i++) - if (platformsToIgnore != null && platformsToIgnore.Any(s => s == enumList[i])) - flags &= ~(1 << i); - return flags; - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/TestComponentEditor.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/TestComponentEditor.cs.meta deleted file mode 100644 index e3a1348..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/TestComponentEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 160889f21f4d5944b9f6fcaf9c33f684 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ITestRunnerCallback.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ITestRunnerCallback.cs deleted file mode 100644 index c74dab9..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ITestRunnerCallback.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest.IntegrationTestRunner -{ - public interface ITestRunnerCallback - { - void RunStarted(string platform, List testsToRun); - void RunFinished(List testResults); - void AllScenesFinished(); - void TestStarted(TestResult test); - void TestFinished(TestResult test); - void TestRunInterrupted(List testsNotRun); - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ITestRunnerCallback.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ITestRunnerCallback.cs.meta deleted file mode 100644 index 3a1c54b..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ITestRunnerCallback.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 35af7d395e501a348ae1a0aa3c91dee4 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTest.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTest.cs deleted file mode 100644 index de0e6d1..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTest.cs +++ /dev/null @@ -1,176 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using UnityEngine; - -public static class IntegrationTest -{ - public const string passMessage = "IntegrationTest Pass"; - public const string failMessage = "IntegrationTest Fail"; - - public static void Pass() - { - LogResult(passMessage); - } - - public static void Pass(GameObject go) - { - LogResult(go, passMessage); - } - - public static void Fail(string reason) - { - Fail(); - if (!string.IsNullOrEmpty(reason)) Debug.Log(reason); - } - - public static void Fail(GameObject go, string reason) - { - Fail(go); - if (!string.IsNullOrEmpty(reason)) Debug.Log(reason); - } - - public static void Fail() - { - LogResult(failMessage); - } - - public static void Fail(GameObject go) - { - LogResult(go, failMessage); - } - - public static void Assert(bool condition) - { - Assert(condition, ""); - } - - public static void Assert(GameObject go, bool condition) - { - Assert(go, condition, ""); - } - - public static void Assert(bool condition, string message) - { - if (!condition) - Fail(message); - } - - public static void Assert(GameObject go, bool condition, string message) - { - if (!condition) - Fail(go, message); - } - - private static void LogResult(string message) - { - Debug.Log(message); - } - - private static void LogResult(GameObject go, string message) - { - Debug.Log(message + " (" + FindTestObject(go).name + ")", go); - } - - private static GameObject FindTestObject(GameObject go) - { - var temp = go; - while (temp.transform.parent != null) - { - if (temp.GetComponent("TestComponent") != null) - return temp; - temp = temp.transform.parent.gameObject; - } - return go; - } - - #region Dynamic test attributes - - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] - public class ExcludePlatformAttribute : Attribute - { - public string[] platformsToExclude; - - public ExcludePlatformAttribute(params RuntimePlatform[] platformsToExclude) - { - this.platformsToExclude = platformsToExclude.Select(platform => platform.ToString()).ToArray(); - } - } - - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] - public class ExpectExceptions : Attribute - { - public string[] exceptionTypeNames; - public bool succeedOnException; - - public ExpectExceptions() : this(false) - { - } - - public ExpectExceptions(bool succeedOnException) : this(succeedOnException, new string[0]) - { - } - - public ExpectExceptions(bool succeedOnException, params string[] exceptionTypeNames) - { - this.succeedOnException = succeedOnException; - this.exceptionTypeNames = exceptionTypeNames; - } - - public ExpectExceptions(bool succeedOnException, params Type[] exceptionTypes) - : this(succeedOnException, exceptionTypes.Select(type => type.FullName).ToArray()) - { - } - - public ExpectExceptions(params string[] exceptionTypeNames) : this(false, exceptionTypeNames) - { - } - - public ExpectExceptions(params Type[] exceptionTypes) : this(false, exceptionTypes) - { - } - } - - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] - public class IgnoreAttribute : Attribute - { - } - - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] - public class DynamicTestAttribute : Attribute - { - private readonly string m_SceneName; - - public DynamicTestAttribute(string sceneName) - { - if (sceneName.EndsWith(".unity")) - sceneName = sceneName.Substring(0, sceneName.Length - ".unity".Length); - m_SceneName = sceneName; - } - - public bool IncludeOnScene(string sceneName) - { - var fileName = Path.GetFileNameWithoutExtension(sceneName); - return fileName == m_SceneName; - } - } - - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] - public class SucceedWithAssertions : Attribute - { - } - - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] - public class TimeoutAttribute : Attribute - { - public float timeout; - - public TimeoutAttribute(float seconds) - { - timeout = seconds; - } - } - - #endregion -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTest.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTest.cs.meta deleted file mode 100644 index b6974b8..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTest.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: eb367bbc76e489443a4ebc8b0a8642f4 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTestAttribute.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTestAttribute.cs deleted file mode 100644 index 9ca4e45..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTestAttribute.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using UnityEngine; - -[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] -public class IntegrationTestAttribute : Attribute -{ - private readonly string m_Path; - - public IntegrationTestAttribute(string path) - { - if (path.EndsWith(".unity")) - path = path.Substring(0, path.Length - ".unity".Length); - m_Path = path; - } - - public bool IncludeOnScene(string scenePath) - { - if (scenePath == m_Path) return true; - var fileName = Path.GetFileNameWithoutExtension(scenePath); - return fileName == m_Path; - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTestAttribute.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTestAttribute.cs.meta deleted file mode 100644 index 1c80721..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTestAttribute.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f1a5c61a06ed66e41a6ee1b5f88b5afd -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTestsProvider.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTestsProvider.cs deleted file mode 100644 index c38d3c4..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTestsProvider.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace UnityTest.IntegrationTestRunner -{ - class IntegrationTestsProvider - { - internal Dictionary> testCollection = new Dictionary>(); - internal ITestComponent currentTestGroup; - internal IEnumerable testToRun; - - public IntegrationTestsProvider(IEnumerable tests) - { - testToRun = tests; - foreach (var test in tests.OrderBy(component => component)) - { - if (test.IsTestGroup()) - { - throw new Exception(test.Name + " is test a group"); - } - AddTestToList(test); - } - if (currentTestGroup == null) - { - currentTestGroup = FindInnerTestGroup(TestComponent.NullTestComponent); - } - } - - private void AddTestToList(ITestComponent test) - { - var group = test.GetTestGroup(); - if (!testCollection.ContainsKey(group)) - testCollection.Add(group, new HashSet()); - testCollection[group].Add(test); - if (group == TestComponent.NullTestComponent) return; - AddTestToList(group); - } - - public ITestComponent GetNextTest() - { - var test = testCollection[currentTestGroup].First(); - testCollection[currentTestGroup].Remove(test); - test.EnableTest(true); - return test; - } - - public void FinishTest(ITestComponent test) - { - try - { - test.EnableTest(false); - currentTestGroup = FindNextTestGroup(currentTestGroup); - } - catch (MissingReferenceException e) - { - Debug.LogException(e); - } - } - - private ITestComponent FindNextTestGroup(ITestComponent testGroup) - { - if (testGroup == null) - throw new Exception ("No test left"); - - if (testCollection[testGroup].Any()) - { - testGroup.EnableTest(true); - return FindInnerTestGroup(testGroup); - } - testCollection.Remove(testGroup); - testGroup.EnableTest(false); - - var parentTestGroup = testGroup.GetTestGroup(); - if (parentTestGroup == null) return null; - - testCollection[parentTestGroup].Remove(testGroup); - return FindNextTestGroup(parentTestGroup); - } - - private ITestComponent FindInnerTestGroup(ITestComponent group) - { - var innerGroups = testCollection[group]; - foreach (var innerGroup in innerGroups) - { - if (!innerGroup.IsTestGroup()) continue; - innerGroup.EnableTest(true); - return FindInnerTestGroup(innerGroup); - } - return group; - } - - public bool AnyTestsLeft() - { - return testCollection.Count != 0; - } - - public List GetRemainingTests() - { - var remainingTests = new List(); - foreach (var test in testCollection) - { - remainingTests.AddRange(test.Value); - } - return remainingTests; - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTestsProvider.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTestsProvider.cs.meta deleted file mode 100644 index d444629..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/IntegrationTestsProvider.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 21d32637b19ee51489062a66ad922193 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/NetworkResultSender.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/NetworkResultSender.cs deleted file mode 100644 index 16145c0..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/NetworkResultSender.cs +++ /dev/null @@ -1,112 +0,0 @@ -#if !UNITY_METRO && (UNITY_PRO_LICENSE || !(UNITY_ANDROID || UNITY_IPHONE)) -#define UTT_SOCKETS_SUPPORTED -#endif -using System; -using System.Collections.Generic; -using UnityEngine; -using UnityTest.IntegrationTestRunner; - -#if UTT_SOCKETS_SUPPORTED -using System.Net.Sockets; -using System.Runtime.Serialization.Formatters.Binary; -#endif - -namespace UnityTest -{ - public class NetworkResultSender : ITestRunnerCallback - { -#if UTT_SOCKETS_SUPPORTED - private readonly TimeSpan m_ConnectionTimeout = TimeSpan.FromSeconds(5); - - private readonly string m_Ip; - private readonly int m_Port; -#endif - private bool m_LostConnection; - - public NetworkResultSender(string ip, int port) - { -#if UTT_SOCKETS_SUPPORTED - m_Ip = ip; - m_Port = port; -#endif - } - - private bool SendDTO(ResultDTO dto) - { - if (m_LostConnection) return false; -#if UTT_SOCKETS_SUPPORTED - try - { - using (var tcpClient = new TcpClient()) - { - var result = tcpClient.BeginConnect(m_Ip, m_Port, null, null); - var success = result.AsyncWaitHandle.WaitOne(m_ConnectionTimeout); - if (!success) - { - return false; - } - try - { - tcpClient.EndConnect(result); - } - catch (SocketException) - { - m_LostConnection = true; - return false; - } - - var bf = new DTOFormatter(); - bf.Serialize(tcpClient.GetStream(), dto); - tcpClient.GetStream().Close(); - tcpClient.Close(); - Debug.Log("Sent " + dto.messageType); - } - } - catch (SocketException e) - { - Debug.LogException(e); - m_LostConnection = true; - return false; - } -#endif // if UTT_SOCKETS_SUPPORTED - return true; - } - - public bool Ping() - { - var result = SendDTO(ResultDTO.CreatePing()); - m_LostConnection = false; - return result; - } - - public void RunStarted(string platform, List testsToRun) - { - SendDTO(ResultDTO.CreateRunStarted()); - } - - public void RunFinished(List testResults) - { - SendDTO(ResultDTO.CreateRunFinished(testResults)); - } - - public void TestStarted(TestResult test) - { - SendDTO(ResultDTO.CreateTestStarted(test)); - } - - public void TestFinished(TestResult test) - { - SendDTO(ResultDTO.CreateTestFinished(test)); - } - - public void AllScenesFinished() - { - SendDTO (ResultDTO.CreateAllScenesFinished ()); - } - - public void TestRunInterrupted(List testsNotRun) - { - RunFinished(new List()); - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/NetworkResultSender.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/NetworkResultSender.cs.meta deleted file mode 100644 index 2ed06e1..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/NetworkResultSender.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 80b91644bbbc487479429368d4e8d596 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ResultDTO.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ResultDTO.cs deleted file mode 100644 index e8a8e4e..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ResultDTO.cs +++ /dev/null @@ -1,168 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.SceneManagement; - -namespace UnityTest -{ - [Serializable] - public class ResultDTO - { - public MessageType messageType; - public int levelCount; - public int loadedLevel; - public string loadedLevelName; - public string testName; - public float testTimeout; - public ITestResult testResult; - - private ResultDTO(MessageType messageType) - { - this.messageType = messageType; - levelCount = UnityEngine.SceneManagement.SceneManager.sceneCount; - loadedLevel = UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex; - loadedLevelName = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name; - } - - public enum MessageType : byte - { - Ping, - RunStarted, - RunFinished, - TestStarted, - TestFinished, - RunInterrupted, - AllScenesFinished - } - - public static ResultDTO CreatePing() - { - var dto = new ResultDTO(MessageType.Ping); - return dto; - } - - public static ResultDTO CreateRunStarted() - { - var dto = new ResultDTO(MessageType.RunStarted); - return dto; - } - - public static ResultDTO CreateRunFinished(List testResults) - { - var dto = new ResultDTO(MessageType.RunFinished); - return dto; - } - - public static ResultDTO CreateTestStarted(TestResult test) - { - var dto = new ResultDTO(MessageType.TestStarted); - dto.testName = test.FullName; - dto.testTimeout = test.TestComponent.timeout; - return dto; - } - - public static ResultDTO CreateTestFinished(TestResult test) - { - var dto = new ResultDTO(MessageType.TestFinished); - dto.testName = test.FullName; - dto.testResult = GetSerializableTestResult(test); - return dto; - } - - public static ResultDTO CreateAllScenesFinished() - { - var dto = new ResultDTO(MessageType.AllScenesFinished); - return dto; - } - - private static ITestResult GetSerializableTestResult(TestResult test) - { - var str = new SerializableTestResult(); - - str.resultState = test.ResultState; - str.message = test.messages; - str.executed = test.Executed; - str.name = test.Name; - str.fullName = test.FullName; - str.id = test.id; - str.isSuccess = test.IsSuccess; - str.duration = test.duration; - str.stackTrace = test.stacktrace; - str.isIgnored = test.IsIgnored; - - return str; - } - } - - #region SerializableTestResult - [Serializable] - internal class SerializableTestResult : ITestResult - { - public TestResultState resultState; - public string message; - public bool executed; - public string name; - public string fullName; - public string id; - public bool isSuccess; - public double duration; - public string stackTrace; - public bool isIgnored; - - public TestResultState ResultState - { - get { return resultState; } - } - - public string Message - { - get { return message; } - } - - public string Logs - { - get { return null; } - } - - public bool Executed - { - get { return executed; } - } - - public string Name - { - get { return name; } - } - - public string FullName - { - get { return fullName; } - } - - public string Id - { - get { return id; } - } - - public bool IsSuccess - { - get { return isSuccess; } - } - - public double Duration - { - get { return duration; } - } - - public string StackTrace - { - get { return stackTrace; } - } - - public bool IsIgnored - { - get { return isIgnored; } - } - } - #endregion -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ResultDTO.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ResultDTO.cs.meta deleted file mode 100644 index e34e61f..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ResultDTO.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 37c772b6d1ba4274aa96c83710cb27e8 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestComponent.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestComponent.cs deleted file mode 100644 index d8d9164..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestComponent.cs +++ /dev/null @@ -1,412 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using UnityEngine; -using UnityEngine.SceneManagement; - -#if UNITY_EDITOR -using UnityEditor; -#endif - -namespace UnityTest -{ - public interface ITestComponent : IComparable - { - void EnableTest(bool enable); - bool IsTestGroup(); - GameObject gameObject { get; } - string Name { get; } - ITestComponent GetTestGroup(); - bool IsExceptionExpected(string exceptionType); - bool ShouldSucceedOnException(); - double GetTimeout(); - bool IsIgnored(); - bool ShouldSucceedOnAssertions(); - bool IsExludedOnThisPlatform(); - } - - public class TestComponent : MonoBehaviour, ITestComponent - { - public static ITestComponent NullTestComponent = new NullTestComponentImpl(); - - public float timeout = 5; - public bool ignored = false; - public bool succeedAfterAllAssertionsAreExecuted = false; - public bool expectException = false; - public string expectedExceptionList = ""; - public bool succeedWhenExceptionIsThrown = false; - public IncludedPlatforms includedPlatforms = (IncludedPlatforms) ~0L; - public string[] platformsToIgnore = null; - - public bool dynamic; - public string dynamicTypeName; - - public bool IsExludedOnThisPlatform() - { - return platformsToIgnore != null && platformsToIgnore.Any(platform => platform == Application.platform.ToString()); - } - - static bool IsAssignableFrom(Type a, Type b) - { -#if !UNITY_METRO - return a.IsAssignableFrom(b); -#else - return false; -#endif - } - - public bool IsExceptionExpected(string exception) - { - exception = exception.Trim(); - if (!expectException) - return false; - if(string.IsNullOrEmpty(expectedExceptionList.Trim())) - return true; - foreach (var expectedException in expectedExceptionList.Split(',').Select(e => e.Trim())) - { - if (exception == expectedException) - return true; - var exceptionType = Type.GetType(exception) ?? GetTypeByName(exception); - var expectedExceptionType = Type.GetType(expectedException) ?? GetTypeByName(expectedException); - if (exceptionType != null && expectedExceptionType != null && IsAssignableFrom(expectedExceptionType, exceptionType)) - return true; - } - return false; - } - - public bool ShouldSucceedOnException() - { - return succeedWhenExceptionIsThrown; - } - - public double GetTimeout() - { - return timeout; - } - - public bool IsIgnored() - { - return ignored; - } - - public bool ShouldSucceedOnAssertions() - { - return succeedAfterAllAssertionsAreExecuted; - } - - private static Type GetTypeByName(string className) - { -#if !UNITY_METRO - return AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes()).FirstOrDefault(type => type.Name == className); -#else - return null; -#endif - } - - public void OnValidate() - { - if (timeout < 0.01f) timeout = 0.01f; - } - - // Legacy - [Flags] - public enum IncludedPlatforms - { - WindowsEditor = 1 << 0, - OSXEditor = 1 << 1, - WindowsPlayer = 1 << 2, - OSXPlayer = 1 << 3, - LinuxPlayer = 1 << 4, - MetroPlayerX86 = 1 << 5, - MetroPlayerX64 = 1 << 6, - MetroPlayerARM = 1 << 7, - WindowsWebPlayer = 1 << 8, - OSXWebPlayer = 1 << 9, - Android = 1 << 10, -// ReSharper disable once InconsistentNaming - IPhonePlayer = 1 << 11, - TizenPlayer = 1 << 12, - WP8Player = 1 << 13, - BB10Player = 1 << 14, - NaCl = 1 << 15, - PS3 = 1 << 16, - XBOX360 = 1 << 17, - WiiPlayer = 1 << 18, - PSP2 = 1 << 19, - PS4 = 1 << 20, - PSMPlayer = 1 << 21, - XboxOne = 1 << 22, - } - - #region ITestComponent implementation - - public void EnableTest(bool enable) - { - if (enable && dynamic) - { - Type t = Type.GetType(dynamicTypeName); - var s = gameObject.GetComponent(t) as MonoBehaviour; - if (s != null) - DestroyImmediate(s); - - gameObject.AddComponent(t); - } - - if (gameObject.activeSelf != enable) gameObject.SetActive(enable); - } - - public int CompareTo(ITestComponent obj) - { - if (obj == NullTestComponent) - return 1; - var result = gameObject.name.CompareTo(obj.gameObject.name); - if (result == 0) - result = gameObject.GetInstanceID().CompareTo(obj.gameObject.GetInstanceID()); - return result; - } - - public bool IsTestGroup() - { - for (int i = 0; i < gameObject.transform.childCount; i++) - { - var childTc = gameObject.transform.GetChild(i).GetComponent(typeof(TestComponent)); - if (childTc != null) - return true; - } - return false; - } - - public string Name { get { return gameObject == null ? "" : gameObject.name; } } - - public ITestComponent GetTestGroup() - { - var parent = gameObject.transform.parent; - if (parent == null) - return NullTestComponent; - return parent.GetComponent(); - } - - public override bool Equals(object o) - { - if (o is TestComponent) - return this == (o as TestComponent); - return false; - } - - public override int GetHashCode() - { - return base.GetHashCode(); - } - - public static bool operator ==(TestComponent a, TestComponent b) - { - if (ReferenceEquals(a, b)) - return true; - if (((object)a == null) || ((object)b == null)) - return false; - if (a.dynamic && b.dynamic) - return a.dynamicTypeName == b.dynamicTypeName; - if (a.dynamic || b.dynamic) - return false; - return a.gameObject == b.gameObject; - } - - public static bool operator !=(TestComponent a, TestComponent b) - { - return !(a == b); - } - - #endregion - - #region Static helpers - - public static TestComponent CreateDynamicTest(Type type) - { - var go = CreateTest(type.Name); - go.hideFlags |= HideFlags.DontSave; - go.SetActive(false); - - var tc = go.GetComponent(); - tc.dynamic = true; - tc.dynamicTypeName = type.AssemblyQualifiedName; - -#if !UNITY_METRO - foreach (var typeAttribute in type.GetCustomAttributes(false)) - { - if (typeAttribute is IntegrationTest.TimeoutAttribute) - tc.timeout = (typeAttribute as IntegrationTest.TimeoutAttribute).timeout; - else if (typeAttribute is IntegrationTest.IgnoreAttribute) - tc.ignored = true; - else if (typeAttribute is IntegrationTest.SucceedWithAssertions) - tc.succeedAfterAllAssertionsAreExecuted = true; - else if (typeAttribute is IntegrationTest.ExcludePlatformAttribute) - tc.platformsToIgnore = (typeAttribute as IntegrationTest.ExcludePlatformAttribute).platformsToExclude; - else if (typeAttribute is IntegrationTest.ExpectExceptions) - { - var attribute = (typeAttribute as IntegrationTest.ExpectExceptions); - tc.expectException = true; - tc.expectedExceptionList = string.Join(",", attribute.exceptionTypeNames); - tc.succeedWhenExceptionIsThrown = attribute.succeedOnException; - } - } - go.AddComponent(type); -#endif // if !UNITY_METRO - return tc; - } - - public static GameObject CreateTest() - { - return CreateTest("New Test"); - } - - private static GameObject CreateTest(string name) - { - var go = new GameObject(name); - go.AddComponent(); -#if UNITY_EDITOR - Undo.RegisterCreatedObjectUndo(go, "Created test"); -#endif - return go; - } - - public static List FindAllTestsOnScene() - { - var tests = Resources.FindObjectsOfTypeAll (typeof(TestComponent)).Cast (); -#if UNITY_EDITOR - tests = tests.Where( t => {var p = PrefabUtility.GetPrefabType(t); return p != PrefabType.Prefab && p != PrefabType.ModelPrefab;} ); - -#endif - return tests.ToList (); - } - - public static List FindAllTopTestsOnScene() - { - return FindAllTestsOnScene().Where(component => component.gameObject.transform.parent == null).ToList(); - } - - public static List FindAllDynamicTestsOnScene() - { - return FindAllTestsOnScene().Where(t => t.dynamic).ToList(); - } - - public static void DestroyAllDynamicTests() - { - foreach (var dynamicTestComponent in FindAllDynamicTestsOnScene()) - DestroyImmediate(dynamicTestComponent.gameObject); - } - - public static void DisableAllTests() - { - foreach (var t in FindAllTestsOnScene()) t.EnableTest(false); - } - - public static bool AnyTestsOnScene() - { - return FindAllTestsOnScene().Any(); - } - - public static bool AnyDynamicTestForCurrentScene() - { -#if UNITY_EDITOR - return TestComponent.GetTypesWithHelpAttribute(SceneManager.GetActiveScene().name).Any(); -#else - return TestComponent.GetTypesWithHelpAttribute(SceneManager.GetActiveScene().name).Any(); -#endif - } - - #endregion - - private sealed class NullTestComponentImpl : ITestComponent - { - public int CompareTo(ITestComponent other) - { - if (other == this) return 0; - return -1; - } - - public void EnableTest(bool enable) - { - } - - public bool IsTestGroup() - { - throw new NotImplementedException(); - } - - public GameObject gameObject { get; private set; } - public string Name { get { return ""; } } - - public ITestComponent GetTestGroup() - { - return null; - } - - public bool IsExceptionExpected(string exceptionType) - { - throw new NotImplementedException(); - } - - public bool ShouldSucceedOnException() - { - throw new NotImplementedException(); - } - - public double GetTimeout() - { - throw new NotImplementedException(); - } - - public bool IsIgnored() - { - throw new NotImplementedException(); - } - - public bool ShouldSucceedOnAssertions() - { - throw new NotImplementedException(); - } - - public bool IsExludedOnThisPlatform() - { - throw new NotImplementedException(); - } - } - - public static IEnumerable GetTypesWithHelpAttribute(string sceneName) - { -#if !UNITY_METRO - foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) - { - Type[] types = null; - - try - { - types = assembly.GetTypes(); - } - catch (ReflectionTypeLoadException ex) - { - Debug.LogError("Failed to load types from: " + assembly.FullName); - foreach (Exception loadEx in ex.LoaderExceptions) - Debug.LogException(loadEx); - } - - if (types == null) - continue; - - foreach (Type type in types) - { - var attributes = type.GetCustomAttributes(typeof(IntegrationTest.DynamicTestAttribute), true); - if (attributes.Length == 1) - { - var a = attributes.Single() as IntegrationTest.DynamicTestAttribute; - if (a.IncludeOnScene(sceneName)) yield return type; - } - } - } -#else // if !UNITY_METRO - yield break; -#endif // if !UNITY_METRO - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestComponent.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestComponent.cs.meta deleted file mode 100644 index fd67c93..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestComponent.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b1dba0b27b0864740a8720e920aa88c0 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestResult.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestResult.cs deleted file mode 100644 index df67f71..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestResult.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - [Serializable] - public class TestResult : ITestResult, IComparable - { - private readonly GameObject m_Go; - private string m_Name; - public ResultType resultType = ResultType.NotRun; - public double duration; - public string messages; - public string stacktrace; - public string id; - public bool dynamicTest; - - public TestComponent TestComponent; - - public GameObject GameObject - { - get { return m_Go; } - } - - public TestResult(TestComponent testComponent) - { - TestComponent = testComponent; - m_Go = testComponent.gameObject; - id = testComponent.gameObject.GetInstanceID().ToString(); - dynamicTest = testComponent.dynamic; - - if (m_Go != null) m_Name = m_Go.name; - - if (dynamicTest) - id = testComponent.dynamicTypeName; - } - - public void Update(TestResult oldResult) - { - resultType = oldResult.resultType; - duration = oldResult.duration; - messages = oldResult.messages; - stacktrace = oldResult.stacktrace; - } - - public enum ResultType - { - Success, - Failed, - Timeout, - NotRun, - FailedException, - Ignored - } - - public void Reset() - { - resultType = ResultType.NotRun; - duration = 0f; - messages = ""; - stacktrace = ""; - } - - #region ITestResult implementation - public TestResultState ResultState { - get - { - switch (resultType) - { - case ResultType.Success: return TestResultState.Success; - case ResultType.Failed: return TestResultState.Failure; - case ResultType.FailedException: return TestResultState.Error; - case ResultType.Ignored: return TestResultState.Ignored; - case ResultType.NotRun: return TestResultState.Skipped; - case ResultType.Timeout: return TestResultState.Cancelled; - default: throw new Exception(); - } - } - } - public string Message { get { return messages; } } - public string Logs { get { return null; } } - public bool Executed { get { return resultType != ResultType.NotRun; } } - public string Name { get { if (m_Go != null) m_Name = m_Go.name; return m_Name; } } - public string Id { get { return id; } } - public bool IsSuccess { get { return resultType == ResultType.Success; } } - public bool IsTimeout { get { return resultType == ResultType.Timeout; } } - public double Duration { get { return duration; } } - public string StackTrace { get { return stacktrace; } } - public string FullName { - get - { - var fullName = Name; - if (m_Go != null) - { - var tempGo = m_Go.transform.parent; - while (tempGo != null) - { - fullName = tempGo.name + "." + fullName; - tempGo = tempGo.transform.parent; - } - } - return fullName; - } - } - - public bool IsIgnored { get { return resultType == ResultType.Ignored; } } - public bool IsFailure - { - get - { - return resultType == ResultType.Failed - || resultType == ResultType.FailedException - || resultType == ResultType.Timeout; - } - } - #endregion - - #region IComparable, GetHashCode and Equals implementation - public override int GetHashCode() - { - return id.GetHashCode(); - } - - public int CompareTo(TestResult other) - { - var result = Name.CompareTo(other.Name); - if (result == 0) - result = m_Go.GetInstanceID().CompareTo(other.m_Go.GetInstanceID()); - return result; - } - - public override bool Equals(object obj) - { - if (obj is TestResult) - return GetHashCode() == obj.GetHashCode(); - return base.Equals(obj); - } - #endregion - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestResult.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestResult.cs.meta deleted file mode 100644 index c604bea..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestResult.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 68740a702763aaa4594e8319a05ae0d3 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestResultRenderer.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestResultRenderer.cs deleted file mode 100644 index e838d7e..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestResultRenderer.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -public class TestResultRenderer -{ - private static class Styles - { - public static readonly GUIStyle SucceedLabelStyle; - public static readonly GUIStyle FailedLabelStyle; - public static readonly GUIStyle FailedMessagesStyle; - - static Styles() - { - SucceedLabelStyle = new GUIStyle("label"); - SucceedLabelStyle.normal.textColor = Color.green; - SucceedLabelStyle.fontSize = 48; - - FailedLabelStyle = new GUIStyle("label"); - FailedLabelStyle.normal.textColor = Color.red; - FailedLabelStyle.fontSize = 32; - - FailedMessagesStyle = new GUIStyle("label"); - FailedMessagesStyle.wordWrap = false; - FailedMessagesStyle.richText = true; - } - } - private readonly Dictionary> m_TestCollection = new Dictionary>(); - - private bool m_ShowResults; - Vector2 m_ScrollPosition; - private int m_FailureCount; - - public void ShowResults() - { - m_ShowResults = true; - Cursor.visible = true; - } - - public void AddResults(string sceneName, ITestResult result) - { - if (!m_TestCollection.ContainsKey(sceneName)) - m_TestCollection.Add(sceneName, new List()); - m_TestCollection[sceneName].Add(result); - if (result.Executed && !result.IsSuccess) - m_FailureCount++; - } - - public void Draw() - { - if (!m_ShowResults) return; - if (m_TestCollection.Count == 0) - { - GUILayout.Label("All test succeeded", Styles.SucceedLabelStyle, GUILayout.Width(600)); - } - else - { - int count = m_TestCollection.Sum (testGroup => testGroup.Value.Count); - GUILayout.Label(count + " tests failed!", Styles.FailedLabelStyle); - - m_ScrollPosition = GUILayout.BeginScrollView(m_ScrollPosition, GUILayout.ExpandWidth(true)); - var text = ""; - foreach (var testGroup in m_TestCollection) - { - text += "" + testGroup.Key + "\n"; - text += string.Join("\n", testGroup.Value - .Where(result => !result.IsSuccess) - .Select(result => result.Name + " " + result.ResultState + "\n" + result.Message) - .ToArray()); - } - GUILayout.TextArea(text, Styles.FailedMessagesStyle); - GUILayout.EndScrollView(); - } - if (GUILayout.Button("Close")) - Application.Quit(); - } - - public int FailureCount() - { - return m_FailureCount; - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestResultRenderer.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestResultRenderer.cs.meta deleted file mode 100644 index 7d70150..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestResultRenderer.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7ae9d3b4b57cae343b7ff360f9deb628 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunner.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunner.cs deleted file mode 100644 index 9c64a2f..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunner.cs +++ /dev/null @@ -1,432 +0,0 @@ -// #define IMITATE_BATCH_MODE //uncomment if you want to imitate batch mode behaviour in non-batch mode mode run - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using UnityEngine; -using UnityTest.IntegrationTestRunner; -using System.IO; -using UnityEngine.SceneManagement; - -namespace UnityTest -{ - [Serializable] - public class TestRunner : MonoBehaviour - { - static private int TestSceneNumber = 0; - static private readonly TestResultRenderer k_ResultRenderer = new TestResultRenderer(); - - public TestComponent currentTest; - private List m_ResultList = new List(); - private List m_TestComponents; - - public bool isInitializedByRunner - { - get - { -#if !IMITATE_BATCH_MODE - if (Application.isEditor && !IsBatchMode()) - return true; -#endif - return false; - } - } - - private double m_StartTime; - private bool m_ReadyToRun; - - private string m_TestMessages; - private string m_Stacktrace; - private TestState m_TestState = TestState.Running; - - private TestRunnerConfigurator m_Configurator; - - public TestRunnerCallbackList TestRunnerCallback = new TestRunnerCallbackList(); - private IntegrationTestsProvider m_TestsProvider; - - private const string k_Prefix = "IntegrationTest"; - private const string k_StartedMessage = k_Prefix + " Started"; - private const string k_FinishedMessage = k_Prefix + " Finished"; - private const string k_TimeoutMessage = k_Prefix + " Timeout"; - private const string k_FailedMessage = k_Prefix + " Failed"; - private const string k_FailedExceptionMessage = k_Prefix + " Failed with exception"; - private const string k_IgnoredMessage = k_Prefix + " Ignored"; - private const string k_InterruptedMessage = k_Prefix + " Run interrupted"; - - - public void Awake() - { - m_Configurator = new TestRunnerConfigurator(); - if (isInitializedByRunner) return; - TestComponent.DisableAllTests(); - } - - public void Start() - { - if (isInitializedByRunner) return; - - if (m_Configurator.sendResultsOverNetwork) - { - var nrs = m_Configurator.ResolveNetworkConnection(); - if (nrs != null) - TestRunnerCallback.Add(nrs); - } - - TestComponent.DestroyAllDynamicTests(); - var dynamicTestTypes = TestComponent.GetTypesWithHelpAttribute(SceneManager.GetActiveScene().name); - foreach (var dynamicTestType in dynamicTestTypes) - TestComponent.CreateDynamicTest(dynamicTestType); - - var tests = TestComponent.FindAllTestsOnScene(); - - InitRunner(tests, dynamicTestTypes.Select(type => type.AssemblyQualifiedName).ToList()); - } - - public void InitRunner(List tests, List dynamicTestsToRun) - { - Application.logMessageReceived += LogHandler; - - // Init dynamic tests - foreach (var typeName in dynamicTestsToRun) - { - var t = Type.GetType(typeName); - if (t == null) continue; - var scriptComponents = Resources.FindObjectsOfTypeAll(t) as MonoBehaviour[]; - if (scriptComponents.Length == 0) - { - Debug.LogWarning(t + " not found. Skipping."); - continue; - } - if (scriptComponents.Length > 1) Debug.LogWarning("Multiple GameObjects refer to " + typeName); - tests.Add(scriptComponents.First().GetComponent()); - } - // create test structure - m_TestComponents = ParseListForGroups(tests).ToList(); - // create results for tests - m_ResultList = m_TestComponents.Select(component => new TestResult(component)).ToList(); - // init test provider - m_TestsProvider = new IntegrationTestsProvider(m_ResultList.Select(result => result.TestComponent as ITestComponent)); - m_ReadyToRun = true; - } - - private static IEnumerable ParseListForGroups(IEnumerable tests) - { - var results = new HashSet(); - foreach (var testResult in tests) - { - if (testResult.IsTestGroup()) - { - var childrenTestResult = testResult.gameObject.GetComponentsInChildren(typeof(TestComponent), true) - .Where(t => t != testResult) - .Cast() - .ToArray(); - foreach (var result in childrenTestResult) - { - if (!result.IsTestGroup()) - results.Add(result); - } - continue; - } - results.Add(testResult); - } - return results; - } - - public void Update() - { - if (m_ReadyToRun && Time.frameCount > 1) - { - m_ReadyToRun = false; - StartCoroutine("StateMachine"); - } - } - - public void OnDestroy() - { - if (currentTest != null) - { - var testResult = m_ResultList.Single(result => result.TestComponent == currentTest); - testResult.messages += "Test run interrupted (crash?)"; - LogMessage(k_InterruptedMessage); - FinishTest(TestResult.ResultType.Failed); - } - if (currentTest != null || (m_TestsProvider != null && m_TestsProvider.AnyTestsLeft())) - { - var remainingTests = m_TestsProvider.GetRemainingTests(); - TestRunnerCallback.TestRunInterrupted(remainingTests.ToList()); - } - Application.logMessageReceived -= LogHandler; - } - - private void LogHandler(string condition, string stacktrace, LogType type) - { - if (!condition.StartsWith(k_StartedMessage) && !condition.StartsWith(k_FinishedMessage)) - { - var msg = condition; - if (msg.StartsWith(k_Prefix)) msg = msg.Substring(k_Prefix.Length + 1); - if (currentTest != null && msg.EndsWith("(" + currentTest.name + ')')) msg = msg.Substring(0, msg.LastIndexOf('(')); - m_TestMessages += msg + "\n"; - } - switch (type) - { - case LogType.Exception: - { - var exceptionType = condition.Substring(0, condition.IndexOf(':')); - if (currentTest != null && currentTest.IsExceptionExpected(exceptionType)) - { - m_TestMessages += exceptionType + " was expected\n"; - if (currentTest.ShouldSucceedOnException()) - { - m_TestState = TestState.Success; - } - } - else - { - m_TestState = TestState.Exception; - m_Stacktrace = stacktrace; - } - } - break; - case LogType.Assert: - case LogType.Error: - m_TestState = TestState.Failure; - m_Stacktrace = stacktrace; - break; - case LogType.Log: - if (m_TestState == TestState.Running && condition.StartsWith(IntegrationTest.passMessage)) - { - m_TestState = TestState.Success; - } - if (condition.StartsWith(IntegrationTest.failMessage)) - { - m_TestState = TestState.Failure; - } - break; - } - } - - public IEnumerator StateMachine() - { - TestRunnerCallback.RunStarted(Application.platform.ToString(), m_TestComponents); - while (true) - { - if (!m_TestsProvider.AnyTestsLeft() && currentTest == null) - { - FinishTestRun(); - yield break; - } - if (currentTest == null) - { - StartNewTest(); - } - if (currentTest != null) - { - if (m_TestState == TestState.Running) - { - if(currentTest.ShouldSucceedOnAssertions()) - { - var assertionsToCheck = currentTest.gameObject.GetComponentsInChildren().Where(a => a.enabled).ToArray(); - if (assertionsToCheck.Any () && assertionsToCheck.All(a => a.checksPerformed > 0)) - { - IntegrationTest.Pass(currentTest.gameObject); - m_TestState = TestState.Success; - } - } - if (currentTest != null && Time.time > m_StartTime + currentTest.GetTimeout()) - { - m_TestState = TestState.Timeout; - } - } - - switch (m_TestState) - { - case TestState.Success: - LogMessage(k_FinishedMessage); - FinishTest(TestResult.ResultType.Success); - break; - case TestState.Failure: - LogMessage(k_FailedMessage); - FinishTest(TestResult.ResultType.Failed); - break; - case TestState.Exception: - LogMessage(k_FailedExceptionMessage); - FinishTest(TestResult.ResultType.FailedException); - break; - case TestState.Timeout: - LogMessage(k_TimeoutMessage); - FinishTest(TestResult.ResultType.Timeout); - break; - case TestState.Ignored: - LogMessage(k_IgnoredMessage); - FinishTest(TestResult.ResultType.Ignored); - break; - } - } - yield return null; - } - } - - private void LogMessage(string message) - { - if (currentTest != null) - Debug.Log(message + " (" + currentTest.Name + ")", currentTest.gameObject); - else - Debug.Log(message); - } - - private void FinishTestRun() - { - PrintResultToLog(); - TestRunnerCallback.RunFinished(m_ResultList); - LoadNextLevelOrQuit(); - } - - private void PrintResultToLog() - { - var resultString = ""; - resultString += "Passed: " + m_ResultList.Count(t => t.IsSuccess); - if (m_ResultList.Any(result => result.IsFailure)) - { - resultString += " Failed: " + m_ResultList.Count(t => t.IsFailure); - Debug.Log("Failed tests: " + string.Join(", ", m_ResultList.Where(t => t.IsFailure).Select(result => result.Name).ToArray())); - } - if (m_ResultList.Any(result => result.IsIgnored)) - { - resultString += " Ignored: " + m_ResultList.Count(t => t.IsIgnored); - Debug.Log("Ignored tests: " + string.Join(", ", - m_ResultList.Where(t => t.IsIgnored).Select(result => result.Name).ToArray())); - } - Debug.Log(resultString); - } - - private void LoadNextLevelOrQuit() - { - if (isInitializedByRunner) return; - - - TestSceneNumber += 1; - string testScene = m_Configurator.GetIntegrationTestScenes(TestSceneNumber); - - if (testScene != null) - SceneManager.LoadScene(Path.GetFileNameWithoutExtension(testScene)); - else - { - TestRunnerCallback.AllScenesFinished(); - k_ResultRenderer.ShowResults(); - -#if UNITY_EDITOR - var prevScenes = m_Configurator.GetPreviousScenesToRestore(); - if(prevScenes!=null) - { - UnityEditor.EditorBuildSettings.scenes = prevScenes; - } -#endif - - if (m_Configurator.isBatchRun && m_Configurator.sendResultsOverNetwork) - Application.Quit(); - } - } - - public void OnGUI() - { - k_ResultRenderer.Draw(); - } - - private void StartNewTest() - { - m_TestMessages = ""; - m_Stacktrace = ""; - m_TestState = TestState.Running; - - m_StartTime = Time.time; - currentTest = m_TestsProvider.GetNextTest() as TestComponent; - - var testResult = m_ResultList.Single(result => result.TestComponent == currentTest); - - if (currentTest != null && currentTest.IsExludedOnThisPlatform()) - { - m_TestState = TestState.Ignored; - Debug.Log(currentTest.gameObject.name + " is excluded on this platform"); - } - - // don't ignore test if user initiated it from the runner and it's the only test that is being run - if (currentTest != null - && (currentTest.IsIgnored() - && !(isInitializedByRunner && m_ResultList.Count == 1))) - m_TestState = TestState.Ignored; - - LogMessage(k_StartedMessage); - TestRunnerCallback.TestStarted(testResult); - } - - private void FinishTest(TestResult.ResultType result) - { - m_TestsProvider.FinishTest(currentTest); - var testResult = m_ResultList.Single(t => t.GameObject == currentTest.gameObject); - testResult.resultType = result; - testResult.duration = Time.time - m_StartTime; - testResult.messages = m_TestMessages; - testResult.stacktrace = m_Stacktrace; - TestRunnerCallback.TestFinished(testResult); - currentTest = null; - if (!testResult.IsSuccess - && testResult.Executed - && !testResult.IsIgnored) k_ResultRenderer.AddResults(SceneManager.GetActiveScene().name, testResult); - } - - #region Test Runner Helpers - - public static TestRunner GetTestRunner() - { - TestRunner testRunnerComponent = null; - var testRunnerComponents = Resources.FindObjectsOfTypeAll(typeof(TestRunner)); - - if (testRunnerComponents.Count() > 1) - foreach (var t in testRunnerComponents) DestroyImmediate(((TestRunner)t).gameObject); - else if (!testRunnerComponents.Any()) - testRunnerComponent = Create().GetComponent(); - else - testRunnerComponent = testRunnerComponents.Single() as TestRunner; - - return testRunnerComponent; - } - - private static GameObject Create() - { - var runner = new GameObject("TestRunner"); - runner.AddComponent(); - Debug.Log("Created Test Runner"); - return runner; - } - - private static bool IsBatchMode() - { -#if !UNITY_METRO - const string internalEditorUtilityClassName = "UnityEditorInternal.InternalEditorUtility, UnityEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"; - - var t = Type.GetType(internalEditorUtilityClassName, false); - if (t == null) return false; - - const string inBatchModeProperty = "inBatchMode"; - var prop = t.GetProperty(inBatchModeProperty); - return (bool)prop.GetValue(null, null); -#else // if !UNITY_METRO - return false; -#endif // if !UNITY_METRO - } - - #endregion - - enum TestState - { - Running, - Success, - Failure, - Exception, - Timeout, - Ignored - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunner.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunner.cs.meta deleted file mode 100644 index 5ef068e..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunner.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5c3afc1c624179749bcdecf7b0224902 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunnerCallbackList.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunnerCallbackList.cs deleted file mode 100644 index 91830d2..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunnerCallbackList.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest.IntegrationTestRunner -{ - public class TestRunnerCallbackList : ITestRunnerCallback - { - private readonly List m_CallbackList = new List(); - - public void Add(ITestRunnerCallback callback) - { - m_CallbackList.Add(callback); - } - - public void Remove(ITestRunnerCallback callback) - { - m_CallbackList.Remove(callback); - } - - public void RunStarted(string platform, List testsToRun) - { - foreach (var unitTestRunnerCallback in m_CallbackList) - { - unitTestRunnerCallback.RunStarted(platform, testsToRun); - } - } - - public void RunFinished(List testResults) - { - foreach (var unitTestRunnerCallback in m_CallbackList) - { - unitTestRunnerCallback.RunFinished(testResults); - } - } - - public void AllScenesFinished() - { - foreach (var unitTestRunnerCallback in m_CallbackList) - { - unitTestRunnerCallback.AllScenesFinished(); - } - } - - public void TestStarted(TestResult test) - { - foreach (var unitTestRunnerCallback in m_CallbackList) - { - unitTestRunnerCallback.TestStarted(test); - } - } - - public void TestFinished(TestResult test) - { - foreach (var unitTestRunnerCallback in m_CallbackList) - { - unitTestRunnerCallback.TestFinished(test); - } - } - - public void TestRunInterrupted(List testsNotRun) - { - foreach (var unitTestRunnerCallback in m_CallbackList) - { - unitTestRunnerCallback.TestRunInterrupted(testsNotRun); - } - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunnerCallbackList.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunnerCallbackList.cs.meta deleted file mode 100644 index c39656a..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunnerCallbackList.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7729da83f7c08d244b5788c870a93780 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunnerConfigurator.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunnerConfigurator.cs deleted file mode 100644 index 8e7f322..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunnerConfigurator.cs +++ /dev/null @@ -1,227 +0,0 @@ -#if !UNITY_METRO && !UNITY_WEBPLAYER && (UNITY_PRO_LICENSE || !(UNITY_ANDROID || UNITY_IPHONE)) -#define UTT_SOCKETS_SUPPORTED -#endif -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading; -using UnityEngine; -using UnityTest.IntegrationTestRunner; -#if UTT_SOCKETS_SUPPORTED -using System.Net; -using System.Net.Sockets; -using System.Net.NetworkInformation; -#endif - -#if UNITY_EDITOR -using UnityEditorInternal; -#endif - -namespace UnityTest -{ - public class TestRunnerConfigurator - { - public static string integrationTestsNetwork = "networkconfig.txt"; - public static string batchRunFileMarker = "batchrun.txt"; - public static string testScenesToRun = "testscenes.txt"; - public static string previousScenes = "previousScenes.txt"; - - public bool isBatchRun { get; private set; } - - public bool sendResultsOverNetwork { get; private set; } - -#if UTT_SOCKETS_SUPPORTED - private readonly List m_IPEndPointList = new List(); -#endif - - public TestRunnerConfigurator() - { - CheckForBatchMode(); - CheckForSendingResultsOverNetwork(); - } - -#if UNITY_EDITOR - public UnityEditor.EditorBuildSettingsScene[] GetPreviousScenesToRestore() - { - string text = null; - if (Application.isEditor) - { - text = GetTextFromTempFile(previousScenes); - } - - if(text != null) - { - var serializer = new System.Xml.Serialization.XmlSerializer(typeof(UnityEditor.EditorBuildSettingsScene[])); - using(var textReader = new StringReader(text)) - { - try - { - return (UnityEditor.EditorBuildSettingsScene[] )serializer.Deserialize(textReader); - } - catch (System.Xml.XmlException e) - { - return null; - } - } - } - - return null; - } -#endif - - public string GetIntegrationTestScenes(int testSceneNum) - { - string text; - if (Application.isEditor) - text = GetTextFromTempFile(testScenesToRun); - else - text = GetTextFromTextAsset(testScenesToRun); - - List sceneList = new List(); - foreach (var line in text.Split(new[] {'\n'}, StringSplitOptions.RemoveEmptyEntries)) - { - sceneList.Add(line.ToString()); - } - - if (testSceneNum < sceneList.Count) - return sceneList.ElementAt(testSceneNum); - else - return null; - } - - private void CheckForSendingResultsOverNetwork() - { -#if UTT_SOCKETS_SUPPORTED - string text; - if (Application.isEditor) - text = GetTextFromTempFile(integrationTestsNetwork); - else - text = GetTextFromTextAsset(integrationTestsNetwork); - - if (text == null) return; - - sendResultsOverNetwork = true; - - m_IPEndPointList.Clear(); - - foreach (var line in text.Split(new[] {'\n'}, StringSplitOptions.RemoveEmptyEntries)) - { - var idx = line.IndexOf(':'); - if (idx == -1) throw new Exception(line); - var ip = line.Substring(0, idx); - var port = line.Substring(idx + 1); - m_IPEndPointList.Add(new IPEndPoint(IPAddress.Parse(ip), Int32.Parse(port))); - } -#endif // if UTT_SOCKETS_SUPPORTED - } - - private static string GetTextFromTextAsset(string fileName) - { - var nameWithoutExtension = fileName.Substring(0, fileName.LastIndexOf('.')); - var resultpathFile = Resources.Load(nameWithoutExtension) as TextAsset; - return resultpathFile != null ? resultpathFile.text : null; - } - - private static string GetTextFromTempFile(string fileName) - { - string text = null; - try - { -#if UNITY_EDITOR && !UNITY_WEBPLAYER - text = File.ReadAllText(Path.Combine("Temp", fileName)); -#endif - } - catch - { - return null; - } - return text; - } - - private void CheckForBatchMode() - { -#if IMITATE_BATCH_MODE - isBatchRun = true; -#elif UNITY_EDITOR - if (Application.isEditor && InternalEditorUtility.inBatchMode) - isBatchRun = true; -#else - if (GetTextFromTextAsset(batchRunFileMarker) != null) isBatchRun = true; -#endif - } - - public static List GetAvailableNetworkIPs() - { -#if UTT_SOCKETS_SUPPORTED - if (!NetworkInterface.GetIsNetworkAvailable()) - return new List{IPAddress.Loopback.ToString()}; - - var ipList = new List(); - var allIpsList = new List(); - - foreach (var netInterface in NetworkInterface.GetAllNetworkInterfaces()) - { - if (netInterface.NetworkInterfaceType != NetworkInterfaceType.Wireless80211 && - netInterface.NetworkInterfaceType != NetworkInterfaceType.Ethernet) - continue; - - var ipAdresses = netInterface.GetIPProperties().UnicastAddresses - .Where(a => a.Address.AddressFamily == AddressFamily.InterNetwork); - allIpsList.AddRange(ipAdresses); - - if (netInterface.OperationalStatus != OperationalStatus.Up) continue; - - ipList.AddRange(ipAdresses); - } - - //On Mac 10.10 all interfaces return OperationalStatus.Unknown, thus this workaround - if(!ipList.Any()) return allIpsList.Select(i => i.Address.ToString()).ToList(); - - // sort ip list by their masks to predict which ip belongs to lan network - ipList.Sort((ip1, ip2) => - { - var mask1 = BitConverter.ToInt32(ip1.IPv4Mask.GetAddressBytes().Reverse().ToArray(), 0); - var mask2 = BitConverter.ToInt32(ip2.IPv4Mask.GetAddressBytes().Reverse().ToArray(), 0); - return mask2.CompareTo(mask1); - }); - if (ipList.Count == 0) - return new List { IPAddress.Loopback.ToString() }; - return ipList.Select(i => i.Address.ToString()).ToList(); -#else - return new List(); -#endif // if UTT_SOCKETS_SUPPORTED - } - - public ITestRunnerCallback ResolveNetworkConnection() - { -#if UTT_SOCKETS_SUPPORTED - var nrsList = m_IPEndPointList.Select(ipEndPoint => new NetworkResultSender(ipEndPoint.Address.ToString(), ipEndPoint.Port)).ToList(); - - var timeout = TimeSpan.FromSeconds(30); - DateTime startTime = DateTime.Now; - while ((DateTime.Now - startTime) < timeout) - { - foreach (var networkResultSender in nrsList) - { - try - { - if (!networkResultSender.Ping()) continue; - } - catch (Exception e) - { - Debug.LogException(e); - sendResultsOverNetwork = false; - return null; - } - return networkResultSender; - } - Thread.Sleep(500); - } - Debug.LogError("Couldn't connect to the server: " + string.Join(", ", m_IPEndPointList.Select(ipep => ipep.Address + ":" + ipep.Port).ToArray())); - sendResultsOverNetwork = false; -#endif // if UTT_SOCKETS_SUPPORTED - return null; - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunnerConfigurator.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunnerConfigurator.cs.meta deleted file mode 100644 index 42f7263..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunnerConfigurator.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 05aae864572254e478ed2f0489cdd335 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets.meta deleted file mode 100644 index 433c295..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 1d1ccbd729921544dbd71f7e80c405b6 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CallTesting.cs b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CallTesting.cs deleted file mode 100644 index 3badc58..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CallTesting.cs +++ /dev/null @@ -1,204 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityTest -{ - public class CallTesting : MonoBehaviour - { - public enum Functions - { - CallAfterSeconds, - CallAfterFrames, - Start, - Update, - FixedUpdate, - LateUpdate, - OnDestroy, - OnEnable, - OnDisable, - OnControllerColliderHit, - OnParticleCollision, - OnJointBreak, - OnBecameInvisible, - OnBecameVisible, - OnTriggerEnter, - OnTriggerExit, - OnTriggerStay, - OnCollisionEnter, - OnCollisionExit, - OnCollisionStay, - OnTriggerEnter2D, - OnTriggerExit2D, - OnTriggerStay2D, - OnCollisionEnter2D, - OnCollisionExit2D, - OnCollisionStay2D, - } - - public enum Method - { - Pass, - Fail - } - - public int afterFrames = 0; - public float afterSeconds = 0.0f; - public Functions callOnMethod = Functions.Start; - - public Method methodToCall; - private int m_StartFrame; - private float m_StartTime; - - private void TryToCallTesting(Functions invokingMethod) - { - if (invokingMethod == callOnMethod) - { - if (methodToCall == Method.Pass) - IntegrationTest.Pass(gameObject); - else - IntegrationTest.Fail(gameObject); - - afterFrames = 0; - afterSeconds = 0.0f; - m_StartTime = float.PositiveInfinity; - m_StartFrame = int.MinValue; - } - } - - public void Start() - { - m_StartTime = Time.time; - m_StartFrame = afterFrames; - TryToCallTesting(Functions.Start); - } - - public void Update() - { - TryToCallTesting(Functions.Update); - CallAfterSeconds(); - CallAfterFrames(); - } - - private void CallAfterFrames() - { - if (afterFrames > 0 && (m_StartFrame + afterFrames) <= Time.frameCount) - TryToCallTesting(Functions.CallAfterFrames); - } - - private void CallAfterSeconds() - { - if ((m_StartTime + afterSeconds) <= Time.time) - TryToCallTesting(Functions.CallAfterSeconds); - } - - public void OnDisable() - { - TryToCallTesting(Functions.OnDisable); - } - - public void OnEnable() - { - TryToCallTesting(Functions.OnEnable); - } - - public void OnDestroy() - { - TryToCallTesting(Functions.OnDestroy); - } - - public void FixedUpdate() - { - TryToCallTesting(Functions.FixedUpdate); - } - - public void LateUpdate() - { - TryToCallTesting(Functions.LateUpdate); - } - - public void OnControllerColliderHit() - { - TryToCallTesting(Functions.OnControllerColliderHit); - } - - public void OnParticleCollision() - { - TryToCallTesting(Functions.OnParticleCollision); - } - - public void OnJointBreak() - { - TryToCallTesting(Functions.OnJointBreak); - } - - public void OnBecameInvisible() - { - TryToCallTesting(Functions.OnBecameInvisible); - } - - public void OnBecameVisible() - { - TryToCallTesting(Functions.OnBecameVisible); - } - - public void OnTriggerEnter() - { - TryToCallTesting(Functions.OnTriggerEnter); - } - - public void OnTriggerExit() - { - TryToCallTesting(Functions.OnTriggerExit); - } - - public void OnTriggerStay() - { - TryToCallTesting(Functions.OnTriggerStay); - } - public void OnCollisionEnter() - { - TryToCallTesting(Functions.OnCollisionEnter); - } - - public void OnCollisionExit() - { - TryToCallTesting(Functions.OnCollisionExit); - } - - public void OnCollisionStay() - { - TryToCallTesting(Functions.OnCollisionStay); - } - - public void OnTriggerEnter2D() - { - TryToCallTesting(Functions.OnTriggerEnter2D); - } - - public void OnTriggerExit2D() - { - TryToCallTesting(Functions.OnTriggerExit2D); - } - - public void OnTriggerStay2D() - { - TryToCallTesting(Functions.OnTriggerStay2D); - } - - public void OnCollisionEnter2D() - { - TryToCallTesting(Functions.OnCollisionEnter2D); - } - - public void OnCollisionExit2D() - { - TryToCallTesting(Functions.OnCollisionExit2D); - } - - public void OnCollisionStay2D() - { - TryToCallTesting(Functions.OnCollisionStay2D); - } - } -} diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CallTesting.cs.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CallTesting.cs.meta deleted file mode 100644 index 91cbde1..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CallTesting.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0d545b1288d5fc74d8e6c961fb67ab18 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeCollisionFailure.prefab b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeCollisionFailure.prefab deleted file mode 100644 index d8faebf..0000000 Binary files a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeCollisionFailure.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeCollisionFailure.prefab.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeCollisionFailure.prefab.meta deleted file mode 100644 index 777585e..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeCollisionFailure.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: d5fc3c3488db1e74689f1fc67c33944a -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeCollisionSuccess.prefab b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeCollisionSuccess.prefab deleted file mode 100644 index 1b7e571..0000000 Binary files a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeCollisionSuccess.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeCollisionSuccess.prefab.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeCollisionSuccess.prefab.meta deleted file mode 100644 index 73ed474..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeCollisionSuccess.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 1228dff762eab21488cfefd42792c37b -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeTriggerFailure.prefab b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeTriggerFailure.prefab deleted file mode 100644 index 1f929e3..0000000 Binary files a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeTriggerFailure.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeTriggerFailure.prefab.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeTriggerFailure.prefab.meta deleted file mode 100644 index e04b231..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeTriggerFailure.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 616ddafe39e02da4081e56f7f763af3c -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeTriggerSuccess.prefab b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeTriggerSuccess.prefab deleted file mode 100644 index 947a40f..0000000 Binary files a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeTriggerSuccess.prefab and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeTriggerSuccess.prefab.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeTriggerSuccess.prefab.meta deleted file mode 100644 index d16c91a..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/CubeTriggerSuccess.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: d940e636fd44be84e9b7e8da46f700ef -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials.meta deleted file mode 100644 index ea98c41..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 8d55f43641ba3c14eaa1156abc0edabd -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials/green.mat b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials/green.mat deleted file mode 100644 index ac8a70c..0000000 Binary files a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials/green.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials/green.mat.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials/green.mat.meta deleted file mode 100644 index 2cabfad..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials/green.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 43da3275cd08d41429f56675d70c58df -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials/red.mat b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials/red.mat deleted file mode 100644 index beeafc5..0000000 Binary files a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials/red.mat and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials/red.mat.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials/red.mat.meta deleted file mode 100644 index 90565c1..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/Materials/red.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 03f3b4747259a364b800508ac27e1c17 -NativeFormatImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/green.png b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/green.png deleted file mode 100644 index f4dcca2..0000000 Binary files a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/green.png and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/green.png.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/green.png.meta deleted file mode 100644 index 2add269..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/green.png.meta +++ /dev/null @@ -1,53 +0,0 @@ -fileFormatVersion: 2 -guid: 928be703400f4eb48af2f94d55bf3f74 -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - autoDetectMinSpriteSize: 4 - gridPadding: 0 - gridOffsetX: 0 - gridOffsetY: 0 - gridSizeX: 64 - gridSizeY: 64 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spriteAtlasHint: 0 - spritePixelsToUnits: 100 - generateSpritePolygon: 0 - spritePolygonAlphaCutoff: 254 - spritePolygonDetail: .5 - alphaIsTransparency: 0 - textureType: -1 - buildTargetSettings: [] - spriteSheet: - spriteFrames: [] - userData: diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/red.png b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/red.png deleted file mode 100644 index 8b29b45..0000000 Binary files a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/red.png and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/red.png.meta b/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/red.png.meta deleted file mode 100644 index 9cda8d8..0000000 --- a/example_project/Assets/UnityTestTools/IntegrationTestsFramework/TestingAssets/red.png.meta +++ /dev/null @@ -1,53 +0,0 @@ -fileFormatVersion: 2 -guid: 591632297e74ba34fa4c65d1265d370a -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - autoDetectMinSpriteSize: 4 - gridPadding: 0 - gridOffsetX: 0 - gridOffsetY: 0 - gridSizeX: 64 - gridSizeY: 64 - spriteExtrude: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spriteAtlasHint: 0 - spritePixelsToUnits: 100 - generateSpritePolygon: 0 - spritePolygonAlphaCutoff: 254 - spritePolygonDetail: .5 - alphaIsTransparency: 0 - textureType: -1 - buildTargetSettings: [] - spriteSheet: - spriteFrames: [] - userData: diff --git a/example_project/Assets/UnityTestTools/LICENSE.txt b/example_project/Assets/UnityTestTools/LICENSE.txt deleted file mode 100644 index d8064cd..0000000 --- a/example_project/Assets/UnityTestTools/LICENSE.txt +++ /dev/null @@ -1,83 +0,0 @@ -This software is provided 'as-is', without any express or implied warranty. - - -THE UNITY TEST TOOLS CONTAIN THE FOLLOWING THIRD PARTY LIBRARIES: -NSubstitute Copyright (c) 2009 Anthony Egerton (nsubstitute@delfish.com) and David Tchepak (dave@davesquared.net). All rights reserved. -NUnit Portions Copyright © 2002-2009 Charlie Poole or Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig -Cecil Copyright (c) 2008 - 2011, Jb Evain - - - -NSubstitute is open source software, licensed under the BSD License. The modifications made by Unity are available on github. - -Copyright (c) 2009 Anthony Egerton (nsubstitute@delfish.com) and David Tchepak (dave@davesquared.net) -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the names of the copyright holders nor the names of - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -[ http://www.opensource.org/licenses/bsd-license.php ] - - - -NUnit is provided 'as-is', without any express or implied warranty. The modifications made by Unity are available on github. - -Copyright © 2002-2013 Charlie Poole -Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov -Copyright © 2000-2002 Philip A. Craig - -This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required. - -Portions Copyright © 2002-2013 Charlie Poole or Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig - -2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source distribution. - - - -Cecil is licensed under the MIT/X11. - -Copyright (c) 2008 - 2011, Jb Evain - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/LICENSE.txt.meta b/example_project/Assets/UnityTestTools/LICENSE.txt.meta deleted file mode 100644 index 6a87d69..0000000 --- a/example_project/Assets/UnityTestTools/LICENSE.txt.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 0d5b4501bf773f349ad95ec34491dc61 -TextScriptImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/UnitTesting.meta b/example_project/Assets/UnityTestTools/UnitTesting.meta deleted file mode 100644 index 10d2dd5..0000000 --- a/example_project/Assets/UnityTestTools/UnitTesting.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 9a87f1db904f1e948a2385ab9961e3aa -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/UnitTesting/Editor.meta b/example_project/Assets/UnityTestTools/UnitTesting/Editor.meta deleted file mode 100644 index 802e986..0000000 --- a/example_project/Assets/UnityTestTools/UnitTesting/Editor.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 59b47eb3fc62eb44cb73a329a1e6b6cb -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/UnitTesting/Editor/NSubstitute.meta b/example_project/Assets/UnityTestTools/UnitTesting/Editor/NSubstitute.meta deleted file mode 100644 index 9a7cadb..0000000 --- a/example_project/Assets/UnityTestTools/UnitTesting/Editor/NSubstitute.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 92b38897656771f409e9235955975754 -folderAsset: yes -DefaultImporter: - userData: diff --git a/example_project/Assets/UnityTestTools/UnitTesting/Editor/NSubstitute/NSubstitute.dll b/example_project/Assets/UnityTestTools/UnitTesting/Editor/NSubstitute/NSubstitute.dll deleted file mode 100644 index ee8b155..0000000 Binary files a/example_project/Assets/UnityTestTools/UnitTesting/Editor/NSubstitute/NSubstitute.dll and /dev/null differ diff --git a/example_project/Assets/UnityTestTools/UnitTesting/Editor/NSubstitute/NSubstitute.dll.meta b/example_project/Assets/UnityTestTools/UnitTesting/Editor/NSubstitute/NSubstitute.dll.meta deleted file mode 100644 index 38d55f5..0000000 --- a/example_project/Assets/UnityTestTools/UnitTesting/Editor/NSubstitute/NSubstitute.dll.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 3c5e1afc6e0d68849ae6639aff58cfc7 -MonoAssemblyImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - userData: diff --git a/example_project/Assets/UnityTestTools/changelog.txt b/example_project/Assets/UnityTestTools/changelog.txt deleted file mode 100644 index fca9560..0000000 --- a/example_project/Assets/UnityTestTools/changelog.txt +++ /dev/null @@ -1,216 +0,0 @@ -Version 1.5.8 - -- Bugfixes - -Version 1.5.7 - -- Updated tools for Unity 5.3 - -Version 1.5.6 - -- Updated Mono.Cecil.dll and Mono.Cecil.Mdb.dll libraries - -Version 1.5.5 - -- Unit Tests Runner rendering improvments -- Platform runner can include auxiliary scenes -- other improvments and bugfixes - -Version 1.5.4 - -- APIs updates - -Version 1.5.3 - -- Bug fixes - -Version 1.5.2 - -- Bug fixes -- Minor improvments - -Version 1.5.1 - -- removed redundant and not applicable options -- fixed 5.0 related bugs - -Version 1.5.0 - -- Unity 5 related compatibility changes - -Version 1.4.6 - -- Bug fixes -- Minor improvments - -Version 1.4.5 - -- Added "Pause on test failure" option for integration tests -- bugfixes and code refactorization -- fixed UI bug where test details were not refreshed is the label was focused - -Version 1.4.4 - -- Minimal supported Unity version is now 4.3 -- UI changes -- code refactoring - -Version 1.4.3 - -- Remove reference to Resources.LoadAssetAtPath from runtime code - -Version 1.4.2 - -(assertion component) -- fixed string comparer bug that prevented updating the value - -(unit tests) -- unit test runner will log to stdout now -- fixes issues with opening tests in IDEs - -(integration tests) -- transform component is now visible for integration tests components -- added better support for mac's keyboard -- fixed 'succeed on assertion' for code generated assertion - -(other) -- minor bugfixes -- general improvments - -Version 1.4.1 - -- Fixed platform compilation issues -- Fixed typos in labels -- Removed docs and left a link to online docs -- Added Unity version and target platform to result files -- Other bugfixes - -Version 1.4 - -(integration tests) -- Platform runner will send the results back to the editor via TCP now -- Added naming convention for running tests in batch mode -- It's possible to cancel the run in the editor in between the tests now -- Added message filtering for integration tests results -- Added check for RegisterLogCallback in case something else overrides it -- Error messages will now fail integration tests -- Fixed dynamic integration tests not being properly reset -- Fixed platform runner for BlackBerry platform - -(assertion component) -- fixed the component editor - -(common) -- Made settings to be saved per project -- Fixed resolving icons when there are more UnityTestTools folders in the project -- Fixed process return code when running in batch mode - -Version 1.3.2 - -- Fixed integration tests performance issues - -Version 1.3.1 - -- Updated Japanese docs - -Version 1.3 - -Fixes: -(unit tests) -- nUnit will no longer change the Environment.CurrentDirectory when running tests -- fixed issues with asserting GameObject == null -(integration tests) -- fix the issue with passing or failing test in first frame -- fixed bug where ignored tests were still run in ITF -(assertion component) -- fixed resolving properties to include derived types - -Improvements: -(unit tests) -- refactored result renderer -- reenabled Random attribute -- added Category filter -- NSubstitute updated to version 1.7.2 -- result now will be dimmed after recompilation -- running tests in background will now work without having the window focused -- all assemblies in the project referencing 'nunit.framework' will now be included in the test list -(integration tests) -- updated platform exclusion mechanism -- refactored result renderer -- the runner should work even if the runner window is not focused -- added possibility to create integration tests from code -- the runner will now always run in background (if the window is not focused) -(assertion component) -- added API for creating assertions from code -- added new example -(common) -- GUI improvements -- you no longer need to change the path to icons when moving the tools to another directory -- made test details/results resizeable and scrollable -- added character escape for generated result XML - -Version 1.2.1 -- Fixed Unit Test Batch runner - -Version 1.2 -Fixes: -- Windows Store related compilation issues -- other -Improvements: -(unit tests) -- unit test runner can run in background now without having the runner window open -- unit test batch runner can take a result file path as a parameter -- changed undo system for unit test runner and UnityUnitTest base class -- execution time in now visible in test details -- fixed a bug with tests that inherit from a base test class -(integration tests) -- added hierarchical structure for integration tests -- added Player runner to automate running integration tests on platforms -- Integration tests batch runner can take a result directory as a parameter -- Integration tests batch runner can run tests on platforms -- results are rendered in a player -(assertion component) -- changed default failure messages -- it's possible to override failure action on comparer failure -- added code stripper for assertions. -- vast performance improvement -- fixed bugs -Other: -- "Hide in hierarchy" option was removed from integration test runner -- "Focus on selection" option was removed from integration test runner -- "Hide test runner" option was removed from integration test runner -- result files for unit tests and integration tests are now not generated when running tests from the editor -- UI improvements -- removed UnityScript and Boo examples -- WP8 compatibility fixes - -Version 1.1.1 -Other: -- Documentation in Japanese was added - -Version 1.1 -Fixes: -- fixed display error that happened when unit test class inherited from another TestFixture class -- fixed false positive result when "Succeed on assertions" was checked and no assertions were present in the test -- fixed XmlResultWriter to be generate XML file compatible with XSD scheme -- XmlResultWriter result writer was rewritten to remove XML libraries dependency -- Fixed an issue with a check that should be executed once after a specified frame in OnUpdate. -- added missing file UnityUnitTest.cs -Improvements: -- Added Japanese translation of the documentation -- ErrorPause value will be reverted to previous state after test run finishes -- Assertion Component will not copy reference to a GameObject if the GameObject is the same as the component is attached to. Instead, it will set the reference to the new GameObject. -- Integration tests batch runner can now run multiple scenes -- Unit test runner will now include tests written in UnityScript and Boo -- Unit tests will not run automatically if the compilation failes -- Added scene auto-save option to the Unit Test Runner -Other: -- changed icons -- restructured project files -- moved XmlResultWriter to Common folder -- added UnityScript and Boo unit tests examples -- added more unit tests examples -- Test runners visual adjustments - -Version 1.0 -- Initial release \ No newline at end of file diff --git a/example_project/Assets/UnityTestTools/changelog.txt.meta b/example_project/Assets/UnityTestTools/changelog.txt.meta deleted file mode 100644 index 8c28fef..0000000 --- a/example_project/Assets/UnityTestTools/changelog.txt.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 29b770d9107643740b69cb98b00430aa -TextScriptImporter: - userData: diff --git a/example_project/ProjectSettings/AudioManager.asset b/example_project/ProjectSettings/AudioManager.asset deleted file mode 100644 index 7d7c3ad..0000000 Binary files a/example_project/ProjectSettings/AudioManager.asset and /dev/null differ diff --git a/example_project/ProjectSettings/ClusterInputManager.asset b/example_project/ProjectSettings/ClusterInputManager.asset deleted file mode 100644 index 6434631..0000000 Binary files a/example_project/ProjectSettings/ClusterInputManager.asset and /dev/null differ diff --git a/example_project/ProjectSettings/DynamicsManager.asset b/example_project/ProjectSettings/DynamicsManager.asset deleted file mode 100644 index 2152d7f..0000000 Binary files a/example_project/ProjectSettings/DynamicsManager.asset and /dev/null differ diff --git a/example_project/ProjectSettings/EditorBuildSettings.asset b/example_project/ProjectSettings/EditorBuildSettings.asset deleted file mode 100644 index a4903a6..0000000 Binary files a/example_project/ProjectSettings/EditorBuildSettings.asset and /dev/null differ diff --git a/example_project/ProjectSettings/EditorSettings.asset b/example_project/ProjectSettings/EditorSettings.asset deleted file mode 100644 index d6728ec..0000000 Binary files a/example_project/ProjectSettings/EditorSettings.asset and /dev/null differ diff --git a/example_project/ProjectSettings/GraphicsSettings.asset b/example_project/ProjectSettings/GraphicsSettings.asset deleted file mode 100644 index 96548d5..0000000 Binary files a/example_project/ProjectSettings/GraphicsSettings.asset and /dev/null differ diff --git a/example_project/ProjectSettings/InputManager.asset b/example_project/ProjectSettings/InputManager.asset deleted file mode 100644 index ddeb8a4..0000000 Binary files a/example_project/ProjectSettings/InputManager.asset and /dev/null differ diff --git a/example_project/ProjectSettings/NavMeshAreas.asset b/example_project/ProjectSettings/NavMeshAreas.asset deleted file mode 100644 index b1b458b..0000000 Binary files a/example_project/ProjectSettings/NavMeshAreas.asset and /dev/null differ diff --git a/example_project/ProjectSettings/Physics2DSettings.asset b/example_project/ProjectSettings/Physics2DSettings.asset deleted file mode 100644 index 6bd756b..0000000 Binary files a/example_project/ProjectSettings/Physics2DSettings.asset and /dev/null differ diff --git a/example_project/ProjectSettings/ProjectSettings.asset b/example_project/ProjectSettings/ProjectSettings.asset deleted file mode 100644 index ca13976..0000000 Binary files a/example_project/ProjectSettings/ProjectSettings.asset and /dev/null differ diff --git a/example_project/ProjectSettings/ProjectVersion.txt b/example_project/ProjectSettings/ProjectVersion.txt deleted file mode 100644 index 558807b..0000000 --- a/example_project/ProjectSettings/ProjectVersion.txt +++ /dev/null @@ -1,2 +0,0 @@ -m_EditorVersion: 5.3.5f1 -m_StandardAssetsVersion: 0 diff --git a/example_project/ProjectSettings/QualitySettings.asset b/example_project/ProjectSettings/QualitySettings.asset deleted file mode 100644 index 0029228..0000000 Binary files a/example_project/ProjectSettings/QualitySettings.asset and /dev/null differ diff --git a/example_project/ProjectSettings/TagManager.asset b/example_project/ProjectSettings/TagManager.asset deleted file mode 100644 index 684e3b1..0000000 Binary files a/example_project/ProjectSettings/TagManager.asset and /dev/null differ diff --git a/example_project/ProjectSettings/TimeManager.asset b/example_project/ProjectSettings/TimeManager.asset deleted file mode 100644 index 81efefc..0000000 Binary files a/example_project/ProjectSettings/TimeManager.asset and /dev/null differ diff --git a/example_project/ProjectSettings/UnityAdsSettings.asset b/example_project/ProjectSettings/UnityAdsSettings.asset deleted file mode 100644 index 3b0a8f7..0000000 Binary files a/example_project/ProjectSettings/UnityAdsSettings.asset and /dev/null differ diff --git a/example_project/ProjectSettings/UnityConnectSettings.asset b/example_project/ProjectSettings/UnityConnectSettings.asset deleted file mode 100644 index 87c2de6..0000000 Binary files a/example_project/ProjectSettings/UnityConnectSettings.asset and /dev/null differ