├── .gitignore ├── .gitmodules ├── Assets ├── Examples.meta ├── Examples │ ├── 2D.meta │ ├── 2D │ │ ├── 01 - Basic.meta │ │ ├── 01 - Basic │ │ │ ├── GoForPoint.unity │ │ │ ├── GoForPoint.unity.meta │ │ │ ├── GoForPointController2D.cs │ │ │ ├── GoForPointController2D.cs.meta │ │ │ ├── Neighbor examples.meta │ │ │ ├── Neighbor examples │ │ │ │ ├── Neighbors-Alignment-Cohesion.prefab │ │ │ │ ├── Neighbors-Alignment-Cohesion.prefab.meta │ │ │ │ ├── Neighbors-Alignment-Cohesion.unity │ │ │ │ ├── Neighbors-Alignment-Cohesion.unity.meta │ │ │ │ ├── Neighbors-Alignment-Seperation.prefab │ │ │ │ ├── Neighbors-Alignment-Seperation.prefab.meta │ │ │ │ ├── Neighbors-Alignment-Seperation.unity │ │ │ │ ├── Neighbors-Alignment-Seperation.unity.meta │ │ │ │ ├── Neighbors-Alignment.prefab │ │ │ │ ├── Neighbors-Alignment.prefab.meta │ │ │ │ ├── Neighbors-Alignment.unity │ │ │ │ ├── Neighbors-Alignment.unity.meta │ │ │ │ ├── Neighbors-Cohesion.prefab │ │ │ │ ├── Neighbors-Cohesion.prefab.meta │ │ │ │ ├── Neighbors-Cohesion.unity │ │ │ │ ├── Neighbors-Cohesion.unity.meta │ │ │ │ ├── Neighbors-Seperation.prefab │ │ │ │ ├── Neighbors-Seperation.prefab.meta │ │ │ │ ├── Neighbors-Seperation.unity │ │ │ │ └── Neighbors-Seperation.unity.meta │ │ │ ├── PathFollowing-WithSpline.unity │ │ │ ├── PathFollowing-WithSpline.unity.meta │ │ │ ├── PathFollowing.unity │ │ │ ├── PathFollowing.unity.meta │ │ │ ├── PathFollowingController2D.cs │ │ │ ├── PathFollowingController2D.cs.meta │ │ │ ├── Wandering.unity │ │ │ └── Wandering.unity.meta │ │ ├── 02 - Intermediate.meta │ │ ├── 02 - Intermediate │ │ │ ├── Evasion-Pursuit-1.unity │ │ │ ├── Evasion-Pursuit-1.unity.meta │ │ │ ├── Evasion-Pursuit-2.unity │ │ │ ├── Evasion-Pursuit-2.unity.meta │ │ │ ├── Pursuit-vs-Follow.unity │ │ │ └── Pursuit-vs-Follow.unity.meta │ │ ├── 03 - Advanced.meta │ │ ├── 03 - Advanced │ │ │ ├── ObstacleAvoidance.meta │ │ │ └── ObstacleAvoidance │ │ │ │ ├── DestroyOnCollision2D.cs │ │ │ │ ├── DestroyOnCollision2D.cs.meta │ │ │ │ ├── Obstacle.prefab │ │ │ │ ├── Obstacle.prefab.meta │ │ │ │ ├── ObstacleAvoidance.unity │ │ │ │ ├── ObstacleAvoidance.unity.meta │ │ │ │ ├── ObstacleAvoidanceBoid.prefab │ │ │ │ └── ObstacleAvoidanceBoid.prefab.meta │ │ ├── 2DMainCamera.prefab │ │ ├── 2DMainCamera.prefab.meta │ │ ├── 2dVehicleBase.prefab │ │ ├── 2dVehicleBase.prefab.meta │ │ ├── 2d_boid.png │ │ └── 2d_boid.png.meta │ ├── 3D.meta │ └── 3D │ │ ├── 01 - Basic.meta │ │ ├── 01 - Basic │ │ ├── GoForPoint.unity │ │ ├── GoForPoint.unity.meta │ │ ├── GoForPointController.cs │ │ ├── GoForPointController.cs.meta │ │ ├── Neighbor examples.meta │ │ ├── Neighbor examples │ │ │ ├── Neighbors-Alignment-Cohesion.prefab │ │ │ ├── Neighbors-Alignment-Cohesion.prefab.meta │ │ │ ├── Neighbors-Alignment-Cohesion.unity │ │ │ ├── Neighbors-Alignment-Cohesion.unity.meta │ │ │ ├── Neighbors-Alignment-Separation.prefab │ │ │ ├── Neighbors-Alignment-Separation.prefab.meta │ │ │ ├── Neighbors-Alignment-Separation.unity │ │ │ ├── Neighbors-Alignment-Separation.unity.meta │ │ │ ├── Neighbors-Alignment.prefab │ │ │ ├── Neighbors-Alignment.prefab.meta │ │ │ ├── Neighbors-Alignment.unity │ │ │ ├── Neighbors-Alignment.unity.meta │ │ │ ├── Neighbors-Cohesion.prefab │ │ │ ├── Neighbors-Cohesion.prefab.meta │ │ │ ├── Neighbors-Cohesion.unity │ │ │ ├── Neighbors-Cohesion.unity.meta │ │ │ ├── Neighbors-Separation.prefab │ │ │ ├── Neighbors-Separation.prefab.meta │ │ │ ├── Neighbors-Separation.unity │ │ │ └── Neighbors-Separation.unity.meta │ │ ├── PathFollowing-WithSpline.unity │ │ ├── PathFollowing-WithSpline.unity.meta │ │ ├── PathFollowing.unity │ │ ├── PathFollowing.unity.meta │ │ ├── PathFollowingController.cs │ │ ├── PathFollowingController.cs.meta │ │ ├── Wandering.unity │ │ └── Wandering.unity.meta │ │ ├── 02 - Intermediate.meta │ │ ├── 02 - Intermediate │ │ ├── Evasion-Pursuit-1.unity │ │ ├── Evasion-Pursuit-1.unity.meta │ │ ├── Evasion-Pursuit-2.unity │ │ ├── Evasion-Pursuit-2.unity.meta │ │ ├── Pursuit-vs-Follow.unity │ │ └── Pursuit-vs-Follow.unity.meta │ │ ├── 03 - Advanced.meta │ │ └── 03 - Advanced │ │ ├── ObstacleAvoidance.meta │ │ ├── ObstacleAvoidance │ │ ├── DestroyOnCollision.cs │ │ ├── DestroyOnCollision.cs.meta │ │ ├── Obstacle.prefab │ │ ├── Obstacle.prefab.meta │ │ ├── ObstacleAvoidance.unity │ │ ├── ObstacleAvoidance.unity.meta │ │ ├── ObstacleAvoidanceBoid.prefab │ │ ├── ObstacleAvoidanceBoid.prefab.meta │ │ ├── PrefabInstantiator.cs │ │ └── PrefabInstantiator.cs.meta │ │ ├── PlayingTag-PlanarX.meta │ │ ├── PlayingTag-PlanarX │ │ ├── Tag-PlanarX.unity │ │ ├── Tag-PlanarX.unity.meta │ │ ├── TagPlayerPlanarX.prefab │ │ └── TagPlayerPlanarX.prefab.meta │ │ ├── PlayingTag-PlanarY.meta │ │ ├── PlayingTag-PlanarY │ │ ├── Tag-PlanarY.unity │ │ ├── Tag-PlanarY.unity.meta │ │ ├── TagPlayerPlanarY.prefab │ │ └── TagPlayerPlanarY.prefab.meta │ │ ├── PlayingTag-PlanarZ.meta │ │ ├── PlayingTag-PlanarZ │ │ ├── Tag-PlanarZ.unity │ │ ├── Tag-PlanarZ.unity.meta │ │ ├── TagPlayerPlanarZ.prefab │ │ └── TagPlayerPlanarZ.prefab.meta │ │ ├── PlayingTag-With Obstacles.meta │ │ ├── PlayingTag-With Obstacles │ │ ├── Materials.meta │ │ ├── Materials │ │ │ ├── PreyMaterial.mat │ │ │ ├── PreyMaterial.mat.meta │ │ │ ├── SuccessMaterial.mat │ │ │ ├── SuccessMaterial.mat.meta │ │ │ ├── Trail.mat │ │ │ └── Trail.mat.meta │ │ ├── TagPlayerAvoider.prefab │ │ ├── TagPlayerAvoider.prefab.meta │ │ ├── TagWithObstacles.unity │ │ └── TagWithObstacles.unity.meta │ │ ├── PlayingTag.meta │ │ └── PlayingTag │ │ ├── Behaviors.meta │ │ ├── Behaviors │ │ ├── TagPlayer.cs │ │ ├── TagPlayer.cs.meta │ │ ├── TagPlayerManager.cs │ │ └── TagPlayerManager.cs.meta │ │ ├── Materials.meta │ │ ├── Materials │ │ ├── PreyMaterial.mat │ │ ├── PreyMaterial.mat.meta │ │ ├── SuccessMaterial.mat │ │ ├── SuccessMaterial.mat.meta │ │ ├── Trail.mat │ │ └── Trail.mat.meta │ │ ├── Tag.unity │ │ ├── Tag.unity.meta │ │ ├── TagPlayer.prefab │ │ └── TagPlayer.prefab.meta ├── Light.prefab ├── Light.prefab.meta ├── Materials.meta ├── Materials │ ├── Green.mat │ ├── Green.mat.meta │ ├── Grid.mat │ ├── Grid.mat.meta │ ├── Red.mat │ ├── Red.mat.meta │ ├── Yellow.mat │ └── Yellow.mat.meta ├── Plugins.meta ├── Plugins │ ├── GoKit.meta │ └── GoKit │ │ ├── Go.cs │ │ ├── Go.cs.meta │ │ ├── GoDummyPath.cs │ │ ├── GoDummyPath.cs.meta │ │ ├── GoTween.cs │ │ ├── GoTween.cs.meta │ │ ├── GoTweenChain.cs │ │ ├── GoTweenChain.cs.meta │ │ ├── GoTweenCollectionConfig.cs │ │ ├── GoTweenCollectionConfig.cs.meta │ │ ├── GoTweenConfig.cs │ │ ├── GoTweenConfig.cs.meta │ │ ├── GoTweenFlow.cs │ │ ├── GoTweenFlow.cs.meta │ │ ├── base.meta │ │ ├── base │ │ ├── AbstractGoTween.cs │ │ ├── AbstractGoTween.cs.meta │ │ ├── AbstractGoTweenCollection.cs │ │ └── AbstractGoTweenCollection.cs.meta │ │ ├── easing.meta │ │ ├── easing │ │ ├── GoEaseBack.cs │ │ ├── GoEaseBack.cs.meta │ │ ├── GoEaseBounce.cs │ │ ├── GoEaseBounce.cs.meta │ │ ├── GoEaseCircular.cs │ │ ├── GoEaseCircular.cs.meta │ │ ├── GoEaseCubic.cs │ │ ├── GoEaseCubic.cs.meta │ │ ├── GoEaseElastic.cs │ │ ├── GoEaseElastic.cs.meta │ │ ├── GoEaseExponential.cs │ │ ├── GoEaseExponential.cs.meta │ │ ├── GoEaseLinear.cs │ │ ├── GoEaseLinear.cs.meta │ │ ├── GoEaseQuadratic.cs │ │ ├── GoEaseQuadratic.cs.meta │ │ ├── GoEaseQuartic.cs │ │ ├── GoEaseQuartic.cs.meta │ │ ├── GoEaseQuintic.cs │ │ ├── GoEaseQuintic.cs.meta │ │ ├── GoEaseSinusoidal.cs │ │ ├── GoEaseSinusoidal.cs.meta │ │ ├── easeEquationsLicense.txt │ │ └── easeEquationsLicense.txt.meta │ │ ├── enums.meta │ │ ├── enums │ │ ├── GoDuplicatePropertyRuleType.cs │ │ ├── GoDuplicatePropertyRuleType.cs.meta │ │ ├── GoEaseType.cs │ │ ├── GoEaseType.cs.meta │ │ ├── GoLogLevel.cs │ │ ├── GoLogLevel.cs.meta │ │ ├── GoLookAtType.cs │ │ ├── GoLookAtType.cs.meta │ │ ├── GoLoopType.cs │ │ ├── GoLoopType.cs.meta │ │ ├── GoShakeType.cs │ │ ├── GoShakeType.cs.meta │ │ ├── GoSplineType.cs │ │ ├── GoSplineType.cs.meta │ │ ├── GoTweenState.cs │ │ ├── GoTweenState.cs.meta │ │ ├── GoUpdateType.cs │ │ └── GoUpdateType.cs.meta │ │ ├── extensions.meta │ │ ├── extensions │ │ ├── GoKitTweenExtensions.cs │ │ └── GoKitTweenExtensions.cs.meta │ │ ├── properties.meta │ │ └── properties │ │ ├── GoTweenUtils.cs │ │ ├── GoTweenUtils.cs.meta │ │ ├── abstracts.meta │ │ ├── abstracts │ │ ├── AbstractColorTweenProperty.cs │ │ ├── AbstractColorTweenProperty.cs.meta │ │ ├── AbstractQuaternionTweenProperty.cs │ │ ├── AbstractQuaternionTweenProperty.cs.meta │ │ ├── AbstractTweenProperty.cs │ │ ├── AbstractTweenProperty.cs.meta │ │ ├── AbstractVector3TweenProperty.cs │ │ └── AbstractVector3TweenProperty.cs.meta │ │ ├── genericTypes.meta │ │ ├── genericTypes │ │ ├── ColorTweenProperty.cs │ │ ├── ColorTweenProperty.cs.meta │ │ ├── FloatTweenProperty.cs │ │ ├── FloatTweenProperty.cs.meta │ │ ├── IGenericProperty.cs │ │ ├── IGenericProperty.cs.meta │ │ ├── IntTweenProperty.cs │ │ ├── IntTweenProperty.cs.meta │ │ ├── Vector2TweenProperty.cs │ │ ├── Vector2TweenProperty.cs.meta │ │ ├── Vector3PathTweenProperty.cs │ │ ├── Vector3PathTweenProperty.cs.meta │ │ ├── Vector3TweenProperty.cs │ │ ├── Vector3TweenProperty.cs.meta │ │ ├── Vector3XTweenProperty.cs │ │ ├── Vector3XTweenProperty.cs.meta │ │ ├── Vector3YTweenProperty.cs │ │ ├── Vector3YTweenProperty.cs.meta │ │ ├── Vector3ZTweenProperty.cs │ │ ├── Vector3ZTweenProperty.cs.meta │ │ ├── Vector4TweenProperty.cs │ │ └── Vector4TweenProperty.cs.meta │ │ ├── smoothing.meta │ │ ├── smoothing │ │ ├── GoSmoothedQuaternion.cs │ │ ├── GoSmoothedQuaternion.cs.meta │ │ ├── GoSmoothedVector3.cs │ │ ├── GoSmoothedVector3.cs.meta │ │ ├── GoSmoothingType.cs │ │ └── GoSmoothingType.cs.meta │ │ ├── specificTypes.meta │ │ ├── specificTypes │ │ ├── EulerAnglesTweenProperty.cs │ │ ├── EulerAnglesTweenProperty.cs.meta │ │ ├── MaterialColorTweenProperty.cs │ │ ├── MaterialColorTweenProperty.cs.meta │ │ ├── PositionPathTweenProperty.cs │ │ ├── PositionPathTweenProperty.cs.meta │ │ ├── PositionTweenProperty.cs │ │ ├── PositionTweenProperty.cs.meta │ │ ├── RotationQuaternionTweenProperty.cs │ │ ├── RotationQuaternionTweenProperty.cs.meta │ │ ├── RotationTweenProperty.cs │ │ ├── RotationTweenProperty.cs.meta │ │ ├── ScalePathTweenProperty.cs │ │ ├── ScalePathTweenProperty.cs.meta │ │ ├── ScaleTweenProperty.cs │ │ ├── ScaleTweenProperty.cs.meta │ │ ├── ShakeTweenProperty.cs │ │ └── ShakeTweenProperty.cs.meta │ │ ├── splines.meta │ │ └── splines │ │ ├── AbstractGoSplineSolver.cs │ │ ├── AbstractGoSplineSolver.cs.meta │ │ ├── GoSpline.cs │ │ ├── GoSpline.cs.meta │ │ ├── GoSplineCatmullRomSolver.cs │ │ ├── GoSplineCatmullRomSolver.cs.meta │ │ ├── GoSplineCubicBezierSolver.cs │ │ ├── GoSplineCubicBezierSolver.cs.meta │ │ ├── GoSplineQuadraticBezierSolver.cs │ │ ├── GoSplineQuadraticBezierSolver.cs.meta │ │ ├── GoSplineStraightLineSolver.cs │ │ └── GoSplineStraightLineSolver.cs.meta ├── Standard Assets (Mobile).meta ├── Standard Assets (Mobile) │ ├── Textures.meta │ └── Textures │ │ ├── grid.psd │ │ └── grid.psd.meta ├── UnitySteer.meta ├── Utils.meta └── Utils │ ├── SingletonPerLevel.cs │ └── SingletonPerLevel.cs.meta ├── License.txt ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NavMeshLayers.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityAdsSettings.asset └── UnityConnectSettings.asset ├── README.md └── SampleList.md /.gitignore: -------------------------------------------------------------------------------- 1 | Temp/* 2 | Assembly* 3 | *.sln 4 | *.userprefs 5 | /Library 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Assets/UnitySteer"] 2 | path = Assets/UnitySteer 3 | url = https://github.com/ricardojmendez/UnitySteer.git 4 | -------------------------------------------------------------------------------- /Assets/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2805e9cd4495f4eb79ab0d7635c36c17 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Examples/2D.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c783bcc5e328415395464dbbc5368b3 3 | folderAsset: yes 4 | timeCreated: 1452941669 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb09c327171834f128aad95b908793e4 3 | folderAsset: yes 4 | timeCreated: 1452941660 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/GoForPoint.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a517e70f451a941a993cf109f75533db 3 | timeCreated: 1452941660 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/GoForPointController2D.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | 3 | using UnityEngine; 4 | 5 | using UnitySteer2D; 6 | using UnitySteer2D.Behaviors; 7 | 8 | [RequireComponent(typeof(AutonomousVehicle2D)), RequireComponent(typeof(SteerForPoint2D))] 9 | public class GoForPointController2D : MonoBehaviour 10 | { 11 | SteerForPoint2D _steering; 12 | 13 | [SerializeField] 14 | Vector2 _pointRange = Vector2.one * 5f; 15 | 16 | void Start() 17 | { 18 | _steering = GetComponent(); 19 | _steering.OnArrival += (_) => FindNewTarget(); 20 | FindNewTarget(); 21 | } 22 | 23 | 24 | void FindNewTarget() 25 | { 26 | _steering.TargetPoint = Vector2.Scale(Random.onUnitSphere, _pointRange); 27 | _steering.enabled = true; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/GoForPointController2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1f84a1e0d5704009b001e777983ac64 3 | timeCreated: 1452941660 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/Neighbor examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a245f80315117406eaf55859983a8eed 3 | folderAsset: yes 4 | timeCreated: 1452941660 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/Neighbor examples/Neighbors-Alignment-Cohesion.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 094d8d3f1690a4a18b06b1a962f4462c 3 | timeCreated: 1452947804 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/Neighbor examples/Neighbors-Alignment-Cohesion.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1e65cab7dadf421fa11793257d9a517 3 | timeCreated: 1452947797 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/Neighbor examples/Neighbors-Alignment-Seperation.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5625f6cb8e91f44af8bf903d3bc489a6 3 | timeCreated: 1452947898 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/Neighbor examples/Neighbors-Alignment-Seperation.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b405af24fd88479cb0b493011fb30c6 3 | timeCreated: 1452947887 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/Neighbor examples/Neighbors-Alignment.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ce076a7e9a82466f8da59d935ab18e2 3 | timeCreated: 1452941660 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/Neighbor examples/Neighbors-Alignment.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6166f05c5b4bc4acc9185617d313b57f 3 | timeCreated: 1452941660 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/Neighbor examples/Neighbors-Cohesion.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2d3912bf86a04723bd9b770c34bc695 3 | timeCreated: 1452947652 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/Neighbor examples/Neighbors-Cohesion.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcd159043641d493dbbcb3fe7882b28e 3 | timeCreated: 1452947640 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/Neighbor examples/Neighbors-Seperation.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c1c969a29ce04752b7a198df5f4ef9a 3 | timeCreated: 1452946499 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/Neighbor examples/Neighbors-Seperation.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5291fbd6cc132458cbc557e4dcc373aa 3 | timeCreated: 1452946490 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/PathFollowing-WithSpline.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65adf51bff4e74ae5a3b83e06e7ecc28 3 | timeCreated: 1452951708 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/PathFollowing.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 355943d06f2b44988bf99f8481f006d8 3 | timeCreated: 1452941660 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/PathFollowingController2D.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using UnityEngine; 6 | 7 | using UnitySteer2D; 8 | using UnitySteer2D.Behaviors; 9 | 10 | [RequireComponent(typeof(SteerForPathSimplified2D))] 11 | public class PathFollowingController2D : MonoBehaviour 12 | { 13 | 14 | SteerForPathSimplified2D _steering; 15 | 16 | [SerializeField] Transform _pathRoot; 17 | 18 | [SerializeField] bool _followAsSpline; 19 | 20 | // Use this for initialization 21 | void Start() 22 | { 23 | _steering = GetComponent(); 24 | AssignPath(); 25 | } 26 | 27 | 28 | void AssignPath() 29 | { 30 | // Get a list of points to follow; 31 | var pathPoints = PathFromRoot(_pathRoot); 32 | _steering.Path = _followAsSpline ? new SplinePathway(pathPoints, 1) : new Vector2Pathway(pathPoints, 1); 33 | } 34 | 35 | static List PathFromRoot(Transform root) 36 | { 37 | var children = new List(); 38 | foreach (Transform t in root) 39 | { 40 | if (t != null) 41 | { 42 | children.Add(t); 43 | } 44 | } 45 | return children.OrderBy(t => t.gameObject.name).Select(t => new Vector2(t.position.x, t.position.y)).ToList(); 46 | } 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/PathFollowingController2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22fbd70a0c499436793a4cadbaf17d87 3 | timeCreated: 1452941660 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Examples/2D/01 - Basic/Wandering.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6aa6efe113f74423a843b6b124d3c683 3 | timeCreated: 1452941660 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/02 - Intermediate.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3392ed02d93c440739dc287528a629a1 3 | folderAsset: yes 4 | timeCreated: 1452952153 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Examples/2D/02 - Intermediate/Evasion-Pursuit-1.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45e83a602a8c24a22b4b8eb2d246c50e 3 | timeCreated: 1452952153 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/02 - Intermediate/Evasion-Pursuit-2.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a559594c6d2694eab947611d53741932 3 | timeCreated: 1452954064 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/02 - Intermediate/Pursuit-vs-Follow.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e48ff29ff5cc94f97856eadff53dcbd9 3 | timeCreated: 1452952153 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/03 - Advanced.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92ebb6d8b7cb34cd7b8999e9888515fb 3 | folderAsset: yes 4 | timeCreated: 1452954778 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Examples/2D/03 - Advanced/ObstacleAvoidance.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54266a1320c624246ba83cb5d2da2469 3 | folderAsset: yes 4 | timeCreated: 1452954778 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Examples/2D/03 - Advanced/ObstacleAvoidance/DestroyOnCollision2D.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnitySteer2D.Behaviors; 4 | 5 | public class DestroyOnCollision2D : MonoBehaviour 6 | { 7 | 8 | void OnTriggerEnter2D(Collider2D other) 9 | { 10 | if (Time.time < 2) return; 11 | 12 | var vehicle = other.GetComponent(); 13 | if (vehicle) 14 | { 15 | var renderer = other.GetComponentInChildren(); 16 | renderer.material.color = Color.blue; 17 | 18 | Debug.LogWarning(string.Format("{2} Destroying {0} upon collision with {1}", gameObject, vehicle, Time.time)); 19 | Destroy(gameObject); 20 | } 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Assets/Examples/2D/03 - Advanced/ObstacleAvoidance/DestroyOnCollision2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60ebb3ec26ea94ab08357907e3613369 3 | timeCreated: 1452955526 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Examples/2D/03 - Advanced/ObstacleAvoidance/Obstacle.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 114: {fileID: 11400000} 12 | - 114: {fileID: 11480118} 13 | - 114: {fileID: 11448508} 14 | - 212: {fileID: 21238342} 15 | - 58: {fileID: 5839038} 16 | m_Layer: 0 17 | m_Name: Obstacle 18 | m_TagString: Untagged 19 | m_Icon: {fileID: 0} 20 | m_NavMeshLayer: 0 21 | m_StaticEditorFlags: 0 22 | m_IsActive: 1 23 | --- !u!4 &400000 24 | Transform: 25 | m_ObjectHideFlags: 1 26 | m_PrefabParentObject: {fileID: 0} 27 | m_PrefabInternal: {fileID: 100100000} 28 | m_GameObject: {fileID: 100000} 29 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 30 | m_LocalPosition: {x: -2.35, y: 0, z: 0} 31 | m_LocalScale: {x: 5, y: 5, z: 1} 32 | m_Children: [] 33 | m_Father: {fileID: 0} 34 | m_RootOrder: 0 35 | --- !u!58 &5839038 36 | CircleCollider2D: 37 | m_ObjectHideFlags: 1 38 | m_PrefabParentObject: {fileID: 0} 39 | m_PrefabInternal: {fileID: 100100000} 40 | m_GameObject: {fileID: 100000} 41 | m_Enabled: 1 42 | m_Density: 1 43 | m_Material: {fileID: 0} 44 | m_IsTrigger: 1 45 | m_UsedByEffector: 0 46 | m_Offset: {x: 0, y: 0} 47 | serializedVersion: 2 48 | m_Radius: 0.095 49 | --- !u!114 &11400000 50 | MonoBehaviour: 51 | m_ObjectHideFlags: 1 52 | m_PrefabParentObject: {fileID: 0} 53 | m_PrefabInternal: {fileID: 100100000} 54 | m_GameObject: {fileID: 100000} 55 | m_Enabled: 1 56 | m_EditorHideFlags: 0 57 | m_Script: {fileID: 11500000, guid: 073a49e84f5bf4fc99b9f8a4d922f686, type: 3} 58 | m_Name: 59 | m_EditorClassIdentifier: 60 | Radius: {x: 20, y: 20, z: 0} 61 | RandomizeRotation: 1 62 | AllowedAxes: {x: 1, y: 1, z: 0} 63 | --- !u!114 &11448508 64 | MonoBehaviour: 65 | m_ObjectHideFlags: 1 66 | m_PrefabParentObject: {fileID: 0} 67 | m_PrefabInternal: {fileID: 100100000} 68 | m_GameObject: {fileID: 100000} 69 | m_Enabled: 1 70 | m_EditorHideFlags: 0 71 | m_Script: {fileID: 11500000, guid: 5dfad0d5673b24c509f34ce524305475, type: 3} 72 | m_Name: 73 | m_EditorClassIdentifier: 74 | _drawGizmos: 1 75 | _center: {x: 0, y: 0} 76 | _radius: 0.5 77 | --- !u!114 &11480118 78 | MonoBehaviour: 79 | m_ObjectHideFlags: 1 80 | m_PrefabParentObject: {fileID: 0} 81 | m_PrefabInternal: {fileID: 100100000} 82 | m_GameObject: {fileID: 100000} 83 | m_Enabled: 1 84 | m_EditorHideFlags: 0 85 | m_Script: {fileID: 11500000, guid: 60ebb3ec26ea94ab08357907e3613369, type: 3} 86 | m_Name: 87 | m_EditorClassIdentifier: 88 | --- !u!212 &21238342 89 | SpriteRenderer: 90 | m_ObjectHideFlags: 1 91 | m_PrefabParentObject: {fileID: 0} 92 | m_PrefabInternal: {fileID: 100100000} 93 | m_GameObject: {fileID: 100000} 94 | m_Enabled: 1 95 | m_CastShadows: 0 96 | m_ReceiveShadows: 0 97 | m_Materials: 98 | - {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0} 99 | m_SubsetIndices: 100 | m_StaticBatchRoot: {fileID: 0} 101 | m_UseLightProbes: 0 102 | m_ReflectionProbeUsage: 0 103 | m_ProbeAnchor: {fileID: 0} 104 | m_ScaleInLightmap: 1 105 | m_PreserveUVs: 0 106 | m_IgnoreNormalsForChartDetection: 0 107 | m_ImportantGI: 0 108 | m_MinimumChartSize: 4 109 | m_AutoUVMaxDistance: 0.5 110 | m_AutoUVMaxAngle: 89 111 | m_LightmapParameters: {fileID: 0} 112 | m_SortingLayerID: 0 113 | m_SortingOrder: 0 114 | m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} 115 | m_Color: {r: 0, g: 0, b: 0, a: 1} 116 | m_FlipX: 0 117 | m_FlipY: 0 118 | --- !u!1001 &100100000 119 | Prefab: 120 | m_ObjectHideFlags: 1 121 | serializedVersion: 2 122 | m_Modification: 123 | m_TransformParent: {fileID: 0} 124 | m_Modifications: 125 | - target: {fileID: 0} 126 | propertyPath: m_IsTrigger 127 | value: 1 128 | objectReference: {fileID: 0} 129 | - target: {fileID: 0} 130 | propertyPath: Radius.x 131 | value: 20 132 | objectReference: {fileID: 0} 133 | - target: {fileID: 0} 134 | propertyPath: Radius.y 135 | value: 20 136 | objectReference: {fileID: 0} 137 | m_RemovedComponents: [] 138 | m_ParentPrefab: {fileID: 0} 139 | m_RootGameObject: {fileID: 100000} 140 | m_IsPrefabParent: 1 141 | -------------------------------------------------------------------------------- /Assets/Examples/2D/03 - Advanced/ObstacleAvoidance/Obstacle.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5b03cf9697a745079662b989d873c1c 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/2D/03 - Advanced/ObstacleAvoidance/ObstacleAvoidance.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a22dda357c8a48bd903d5c539280bd1 3 | timeCreated: 1452954778 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/03 - Advanced/ObstacleAvoidance/ObstacleAvoidanceBoid.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ab272153196f419786c810532abdc8e 3 | timeCreated: 1452956288 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/2DMainCamera.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ecd182f8a68a42179510a3bddaaa155 3 | timeCreated: 1452943344 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/2dVehicleBase.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &130202 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 448956} 11 | - 212: {fileID: 21213706} 12 | m_Layer: 0 13 | m_Name: Sprite 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!1 &194392 20 | GameObject: 21 | m_ObjectHideFlags: 0 22 | m_PrefabParentObject: {fileID: 0} 23 | m_PrefabInternal: {fileID: 100100000} 24 | serializedVersion: 4 25 | m_Component: 26 | - 4: {fileID: 444158} 27 | - 114: {fileID: 11431870} 28 | m_Layer: 0 29 | m_Name: 2dVehicleBase 30 | m_TagString: Untagged 31 | m_Icon: {fileID: 0} 32 | m_NavMeshLayer: 0 33 | m_StaticEditorFlags: 0 34 | m_IsActive: 1 35 | --- !u!4 &444158 36 | Transform: 37 | m_ObjectHideFlags: 1 38 | m_PrefabParentObject: {fileID: 0} 39 | m_PrefabInternal: {fileID: 100100000} 40 | m_GameObject: {fileID: 194392} 41 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 42 | m_LocalPosition: {x: 0, y: 0, z: 0} 43 | m_LocalScale: {x: 1, y: 1, z: 1} 44 | m_Children: 45 | - {fileID: 448956} 46 | m_Father: {fileID: 0} 47 | m_RootOrder: 0 48 | --- !u!4 &448956 49 | Transform: 50 | m_ObjectHideFlags: 1 51 | m_PrefabParentObject: {fileID: 0} 52 | m_PrefabInternal: {fileID: 100100000} 53 | m_GameObject: {fileID: 130202} 54 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 55 | m_LocalPosition: {x: 0, y: 0, z: 0} 56 | m_LocalScale: {x: 3, y: 3, z: 1} 57 | m_Children: [] 58 | m_Father: {fileID: 444158} 59 | m_RootOrder: 0 60 | --- !u!114 &11431870 61 | MonoBehaviour: 62 | m_ObjectHideFlags: 1 63 | m_PrefabParentObject: {fileID: 0} 64 | m_PrefabInternal: {fileID: 100100000} 65 | m_GameObject: {fileID: 194392} 66 | m_Enabled: 1 67 | m_EditorHideFlags: 0 68 | m_Script: {fileID: 11500000, guid: 3294459318d7144f2938f60ff97f5e6b, type: 3} 69 | m_Name: 70 | m_EditorClassIdentifier: 71 | _drawGizmos: 1 72 | _center: {x: 0, y: 0} 73 | _radius: 1 74 | _minSpeedForTurning: 0.1 75 | _movementPriority: 0 76 | _turnTime: 0.1 77 | _mass: 1 78 | _allowedMovementAxes: {x: 1, y: 1} 79 | _arrivalRadius: 1 80 | _maxSpeed: 3 81 | _maxForce: 3 82 | _canMove: 1 83 | _forward: 0 84 | _queueName: Steering2D 85 | _tickLength: 0.1 86 | _maxQueueProcessedPerUpdate: 20 87 | _traceAdjustments: 0 88 | _accelerationRate: 5 89 | _decelerationRate: 8 90 | --- !u!212 &21213706 91 | SpriteRenderer: 92 | m_ObjectHideFlags: 1 93 | m_PrefabParentObject: {fileID: 0} 94 | m_PrefabInternal: {fileID: 100100000} 95 | m_GameObject: {fileID: 130202} 96 | m_Enabled: 1 97 | m_CastShadows: 0 98 | m_ReceiveShadows: 0 99 | m_Materials: 100 | - {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0} 101 | m_SubsetIndices: 102 | m_StaticBatchRoot: {fileID: 0} 103 | m_UseLightProbes: 0 104 | m_ReflectionProbeUsage: 0 105 | m_ProbeAnchor: {fileID: 0} 106 | m_ScaleInLightmap: 1 107 | m_PreserveUVs: 0 108 | m_IgnoreNormalsForChartDetection: 0 109 | m_ImportantGI: 0 110 | m_MinimumChartSize: 4 111 | m_AutoUVMaxDistance: 0.5 112 | m_AutoUVMaxAngle: 89 113 | m_LightmapParameters: {fileID: 0} 114 | m_SortingLayerID: 0 115 | m_SortingOrder: 1 116 | m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} 117 | m_Color: {r: 1, g: 1, b: 0.253, a: 1} 118 | m_FlipX: 0 119 | m_FlipY: 0 120 | --- !u!1001 &100100000 121 | Prefab: 122 | m_ObjectHideFlags: 1 123 | serializedVersion: 2 124 | m_Modification: 125 | m_TransformParent: {fileID: 0} 126 | m_Modifications: [] 127 | m_RemovedComponents: [] 128 | m_ParentPrefab: {fileID: 0} 129 | m_RootGameObject: {fileID: 194392} 130 | m_IsPrefabParent: 1 131 | -------------------------------------------------------------------------------- /Assets/Examples/2D/2dVehicleBase.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37914b158a30646ccb761198d521d3a6 3 | timeCreated: 1452952614 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Examples/2D/2d_boid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ricardojmendez/UnitySteerExamples/91dac8b4fbe8f28a171c28db0d757f644eade24b/Assets/Examples/2D/2d_boid.png -------------------------------------------------------------------------------- /Assets/Examples/2D/2d_boid.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e0029184792740999fa56f9ce82f64f 3 | timeCreated: 1453557401 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: 1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 8 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Examples/3D.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86b853a058f4d4cecacbe554c8dcce19 3 | folderAsset: yes 4 | timeCreated: 1452941366 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01a93beda49ac46e6b2dc7ec4d92081f 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/GoForPoint.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: beb9c12d951104c03b054a088366a363 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/GoForPointController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnitySteer.Behaviors; 4 | 5 | [RequireComponent(typeof(AutonomousVehicle)), RequireComponent(typeof(SteerForPoint))] 6 | public class GoForPointController : MonoBehaviour 7 | { 8 | SteerForPoint _steering; 9 | 10 | [SerializeField] 11 | Vector3 _pointRange = Vector3.one * 20; 12 | 13 | void Start() 14 | { 15 | _steering = GetComponent(); 16 | _steering.OnArrival += (_) => FindNewTarget(); 17 | FindNewTarget(); 18 | } 19 | 20 | 21 | void FindNewTarget() 22 | { 23 | _steering.TargetPoint = Vector3.Scale(Random.onUnitSphere, _pointRange); 24 | _steering.enabled = true; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/GoForPointController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3653232216614f308161b9b29e1be65 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/Neighbor examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3bece74c45364d78b2328927cde2710 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/Neighbor examples/Neighbors-Alignment-Cohesion.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6dfe20f6bf494af1af5b8a10d355f4a 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/Neighbor examples/Neighbors-Alignment-Cohesion.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ab9bc2dc8c464f12997eadfa184624d 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/Neighbor examples/Neighbors-Alignment-Separation.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 485041d6e93b64e90a6cae1ccd92f17d 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/Neighbor examples/Neighbors-Alignment-Separation.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01d7db3bf53764019ac7be392bbb28ff 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/Neighbor examples/Neighbors-Alignment.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57f2aa1b043054df49a9559e44b06ad0 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/Neighbor examples/Neighbors-Alignment.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 510988198fa074f7e92247c852ad1d8e 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/Neighbor examples/Neighbors-Cohesion.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 558b1457b5a7d4e3fb2f5fd11edf6c47 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/Neighbor examples/Neighbors-Cohesion.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c8a2fd7f96c743be9f16e970ece4d75 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/Neighbor examples/Neighbors-Separation.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89ba50b41b2244e51a40bd39f1ab76fb 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/Neighbor examples/Neighbors-Separation.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f713ae8df633e490bbc2395f284ea1e1 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/PathFollowing-WithSpline.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21cfc69e4ec154f8e9eece3627333d51 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/PathFollowing.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6dc5373b62ae84d329d1158ef0f7dd83 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/PathFollowingController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using UnitySteer; 6 | using UnitySteer.Behaviors; 7 | 8 | [RequireComponent(typeof(SteerForPathSimplified))] 9 | public class PathFollowingController : MonoBehaviour 10 | { 11 | 12 | SteerForPathSimplified _steering; 13 | 14 | [SerializeField] Transform _pathRoot; 15 | 16 | [SerializeField] bool _followAsSpline; 17 | 18 | // Use this for initialization 19 | void Start() 20 | { 21 | _steering = GetComponent(); 22 | AssignPath(); 23 | } 24 | 25 | 26 | void AssignPath() 27 | { 28 | // Get a list of points to follow; 29 | var pathPoints = PathFromRoot(_pathRoot); 30 | _steering.Path = _followAsSpline ? new SplinePathway(pathPoints, 1) : new Vector3Pathway(pathPoints, 1); 31 | } 32 | 33 | static List PathFromRoot(Transform root) 34 | { 35 | var children = new List(); 36 | foreach (Transform t in root) 37 | { 38 | if (t != null) 39 | { 40 | children.Add(t); 41 | } 42 | } 43 | return children.OrderBy(t => t.gameObject.name).Select(t => t.position).ToList(); 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/PathFollowingController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b55b22702f4a465b9140760e6186737 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Examples/3D/01 - Basic/Wandering.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c050cdc1c30484e85b2cf3ad1c1faf8a 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/02 - Intermediate.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1babd515b9e534bfb9606562fde6134b 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Examples/3D/02 - Intermediate/Evasion-Pursuit-1.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff74ade5b81e74cecb2044ccef75a7e5 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/02 - Intermediate/Evasion-Pursuit-2.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0a944547a80d4f839a20d91a4fda92e 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/02 - Intermediate/Pursuit-vs-Follow.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ec07fcf1b5f74df7b81641508484917 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e15e087ee029b4090b47b65b8d2bed61 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/ObstacleAvoidance.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 584b7db8c93524a3f86f8390ba4b6be9 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/ObstacleAvoidance/DestroyOnCollision.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnitySteer.Behaviors; 4 | 5 | public class DestroyOnCollision : MonoBehaviour 6 | { 7 | 8 | void OnTriggerEnter(Collider other) 9 | { 10 | if (Time.time < 2) return; 11 | 12 | var vehicle = other.GetComponent(); 13 | if (vehicle) 14 | { 15 | var renderer = other.GetComponentInChildren(); 16 | renderer.material.color = Color.blue; 17 | 18 | Debug.LogWarning(string.Format("{2} Destroying {0} upon collision with {1}", gameObject, vehicle, Time.time)); 19 | Destroy(gameObject); 20 | } 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/ObstacleAvoidance/DestroyOnCollision.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 470e0d314ab78486bbf5f25816a48d60 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/ObstacleAvoidance/Obstacle.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 33: {fileID: 3300000} 12 | - 136: {fileID: 13600000} 13 | - 23: {fileID: 2300000} 14 | - 114: {fileID: 11400002} 15 | - 114: {fileID: 11400000} 16 | - 114: {fileID: 11400004} 17 | m_Layer: 0 18 | m_Name: Obstacle 19 | m_TagString: Untagged 20 | m_Icon: {fileID: 0} 21 | m_NavMeshLayer: 0 22 | m_StaticEditorFlags: 0 23 | m_IsActive: 1 24 | --- !u!4 &400000 25 | Transform: 26 | m_ObjectHideFlags: 1 27 | m_PrefabParentObject: {fileID: 0} 28 | m_PrefabInternal: {fileID: 100100000} 29 | m_GameObject: {fileID: 100000} 30 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 31 | m_LocalPosition: {x: -3.41113377, y: 0, z: 10.4719372} 32 | m_LocalScale: {x: .5, y: .5, z: .5} 33 | m_Children: [] 34 | m_Father: {fileID: 0} 35 | m_RootOrder: 0 36 | --- !u!23 &2300000 37 | Renderer: 38 | m_ObjectHideFlags: 1 39 | m_PrefabParentObject: {fileID: 0} 40 | m_PrefabInternal: {fileID: 100100000} 41 | m_GameObject: {fileID: 100000} 42 | m_Enabled: 1 43 | m_CastShadows: 1 44 | m_ReceiveShadows: 1 45 | m_LightmapIndex: 255 46 | m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0} 47 | m_Materials: 48 | - {fileID: 2100000, guid: 2a6d6c1505ad145308f740f3c20b5326, type: 2} 49 | m_SubsetIndices: 50 | m_StaticBatchRoot: {fileID: 0} 51 | m_UseLightProbes: 0 52 | m_LightProbeAnchor: {fileID: 0} 53 | m_ScaleInLightmap: 1 54 | m_SortingLayerID: 0 55 | m_SortingOrder: 0 56 | --- !u!33 &3300000 57 | MeshFilter: 58 | m_ObjectHideFlags: 1 59 | m_PrefabParentObject: {fileID: 0} 60 | m_PrefabInternal: {fileID: 100100000} 61 | m_GameObject: {fileID: 100000} 62 | m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} 63 | --- !u!114 &11400000 64 | MonoBehaviour: 65 | m_ObjectHideFlags: 1 66 | m_PrefabParentObject: {fileID: 0} 67 | m_PrefabInternal: {fileID: 100100000} 68 | m_GameObject: {fileID: 100000} 69 | m_Enabled: 1 70 | m_EditorHideFlags: 0 71 | m_Script: {fileID: 11500000, guid: 073a49e84f5bf4fc99b9f8a4d922f686, type: 3} 72 | m_Name: 73 | m_EditorClassIdentifier: 74 | Radius: {x: 20, y: 20, z: 20} 75 | AllowedAxes: {x: 1, y: 1, z: 1} 76 | RandomizeRotation: 1 77 | --- !u!114 &11400002 78 | MonoBehaviour: 79 | m_ObjectHideFlags: 1 80 | m_PrefabParentObject: {fileID: 0} 81 | m_PrefabInternal: {fileID: 100100000} 82 | m_GameObject: {fileID: 100000} 83 | m_Enabled: 1 84 | m_EditorHideFlags: 0 85 | m_Script: {fileID: 11500000, guid: f7437c9e6603c404bb91cbc45fe71c78, type: 3} 86 | m_Name: 87 | m_EditorClassIdentifier: 88 | _drawGizmos: 1 89 | _center: {x: 0, y: 0, z: 0} 90 | _radius: .75 91 | --- !u!114 &11400004 92 | MonoBehaviour: 93 | m_ObjectHideFlags: 1 94 | m_PrefabParentObject: {fileID: 0} 95 | m_PrefabInternal: {fileID: 100100000} 96 | m_GameObject: {fileID: 100000} 97 | m_Enabled: 1 98 | m_EditorHideFlags: 0 99 | m_Script: {fileID: 11500000, guid: 470e0d314ab78486bbf5f25816a48d60, type: 3} 100 | m_Name: 101 | m_EditorClassIdentifier: 102 | --- !u!136 &13600000 103 | CapsuleCollider: 104 | m_ObjectHideFlags: 1 105 | m_PrefabParentObject: {fileID: 0} 106 | m_PrefabInternal: {fileID: 100100000} 107 | m_GameObject: {fileID: 100000} 108 | m_Material: {fileID: 0} 109 | m_IsTrigger: 1 110 | m_Enabled: 1 111 | m_Radius: .5 112 | m_Height: 2 113 | m_Direction: 1 114 | m_Center: {x: 0, y: 0, z: 0} 115 | --- !u!1001 &100100000 116 | Prefab: 117 | m_ObjectHideFlags: 1 118 | serializedVersion: 2 119 | m_Modification: 120 | m_TransformParent: {fileID: 0} 121 | m_Modifications: [] 122 | m_RemovedComponents: [] 123 | m_ParentPrefab: {fileID: 0} 124 | m_RootGameObject: {fileID: 100000} 125 | m_IsPrefabParent: 1 126 | m_IsExploded: 1 127 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/ObstacleAvoidance/Obstacle.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 647860cd1d7864a008b44515b11a5deb 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/ObstacleAvoidance/ObstacleAvoidance.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7f6b34ed80ec4998b9654780a51c08d 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/ObstacleAvoidance/ObstacleAvoidanceBoid.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6acf8f84af07a4f4f9538fc6be2f6dac 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/ObstacleAvoidance/PrefabInstantiator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class PrefabInstantiator : MonoBehaviour { 5 | [SerializeField] 6 | GameObject _prefab; 7 | 8 | [SerializeField] 9 | int _amount = 100; 10 | 11 | 12 | // Use this for initialization 13 | void Start() 14 | { 15 | for (int i = 0; i < _amount; i++) 16 | { 17 | Instantiate(_prefab, transform.position, Quaternion.identity); 18 | } 19 | Destroy(this); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/ObstacleAvoidance/PrefabInstantiator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee08e951874db41ba8d6a1341214f0a6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-PlanarX.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b729ba18dcece45dea903736f4a6d7d7 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-PlanarX/Tag-PlanarX.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e540d166c0d6b402abe8d8790a65717b 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-PlanarX/TagPlayerPlanarX.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c40e01baccf87476a83f62a0aca73f44 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-PlanarY.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f194dbecf18542f6b0057a3569cf436 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-PlanarY/Tag-PlanarY.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a464fbe841df34d4ca8d32e293ae24bc 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-PlanarY/TagPlayerPlanarY.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00fd28988c5744ca08d119ecae7ed291 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-PlanarZ.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aad59df06ed014b3a87d2e963b7be10b 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-PlanarZ/Tag-PlanarZ.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef6456a528f2c48fea4b68b3668aecfb 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-PlanarZ/TagPlayerPlanarZ.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b61e30ee14f4941c49b09686214c1964 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-With Obstacles.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15e57ee7af15a4a5ba492cd80bc0cbc5 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-With Obstacles/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34dd8dc113d7c404595ca3dc77fe691d 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-With Obstacles/Materials/PreyMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: PreyMaterial 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | - GLOW11_MULTIPLY_GLOWCOLOR 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | data: 25 | first: 26 | name: _GlowTex 27 | second: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | m_Floats: 32 | data: 33 | first: 34 | name: _GlowStrength 35 | second: 1 36 | m_Colors: 37 | data: 38 | first: 39 | name: _Color 40 | second: {r: 1, g: .977484763, b: .183823526, a: 1} 41 | data: 42 | first: 43 | name: _GlowColor 44 | second: {r: 1, g: .754766703, b: .316176474, a: .427450985} 45 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-With Obstacles/Materials/PreyMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c741c73bf1df24eab89c0edca0a22406 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-With Obstacles/Materials/SuccessMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: SuccessMaterial 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | - GLOW11_MULTIPLY_GLOWCOLOR 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | data: 25 | first: 26 | name: _GlowTex 27 | second: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | m_Floats: 32 | data: 33 | first: 34 | name: _GlowStrength 35 | second: 2 36 | m_Colors: 37 | data: 38 | first: 39 | name: _Color 40 | second: {r: 1, g: .183823526, b: .183823526, a: 1} 41 | data: 42 | first: 43 | name: _GlowColor 44 | second: {r: 1, g: .754766703, b: .316176474, a: .427450985} 45 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-With Obstacles/Materials/SuccessMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1f80855bb20d48869c5aa6958d80284 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-With Obstacles/Materials/Trail.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Trail 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 0} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | m_Floats: {} 24 | m_Colors: 25 | data: 26 | first: 27 | name: _Color 28 | second: {r: .954969525, g: 1, b: .183823526, a: 1} 29 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-With Obstacles/Materials/Trail.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dcb0301b70a124bac9a67a6781f70cc8 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-With Obstacles/TagPlayerAvoider.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 78dd5000b5fbe401399ab2011eba4af7 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag-With Obstacles/TagWithObstacles.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2944475f2243844648aa4839774270d7 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f11d6e92778884295afd5c5824854227 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag/Behaviors.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ec68d6cfd02c40978d39d37e5caa382 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag/Behaviors/TagPlayer.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using UnityEngine; 3 | using UnitySteer.Behaviors; 4 | 5 | [RequireComponent(typeof (AutonomousVehicle))] 6 | public class TagPlayer : MonoBehaviour 7 | { 8 | public enum PlayerState 9 | { 10 | Neutral, 11 | Pursuer, 12 | Prey 13 | } 14 | 15 | private PlayerState _state = PlayerState.Neutral; 16 | 17 | private Material _baseMaterial; 18 | 19 | [SerializeField] private float _originalRadius = 0.3f; 20 | 21 | [SerializeField] private float _sizeVariance = 0.2f; 22 | 23 | [SerializeField] private Renderer _renderer; 24 | 25 | [SerializeField] private Material _glowMaterial; 26 | 27 | [SerializeField] private Material _preyMaterial; 28 | 29 | public AutonomousVehicle Vehicle { get; set; } 30 | public SteerForPursuit ForPursuit { get; private set; } 31 | public SteerForNeighborGroup ForNeighbors { get; private set; } 32 | public SteerForWander ForWander { get; private set; } 33 | public SteerForEvasion ForEvasion { get; private set; } 34 | 35 | public float OriginalSpeed { get; private set; } 36 | public float OriginalTurnTime { get; private set; } 37 | 38 | public PlayerState State 39 | { 40 | get { return _state; } 41 | set { SetState(value); } 42 | } 43 | 44 | public TrailRenderer Trail { get; private set; } 45 | 46 | public void ChangeSize(float percent) 47 | { 48 | Vehicle = GetComponent(); 49 | Vehicle.MaxSpeed *= 1 + percent; 50 | Vehicle.TurnTime *= 1 - (2 * percent); 51 | Vehicle.Transform.localScale *= 1 - (2 * percent); 52 | Vehicle.ScaleRadiusWithTransform(_originalRadius); 53 | 54 | OriginalSpeed = Vehicle.MaxSpeed; 55 | OriginalTurnTime = Vehicle.TurnTime; 56 | } 57 | 58 | public void Grow() 59 | { 60 | ChangeSize(-0.4f); 61 | _renderer.material = _glowMaterial; 62 | var tween = Go.to(transform, 0.3f, new GoTweenConfig().scale(2f, true).setIterations(8, GoLoopType.PingPong)); 63 | tween.setOnCompleteHandler(x => _renderer.material = _baseMaterial); 64 | } 65 | 66 | public void Die() 67 | { 68 | transform.scaleTo(1.5f, 0.1f).setOnCompleteHandler(x => Destroy(gameObject)); 69 | } 70 | 71 | private void Awake() 72 | { 73 | _sizeVariance = Mathf.Clamp(_sizeVariance, 0, 0.45f); 74 | 75 | var difference = Random.Range(-_sizeVariance, _sizeVariance); 76 | ChangeSize(difference); 77 | 78 | ForPursuit = GetComponent(); 79 | ForNeighbors = GetComponent(); 80 | ForWander = GetComponent(); 81 | ForEvasion = GetComponent(); 82 | 83 | ForPursuit.OnArrival += OnReachPrey; 84 | 85 | Trail = GetComponent(); 86 | _baseMaterial = _renderer.material; 87 | } 88 | 89 | private void OnEnable() 90 | { 91 | TagPlayerManager.Instance.Players.Add(this); 92 | } 93 | 94 | private void OnDisable() 95 | { 96 | // Debug.Log(string.Format("{0} OnDisable called on {1}", Time.time, this)); 97 | TagPlayerManager.Instance.Players.Remove(this); 98 | } 99 | 100 | 101 | private void SetState(PlayerState state) 102 | { 103 | Vehicle.MaxSpeed = OriginalSpeed; 104 | Vehicle.TurnTime = OriginalTurnTime; 105 | _state = state; 106 | switch (_state) 107 | { 108 | case PlayerState.Neutral: 109 | _renderer.material = _baseMaterial; 110 | _renderer.material.color = Color.white; 111 | break; 112 | case PlayerState.Prey: 113 | Vehicle.MaxSpeed *= 1.75f; 114 | Vehicle.TurnTime *= 0.95f; 115 | _renderer.material = _preyMaterial; 116 | _renderer.material.color = Color.yellow; 117 | break; 118 | case PlayerState.Pursuer: 119 | Vehicle.MaxSpeed *= 2f; 120 | _renderer.material.color = Color.red; 121 | break; 122 | } 123 | ForPursuit.enabled = State == PlayerState.Pursuer; 124 | ForWander.enabled = State == PlayerState.Neutral; 125 | ForNeighbors.enabled = State != PlayerState.Prey; 126 | ForEvasion.enabled = State == PlayerState.Prey; 127 | Trail.enabled = State == PlayerState.Prey; 128 | } 129 | 130 | // Update is called once per frame 131 | private void Update() 132 | { 133 | // Every frame, try to avoid the nearest attacker if we're the prey. 134 | if (State == PlayerState.Prey) 135 | { 136 | var closest = 137 | TagPlayerManager.Instance.Players.Where(x => x != this) 138 | .OrderBy(x => (x.Vehicle.Position - Vehicle.Position).sqrMagnitude) 139 | .First(); 140 | ForEvasion.Menace = closest.Vehicle; 141 | } 142 | } 143 | 144 | private void OnReachPrey(Steering steering) 145 | { 146 | TagPlayerManager.Instance.CapturedPrey(this); 147 | } 148 | } -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag/Behaviors/TagPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1ed4b2bcdc854f2cb5f806f875e56ad 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag/Behaviors/TagPlayerManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | public class TagPlayerManager : MonoBehaviour 7 | { 8 | public static TagPlayerManager Instance 9 | { 10 | get { return SingletonPerLevel.Instance; } 11 | } 12 | 13 | 14 | [SerializeField] 15 | TagPlayer _prefab; 16 | 17 | [SerializeField] 18 | int _playersToInitialize = 30; 19 | 20 | [SerializeField] 21 | float _pauseBetweenGames = 5f; 22 | 23 | [SerializeField] 24 | float _gameTime = 25f; 25 | 26 | [SerializeField] 27 | float _preyHeadStart = 2f; 28 | 29 | 30 | public float NextGameStart { get; private set; } 31 | public float NextGameEnd { get; private set; } 32 | 33 | public bool IsGameTime 34 | { 35 | get { return Time.time >= NextGameStart && Time.time < NextGameEnd; } 36 | } 37 | public bool IsGamePlaying { get; private set; } 38 | 39 | public List Players = new List(); 40 | 41 | 42 | public void CapturedPrey(TagPlayer player) 43 | { 44 | StopGame(); 45 | Debug.Log(string.Format("{0} {1} captured prey!", Time.time, player)); 46 | player.Grow(); 47 | var quarry = player.ForPursuit.Quarry.GetComponent(); 48 | quarry.Die(); 49 | Destroy(player.ForPursuit.Quarry.gameObject); 50 | } 51 | 52 | 53 | void Start() 54 | { 55 | SetUpNextGameTime(); 56 | for (int i = 0; i < _playersToInitialize; i++) 57 | { 58 | Instantiate(_prefab); 59 | } 60 | } 61 | 62 | void Update() 63 | { 64 | if (!IsGamePlaying && IsGameTime) 65 | { 66 | StartGame(); 67 | } 68 | else if (IsGamePlaying && !IsGameTime) 69 | { 70 | StopGame(); 71 | } 72 | } 73 | 74 | void SetUpNextGameTime() 75 | { 76 | NextGameStart = Time.time + _pauseBetweenGames; 77 | NextGameEnd = NextGameStart + _gameTime; 78 | IsGamePlaying = false; 79 | } 80 | 81 | void StartGame() 82 | { 83 | Debug.Log(string.Format("{0} Starting game", Time.time)); 84 | StartCoroutine(StartGameEnumerator()); 85 | } 86 | 87 | IEnumerator StartGameEnumerator() 88 | { 89 | IsGamePlaying = true; 90 | var prey = Players.OrderBy(x => Random.value).First(); 91 | prey.State = TagPlayer.PlayerState.Prey; 92 | prey.name = "Prey"; 93 | yield return new WaitForSeconds(_preyHeadStart); 94 | foreach(var attacker in Players.Where(x => x != prey && IsGamePlaying)) 95 | { 96 | attacker.State = TagPlayer.PlayerState.Pursuer; 97 | attacker.ForPursuit.Quarry = prey.Vehicle; 98 | attacker.name = string.Format("Attacker [{0}]", attacker.GetInstanceID()); 99 | yield return null; 100 | if (!IsGamePlaying) 101 | { 102 | yield break; 103 | } 104 | } 105 | } 106 | 107 | 108 | void StopGame() 109 | { 110 | Debug.Log(string.Format("{0} Stopping game", Time.time)); 111 | foreach(var player in Players) 112 | { 113 | player.State = TagPlayer.PlayerState.Neutral; 114 | } 115 | SetUpNextGameTime(); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag/Behaviors/TagPlayerManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: baf4736c3953441d1ac35d114a9ed7e8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce42a33887907436cbb8e84eff64bcbe 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag/Materials/PreyMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: PreyMaterial 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | - GLOW11_MULTIPLY_GLOWCOLOR 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | data: 25 | first: 26 | name: _GlowTex 27 | second: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | m_Floats: 32 | data: 33 | first: 34 | name: _GlowStrength 35 | second: 1 36 | m_Colors: 37 | data: 38 | first: 39 | name: _Color 40 | second: {r: 1, g: .977484763, b: .183823526, a: 1} 41 | data: 42 | first: 43 | name: _GlowColor 44 | second: {r: 1, g: .754766703, b: .316176474, a: .427450985} 45 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag/Materials/PreyMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 622b0610be8974f96b46932909a4293f 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag/Materials/SuccessMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: SuccessMaterial 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | - GLOW11_MULTIPLY_GLOWCOLOR 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | data: 25 | first: 26 | name: _GlowTex 27 | second: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | m_Floats: 32 | data: 33 | first: 34 | name: _GlowStrength 35 | second: 2 36 | m_Colors: 37 | data: 38 | first: 39 | name: _Color 40 | second: {r: 1, g: .183823526, b: .183823526, a: 1} 41 | data: 42 | first: 43 | name: _GlowColor 44 | second: {r: 1, g: .754766703, b: .316176474, a: .427450985} 45 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag/Materials/SuccessMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 851513aea6a5c4aa1a9f04f20c50ebab 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag/Materials/Trail.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Trail 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 0} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | m_Floats: {} 24 | m_Colors: 25 | data: 26 | first: 27 | name: _Color 28 | second: {r: .954969525, g: 1, b: .183823526, a: 1} 29 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag/Materials/Trail.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bf504baee8104b8a9616d655e028da3 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag/Tag.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 63a5f7e9a780f43fa8f8d9cfa169650b 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Examples/3D/03 - Advanced/PlayingTag/TagPlayer.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8122fb865ec44e198fa78b217dc33dc 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Light.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da04db0db96084b209785eae96794298 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11a782ab3eb974b86804e46dc7668562 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Materials/Green.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Green 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 0} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | m_Floats: {} 24 | m_Colors: 25 | data: 26 | first: 27 | name: _Color 28 | second: {r: 0, g: 1, b: 0, a: 1} 29 | -------------------------------------------------------------------------------- /Assets/Materials/Green.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7dc63450aea9f4eb6a1ab60cbc0b42c0 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Materials/Grid.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Grid 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 2800000, guid: 8b23c9e3952e246c180a8080104ae60b, type: 3} 21 | m_Scale: {x: 100, y: 100} 22 | m_Offset: {x: 0, y: 0} 23 | m_Floats: {} 24 | m_Colors: 25 | data: 26 | first: 27 | name: _Color 28 | second: {r: 1, g: 1, b: 1, a: 1} 29 | -------------------------------------------------------------------------------- /Assets/Materials/Grid.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce691b955541a49b9afb800af1352e80 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Materials/Red.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Red 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 0} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | m_Floats: {} 24 | m_Colors: 25 | data: 26 | first: 27 | name: _Color 28 | second: {r: 1, g: 0, b: 0, a: 1} 29 | -------------------------------------------------------------------------------- /Assets/Materials/Red.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a6d6c1505ad145308f740f3c20b5326 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Materials/Yellow.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Yellow 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 0} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | m_Floats: {} 24 | m_Colors: 25 | data: 26 | first: 27 | name: _Color 28 | second: {r: 1, g: 1, b: 0, a: 1} 29 | -------------------------------------------------------------------------------- /Assets/Materials/Yellow.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4649ae0b83844f74867815df8846a13 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7ff989c2c0c94b49837991ec02ca433 3 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c5cefa129e0c4945acf6eb49a983eae 3 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/Go.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aabcf1780fb4540bbb12fde714c3f88a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/GoDummyPath.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | /// 7 | /// place this script on any GameObject to enable route editing. note that it is not required at runtime! it is 8 | /// only required to be in your scene while editing a path 9 | /// 10 | public class GoDummyPath : MonoBehaviour 11 | { 12 | public string pathName = string.Empty; 13 | public Color pathColor = Color.magenta; // color of the path if visible in the editor 14 | public List nodes = new List() { Vector3.zero, Vector3.zero }; 15 | public bool useStandardHandles = false; 16 | public bool forceStraightLinePath = false; 17 | public int pathResolution = 50; 18 | 19 | 20 | public void OnDrawGizmos() 21 | { 22 | // the editor will draw paths when force straight line is on 23 | if( !forceStraightLinePath ) 24 | { 25 | var spline = new GoSpline( nodes ); 26 | Gizmos.color = pathColor; 27 | spline.drawGizmos( pathResolution ); 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/GoDummyPath.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25af92ea012eb4667a9c36cc4a72a725 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/GoTween.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5e29433d2fb8417c9b59ce3453f2ca3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/GoTweenChain.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | public class GoTweenChain : AbstractGoTweenCollection 6 | { 7 | public GoTweenChain() : this(new GoTweenCollectionConfig()) {} 8 | public GoTweenChain(GoTweenCollectionConfig config) : base(config) {} 9 | 10 | #region internal Chain management 11 | 12 | private void append( TweenFlowItem item ) 13 | { 14 | // early out for invalid items 15 | if( item.tween != null && !item.tween.isValid() ) 16 | return; 17 | 18 | if( float.IsInfinity( item.duration ) ) 19 | { 20 | Debug.Log( "adding a Tween with infinite iterations to a TweenChain is not permitted" ); 21 | return; 22 | } 23 | 24 | // ensure the tween isnt already live 25 | if( item.tween != null ) 26 | Go.removeTween( item.tween ); 27 | 28 | _tweenFlows.Add( item ); 29 | 30 | // update the duration and total duration 31 | duration += item.duration; 32 | 33 | if( iterations > 0 ) 34 | totalDuration = duration * iterations; 35 | else 36 | totalDuration = float.PositiveInfinity; 37 | } 38 | 39 | 40 | private void prepend( TweenFlowItem item ) 41 | { 42 | // early out for invalid items 43 | if( item.tween != null && !item.tween.isValid() ) 44 | return; 45 | 46 | if( float.IsInfinity( item.duration ) ) 47 | { 48 | Debug.Log( "adding a Tween with infinite iterations to a TweenChain is not permitted" ); 49 | return; 50 | } 51 | 52 | // ensure the tween isnt already live 53 | if( item.tween != null ) 54 | Go.removeTween( item.tween ); 55 | 56 | // fix all the start times on our previous chains 57 | foreach( var ci in _tweenFlows ) 58 | ci.startTime += item.duration; 59 | 60 | _tweenFlows.Add( item ); 61 | 62 | // update the duration and total duration 63 | duration += item.duration; 64 | totalDuration = duration * iterations; 65 | } 66 | 67 | #endregion 68 | 69 | 70 | #region Chain management 71 | 72 | /// 73 | /// appends a Tween at the end of the current flow 74 | /// 75 | public GoTweenChain append( AbstractGoTween tween ) 76 | { 77 | var item = new TweenFlowItem( duration, tween ); 78 | append( item ); 79 | 80 | return this; 81 | } 82 | 83 | 84 | /// 85 | /// appends a delay to the end of the current flow 86 | /// 87 | public GoTweenChain appendDelay( float delay ) 88 | { 89 | var item = new TweenFlowItem( duration, delay ); 90 | append( item ); 91 | 92 | return this; 93 | } 94 | 95 | 96 | /// 97 | /// adds a Tween to the front of the flow 98 | /// 99 | public GoTweenChain prepend( AbstractGoTween tween ) 100 | { 101 | var item = new TweenFlowItem( 0, tween ); 102 | prepend( item ); 103 | 104 | return this; 105 | } 106 | 107 | 108 | /// 109 | /// adds a delay to the front of the flow 110 | /// 111 | public GoTweenChain prependDelay( float delay ) 112 | { 113 | var item = new TweenFlowItem( 0, delay ); 114 | prepend( item ); 115 | 116 | return this; 117 | } 118 | 119 | #endregion 120 | 121 | } 122 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/GoTweenChain.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4985888b83c04c04b428c6b4d0e9e13 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/GoTweenCollectionConfig.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | 7 | public class GoTweenCollectionConfig 8 | { 9 | public int id; // id for finding the Tween at a later time. multiple Tweens can have the same id 10 | public int iterations = 1; // number of times to iterate. -1 will loop indefinitely 11 | public GoLoopType loopType = Go.defaultLoopType; 12 | public GoUpdateType propertyUpdateType = Go.defaultUpdateType; 13 | public Action onCompleteHandler; 14 | public Action onStartHandler; 15 | 16 | 17 | /// 18 | /// sets the number of iterations. setting to -1 will loop infinitely 19 | /// 20 | public GoTweenCollectionConfig setIterations( int iterations ) 21 | { 22 | this.iterations = iterations; 23 | return this; 24 | } 25 | 26 | 27 | /// 28 | /// sets the number of iterations and the loop type. setting to -1 will loop infinitely 29 | /// 30 | public GoTweenCollectionConfig setIterations( int iterations, GoLoopType loopType ) 31 | { 32 | this.iterations = iterations; 33 | this.loopType = loopType; 34 | return this; 35 | } 36 | 37 | 38 | /// 39 | /// sets the update type for the Tween 40 | /// 41 | public GoTweenCollectionConfig setUpdateType( GoUpdateType setUpdateType ) 42 | { 43 | this.propertyUpdateType = setUpdateType; 44 | return this; 45 | } 46 | 47 | 48 | /// 49 | /// sets the onComplete handler for the Tween 50 | /// 51 | public GoTweenCollectionConfig onComplete( Action onComplete ) 52 | { 53 | onCompleteHandler = onComplete; 54 | return this; 55 | } 56 | 57 | 58 | /// 59 | /// sets the onStart handler for the Tween 60 | /// 61 | public GoTweenCollectionConfig onStart( Action onStart ) 62 | { 63 | onStartHandler = onStart; 64 | return this; 65 | } 66 | 67 | 68 | /// 69 | /// sets the id for the Tween. Multiple Tweens can have the same id and you can retrieve them with the Go class 70 | /// 71 | public GoTweenCollectionConfig setId( int id ) 72 | { 73 | this.id = id; 74 | return this; 75 | 76 | } 77 | 78 | } -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/GoTweenCollectionConfig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7185ad0c8a70049eca0a038c37d2b5dd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/GoTweenConfig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 110c83c73e3544e7785938ec38e5361e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/GoTweenFlow.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | /// 6 | /// TweenFlows are used for creating a chain of Tweens via the append/prepend methods. You can also get timeline 7 | /// like control by inserting Tweens and setting them to start at a specific time. Note that TweenFlows do not 8 | /// honor the delays set within regular Tweens. Use the append/prependDelay method to add any required delays 9 | /// 10 | public class GoTweenFlow : AbstractGoTweenCollection 11 | { 12 | public GoTweenFlow() : this(new GoTweenCollectionConfig()) {} 13 | public GoTweenFlow(GoTweenCollectionConfig config) : base(config) {} 14 | 15 | #region internal Flow management 16 | 17 | /// 18 | /// the item being added already has a start time so no extra parameter is needed 19 | /// 20 | private void insert( TweenFlowItem item ) 21 | { 22 | // early out for invalid items 23 | if( item.tween != null && !item.tween.isValid() ) 24 | return; 25 | 26 | if( float.IsInfinity( item.duration ) ) 27 | { 28 | Debug.Log( "adding a Tween with infinite iterations to a TweenFlow is not permitted" ); 29 | return; 30 | } 31 | 32 | // ensure the tween isnt already live 33 | if( item.tween != null ) 34 | Go.removeTween( item.tween ); 35 | 36 | // add the item then sort based on startTimes 37 | _tweenFlows.Add( item ); 38 | _tweenFlows.Sort( ( x, y ) => 39 | { 40 | return x.startTime.CompareTo( y.startTime ); 41 | } ); 42 | 43 | duration = Mathf.Max( item.startTime + item.duration, duration ); 44 | totalDuration = duration * iterations; 45 | } 46 | 47 | #endregion 48 | 49 | 50 | #region Flow management 51 | 52 | /// 53 | /// inserts a Tween and sets it to start at the given startTime 54 | /// 55 | public GoTweenFlow insert( float startTime, AbstractGoTween tween ) 56 | { 57 | var item = new TweenFlowItem( startTime, tween ); 58 | insert( item ); 59 | 60 | return this; 61 | } 62 | 63 | #endregion 64 | 65 | 66 | } 67 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/GoTweenFlow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc32096ae2bba43da839e42c553f294c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/base.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a0650221f37549c4988877fdaa5e4bb 3 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/base/AbstractGoTween.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8eb47665d5434148a4bd7391644861a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/base/AbstractGoTweenCollection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c011ef2561dca4c2492fdbf1b78d96a8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34b16834b4ced4d9a9b03c6d00303ad5 3 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseBack.cs: -------------------------------------------------------------------------------- 1 | public static class GoEaseBack 2 | { 3 | public static float EaseIn( float t, float b, float c, float d ) 4 | { 5 | return c * ( t /= d ) * t * ( ( 1.70158f + 1 ) * t - 1.70158f ) + b; 6 | } 7 | 8 | 9 | public static float EaseOut( float t, float b, float c, float d ) 10 | { 11 | return c * ( ( t = t / d - 1 ) * t * ( ( 1.70158f + 1 ) * t + 1.70158f ) + 1 ) + b; 12 | } 13 | 14 | 15 | public static float EaseInOut( float t, float b, float c, float d ) 16 | { 17 | float s = 1.70158f; 18 | if( ( t /= d / 2 ) < 1 ) 19 | { 20 | return c / 2 * ( t * t * ( ( ( s *= ( 1.525f ) ) + 1 ) * t - s ) ) + b; 21 | } 22 | return c / 2 * ( ( t -= 2 ) * t * ( ( ( s *= ( 1.525f ) ) + 1 ) * t + s ) + 2 ) + b; 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseBack.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e44fd25dcb7704da0a39cfe042b81293 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseBounce.cs: -------------------------------------------------------------------------------- 1 | public static class GoEaseBounce 2 | { 3 | public static float EaseOut( float t, float b, float c, float d ) 4 | { 5 | if( ( t /= d ) < ( 1 / 2.75 ) ) 6 | { 7 | return c * ( 7.5625f * t * t ) + b; 8 | } 9 | else if( t < ( 2 / 2.75 ) ) 10 | { 11 | return c * ( 7.5625f * ( t -= ( 1.5f / 2.75f ) ) * t + .75f ) + b; 12 | } 13 | else if( t < ( 2.5 / 2.75 ) ) 14 | { 15 | return c * ( 7.5625f * ( t -= ( 2.25f / 2.75f ) ) * t + .9375f ) + b; 16 | } 17 | else 18 | { 19 | return c * ( 7.5625f * ( t -= ( 2.625f / 2.75f ) ) * t + .984375f ) + b; 20 | } 21 | } 22 | 23 | public static float EaseIn( float t, float b, float c, float d ) 24 | { 25 | return c - EaseOut( d - t, 0, c, d ) + b; 26 | } 27 | 28 | public static float EaseInOut( float t, float b, float c, float d ) 29 | { 30 | if( t < d / 2 ) 31 | return EaseIn( t * 2, 0, c, d ) * 0.5f + b; 32 | else 33 | return EaseOut( t * 2 - d, 0, c, d ) * .5f + c * 0.5f + b; 34 | } 35 | } -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseBounce.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95777a3e9f3304c5f87d79f0035e7cce 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseCircular.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | public static class GoEaseCircular 5 | { 6 | public static float EaseIn( float t, float b, float c, float d ) 7 | { 8 | return -c * ( (float)Math.Sqrt( 1 - ( t /= d ) * t ) - 1 ) + b; 9 | } 10 | 11 | public static float EaseOut( float t, float b, float c, float d ) 12 | { 13 | return c * (float)Math.Sqrt( 1 - ( t = t / d - 1 ) * t ) + b; 14 | } 15 | 16 | public static float EaseInOut( float t, float b, float c, float d ) 17 | { 18 | if( ( t /= d / 2 ) < 1 ) 19 | { 20 | return -c / 2 * ( (float)Math.Sqrt( 1 - t * t ) - 1 ) + b; 21 | } 22 | return c / 2 * ( (float)Math.Sqrt( 1 - ( t -= 2 ) * t ) + 1 ) + b; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseCircular.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b7f811e7d59a41bf99d08c646d1725b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseCubic.cs: -------------------------------------------------------------------------------- 1 | public static class GoEaseCubic 2 | { 3 | public static float EaseIn( float t, float b, float c, float d ) 4 | { 5 | return c * ( t /= d ) * t * t + b; 6 | } 7 | 8 | public static float EaseOut( float t, float b, float c, float d ) 9 | { 10 | return c * ( ( t = t / d - 1 ) * t * t + 1 ) + b; 11 | } 12 | 13 | public static float EaseInOut( float t, float b, float c, float d ) 14 | { 15 | if( ( t /= d / 2 ) < 1 ) 16 | { 17 | return c / 2 * t * t * t + b; 18 | } 19 | return c / 2 * ( ( t -= 2 ) * t * t + 2 ) + b; 20 | } 21 | } -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseCubic.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7210f854113854752bdff44a9b562d42 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseElastic.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | public class GoEaseElastic 6 | { 7 | public static float EaseIn( float t, float b, float c, float d ) 8 | { 9 | if( t == 0 ) 10 | { 11 | return b; 12 | } 13 | if( ( t /= d ) == 1 ) 14 | { 15 | return b + c; 16 | } 17 | float p = d * .3f; 18 | float s = p / 4; 19 | return -(float)( c * Math.Pow( 2, 10 * ( t -= 1 ) ) * Math.Sin( ( t * d - s ) * ( 2 * Math.PI ) / p ) ) + b; 20 | } 21 | 22 | public static float EaseOut( float t, float b, float c, float d ) 23 | { 24 | if( t == 0 ) 25 | { 26 | return b; 27 | } 28 | if( ( t /= d ) == 1 ) 29 | { 30 | return b + c; 31 | } 32 | float p = d * .3f; 33 | float s = p / 4; 34 | return (float)( c * Math.Pow( 2, -10 * t ) * Math.Sin( ( t * d - s ) * ( 2 * Math.PI ) / p ) + c + b ); 35 | } 36 | 37 | public static float EaseInOut( float t, float b, float c, float d ) 38 | { 39 | if( t == 0 ) 40 | { 41 | return b; 42 | } 43 | if( ( t /= d / 2 ) == 2 ) 44 | { 45 | return b + c; 46 | } 47 | float p = d * ( .3f * 1.5f ); 48 | float a = c; 49 | float s = p / 4; 50 | if( t < 1 ) 51 | { 52 | return -.5f * (float)( a * Math.Pow( 2, 10 * ( t -= 1 ) ) * Math.Sin( ( t * d - s ) * ( 2 * Math.PI ) / p ) ) + b; 53 | } 54 | return (float)( a * Math.Pow( 2, -10 * ( t -= 1 ) ) * Math.Sin( ( t * d - s ) * ( 2 * Math.PI ) / p ) * .5 + c + b ); 55 | } 56 | 57 | public static float Punch( float t, float b, float c, float d ) 58 | { 59 | if( t == 0 ) 60 | return 0; 61 | 62 | if( ( t /= d ) == 1 ) 63 | return 0; 64 | 65 | const float p = 0.3f; 66 | return ( c * Mathf.Pow( 2, -10 * t ) * Mathf.Sin( t * ( 2 * Mathf.PI ) / p ) ); 67 | } 68 | } -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseElastic.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c183f70ddaf54b6caa706e2d7a15837 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseExponential.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | public static class GoEaseExponential 5 | { 6 | public static float EaseIn( float t, float b, float c, float d ) 7 | { 8 | return ( t == 0 ) ? b : c * (float)Math.Pow( 2, 10 * ( t / d - 1 ) ) + b; 9 | } 10 | 11 | public static float EaseOut( float t, float b, float c, float d ) 12 | { 13 | return ( t == d ) ? b + c : c * (float)( -Math.Pow( 2, -10 * t / d ) + 1 ) + b; 14 | } 15 | 16 | public static float EaseInOut( float t, float b, float c, float d ) 17 | { 18 | if( t == 0 ) 19 | { 20 | return b; 21 | } 22 | if( t == d ) 23 | { 24 | return b + c; 25 | } 26 | if( ( t /= d / 2 ) < 1 ) 27 | { 28 | return c / 2 * (float)Math.Pow( 2, 10 * ( t - 1 ) ) + b; 29 | } 30 | return c / 2 * (float)( -Math.Pow( 2, -10 * --t ) + 2 ) + b; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseExponential.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9db2ed7f90d404641b604f6db1368fcc 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseLinear.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | 4 | public static class GoEaseLinear 5 | { 6 | public static float EaseNone( float t, float b, float c, float d ) 7 | { 8 | return c * t / d + b; 9 | } 10 | } -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseLinear.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2f840d866998449683cf9b8a34c0b8f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseQuadratic.cs: -------------------------------------------------------------------------------- 1 | public static class GoEaseQuadratic 2 | { 3 | public static float EaseIn( float t, float b, float c, float d ) 4 | { 5 | return c * ( t /= d ) * t + b; 6 | } 7 | 8 | public static float EaseOut( float t, float b, float c, float d ) 9 | { 10 | return -c * ( t /= d ) * ( t - 2 ) + b; 11 | } 12 | 13 | public static float EaseInOut( float t, float b, float c, float d ) 14 | { 15 | if( ( t /= d / 2 ) < 1 ) 16 | { 17 | return c / 2 * t * t + b; 18 | } 19 | return -c / 2 * ( ( --t ) * ( t - 2 ) - 1 ) + b; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseQuadratic.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94e247c3236114f678e9ffffa07bfe09 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseQuartic.cs: -------------------------------------------------------------------------------- 1 | public static class GoEaseQuartic 2 | { 3 | public static float EaseIn( float t, float b, float c, float d ) 4 | { 5 | return c * ( t /= d ) * t * t * t + b; 6 | } 7 | 8 | public static float EaseOut( float t, float b, float c, float d ) 9 | { 10 | return -c * ( ( t = t / d - 1 ) * t * t * t - 1 ) + b; 11 | } 12 | 13 | public static float EaseInOut( float t, float b, float c, float d ) 14 | { 15 | if( ( t /= d / 2 ) < 1 ) 16 | { 17 | return c / 2 * t * t * t * t + b; 18 | } 19 | return -c / 2 * ( ( t -= 2 ) * t * t * t - 2 ) + b; 20 | } 21 | } -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseQuartic.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 178a095287feb40b3b2fb42327529cf3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseQuintic.cs: -------------------------------------------------------------------------------- 1 | public static class GoEaseQuintic 2 | { 3 | public static float EaseIn( float t, float b, float c, float d ) 4 | { 5 | return c * ( t /= d ) * t * t * t * t + b; 6 | } 7 | 8 | public static float EaseOut( float t, float b, float c, float d ) 9 | { 10 | return c * ( ( t = t / d - 1 ) * t * t * t * t + 1 ) + b; 11 | } 12 | 13 | public static float EaseInOut( float t, float b, float c, float d ) 14 | { 15 | if( ( t /= d / 2 ) < 1 ) 16 | { 17 | return c / 2 * t * t * t * t * t + b; 18 | } 19 | return c / 2 * ( ( t -= 2 ) * t * t * t * t + 2 ) + b; 20 | } 21 | } -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseQuintic.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec4a9f5d98bf04114b5a015db1308a60 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseSinusoidal.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | public static class GoEaseSinusoidal 6 | { 7 | public static float EaseIn( float t, float b, float c, float d ) 8 | { 9 | return -c * (float)Math.Cos( t / d * ( Math.PI / 2 ) ) + c + b; 10 | } 11 | 12 | public static float EaseOut( float t, float b, float c, float d ) 13 | { 14 | return c * (float)Math.Sin( t / d * ( Math.PI / 2 ) ) + b; 15 | } 16 | 17 | public static float EaseInOut( float t, float b, float c, float d ) 18 | { 19 | return -c / 2 * ( (float)Math.Cos( Math.PI * t / d ) - 1 ) + b; 20 | } 21 | } -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/GoEaseSinusoidal.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fa97311d39f04b93b833ca28fac10ae 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/easeEquationsLicense.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Microsoft Public License (Ms-PL) 3 | 4 | This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. 5 | 6 | 1. Definitions 7 | 8 | The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. 9 | 10 | A "contribution" is the original software, or any additions or changes to the software. 11 | 12 | A "contributor" is any person that distributes its contribution under this license. 13 | 14 | "Licensed patents" are a contributor's patent claims that read directly on its contribution. 15 | 16 | 2. Grant of Rights 17 | 18 | (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. 19 | 20 | (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. 21 | 22 | 3. Conditions and Limitations 23 | 24 | (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. 25 | 26 | (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. 27 | 28 | (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. 29 | 30 | (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. 31 | 32 | (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. 33 | */ -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/easing/easeEquationsLicense.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 098d0b0599d2b4fcc8c8f24379e8bf90 3 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fdf9641baedb40338ca9a110aa99706 3 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoDuplicatePropertyRuleType.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | 6 | /// 7 | /// defines what should be done in the event that a TweenProperty is being added to Go when an existing TweenProperty 8 | /// of the same type with the same target object is already present 9 | /// 10 | public enum GoDuplicatePropertyRuleType 11 | { 12 | None, // dont bother checking or doing anything 13 | RemoveRunningProperty, // removes the property from the Tween that was already running 14 | DontAddCurrentProperty // leaves the original property intact and doesnt add the current property 15 | } 16 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoDuplicatePropertyRuleType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7107639cda4a541a79a05bd60caf35c8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoEaseType.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | 6 | public enum GoEaseType 7 | { 8 | Linear, 9 | 10 | SineIn, 11 | SineOut, 12 | SineInOut, 13 | 14 | QuadIn, 15 | QuadOut, 16 | QuadInOut, 17 | 18 | CubicIn, 19 | CubicOut, 20 | CubicInOut, 21 | 22 | QuartIn, 23 | QuartOut, 24 | QuartInOut, 25 | 26 | QuintIn, 27 | QuintOut, 28 | QuintInOut, 29 | 30 | ExpoIn, 31 | ExpoOut, 32 | ExpoInOut, 33 | 34 | CircIn, 35 | CircOut, 36 | CircInOut, 37 | 38 | ElasticIn, 39 | ElasticOut, 40 | ElasticInOut, 41 | Punch, 42 | 43 | BackIn, 44 | BackOut, 45 | BackInOut, 46 | 47 | BounceIn, 48 | BounceOut, 49 | BounceInOut 50 | } 51 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoEaseType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e53d7306407a34ceaa133d772fa1ec3b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoLogLevel.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | public enum GoLogLevel 6 | { 7 | None, 8 | Info, 9 | Warn, 10 | Error 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoLogLevel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95f2b1a5decae452784d0c332801c1d1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoLookAtType.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | /// 6 | /// used by paths to identify what the object being tweened should look at 7 | /// 8 | public enum GoLookAtType 9 | { 10 | None, 11 | NextPathNode, 12 | TargetTransform 13 | } 14 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoLookAtType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08691283d482e4054b037fc5d4030e48 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoLoopType.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | 6 | public enum GoLoopType 7 | { 8 | RestartFromBeginning, 9 | PingPong 10 | } -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoLoopType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8820e9c24b06041b8ab4157ec84b5f86 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoShakeType.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | [System.Flags] 6 | public enum GoShakeType 7 | { 8 | Position = ( 1 << 0 ), 9 | Scale = ( 1 << 1 ), 10 | Eulers = ( 1 << 2 ) 11 | } -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoShakeType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83c69d81ac63f4b789dd05ab1f326517 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoSplineType.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | public enum GoSplineType 6 | { 7 | StraightLine, // 2 points 8 | QuadraticBezier, // 3 points 9 | CubicBezier, // 4 points 10 | CatmullRom // 5+ points 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoSplineType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b24cf23dec3f4db7869ebfde6112be9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoTweenState.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | public enum GoTweenState 6 | { 7 | Running, 8 | Paused, 9 | Complete, 10 | Destroyed 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoTweenState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de15fdc9763ed4873b7021c616d7952d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoUpdateType.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | public enum GoUpdateType 6 | { 7 | Update, 8 | LateUpdate, 9 | FixedUpdate, 10 | TimeScaleIndependentUpdate 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/enums/GoUpdateType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 634c22f604be24212ae1f75ddec523f9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/extensions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb14c988d1865428599a6a5bc46a79e5 3 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/extensions/GoKitTweenExtensions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | public static class GoKitTweenExtensions 6 | { 7 | #region Transform extensions 8 | 9 | // to tweens 10 | public static GoTween eularAnglesTo( this Transform self, float duration, Vector3 endValue, bool isRelative = false ) 11 | { 12 | return Go.to( self, duration, new GoTweenConfig().eulerAngles( endValue, isRelative ) ); 13 | } 14 | 15 | 16 | public static GoTween localEularAnglesTo( this Transform self, float duration, Vector3 endValue, bool isRelative = false ) 17 | { 18 | return Go.to( self, duration, new GoTweenConfig().localEulerAngles( endValue, isRelative ) ); 19 | } 20 | 21 | 22 | public static GoTween positionTo( this Transform self, float duration, Vector3 endValue, bool isRelative = false ) 23 | { 24 | return Go.to( self, duration, new GoTweenConfig().position( endValue, isRelative ) ); 25 | } 26 | 27 | 28 | public static GoTween localPositionTo( this Transform self, float duration, Vector3 endValue, bool isRelative = false ) 29 | { 30 | return Go.to( self, duration, new GoTweenConfig().localPosition( endValue, isRelative ) ); 31 | } 32 | 33 | 34 | public static GoTween scaleTo( this Transform self, float duration, float endValue, bool isRelative = false ) 35 | { 36 | return self.scaleTo( duration, new Vector3( endValue, endValue, endValue ), isRelative ); 37 | } 38 | 39 | 40 | public static GoTween scaleTo( this Transform self, float duration, Vector3 endValue, bool isRelative = false ) 41 | { 42 | return Go.to( self, duration, new GoTweenConfig().scale( endValue, isRelative ) ); 43 | } 44 | 45 | 46 | public static GoTween shake( this Transform self, float duration, Vector3 shakeMagnitude, GoShakeType shakeType = GoShakeType.Position, int frameMod = 1, bool useLocalProperties = false ) 47 | { 48 | return Go.to( self, duration, new GoTweenConfig().shake( shakeMagnitude, shakeType, frameMod, useLocalProperties ) ); 49 | } 50 | 51 | 52 | // from tweens 53 | public static GoTween eularAnglesFrom( this Transform self, float duration, Vector3 endValue, bool isRelative = false ) 54 | { 55 | return Go.from( self, duration, new GoTweenConfig().eulerAngles( endValue, isRelative ) ); 56 | } 57 | 58 | 59 | public static GoTween localEularAnglesFrom( this Transform self, float duration, Vector3 endValue, bool isRelative = false ) 60 | { 61 | return Go.from( self, duration, new GoTweenConfig().localEulerAngles( endValue, isRelative ) ); 62 | } 63 | 64 | 65 | public static GoTween positionFrom( this Transform self, float duration, Vector3 endValue, bool isRelative = false ) 66 | { 67 | return Go.from( self, duration, new GoTweenConfig().position( endValue, isRelative ) ); 68 | } 69 | 70 | 71 | public static GoTween localPositionFrom( this Transform self, float duration, Vector3 endValue, bool isRelative = false ) 72 | { 73 | return Go.from( self, duration, new GoTweenConfig().localPosition( endValue, isRelative ) ); 74 | } 75 | 76 | 77 | public static GoTween scaleFrom( this Transform self, float duration, Vector3 endValue, bool isRelative = false ) 78 | { 79 | return Go.from( self, duration, new GoTweenConfig().scale( endValue, isRelative ) ); 80 | } 81 | 82 | #endregion 83 | 84 | 85 | #region Material extensions 86 | 87 | public static GoTween colorTo( this Material self, float duration, Color endValue, string colorName = "_Color" ) 88 | { 89 | return Go.to( self, duration, new GoTweenConfig().materialColor( endValue, colorName ) ); 90 | } 91 | 92 | 93 | public static GoTween colorFrom( this Material self, float duration, Color endValue, string colorName = "_Color" ) 94 | { 95 | return Go.from( self, duration, new GoTweenConfig().materialColor( endValue, colorName ) ); 96 | } 97 | 98 | #endregion 99 | 100 | } 101 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/extensions/GoKitTweenExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21ffa6d37448541bead4c009180436bd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4204282772fc1408da934f8775d6da4f 3 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/GoTweenUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a79611b258ffd496990f232247eefc3a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/abstracts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b015a50b4ac6b4515bd5116d6da7ff5d 3 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/abstracts/AbstractColorTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | /// 6 | /// base class for any color tweens (MaterialColor and ColorTween) 7 | /// 8 | public abstract class AbstractColorTweenProperty : AbstractTweenProperty 9 | { 10 | protected Material _target; 11 | 12 | protected Color _originalEndValue; 13 | protected Color _startValue; 14 | protected Color _endValue; 15 | protected Color _diffValue; 16 | 17 | 18 | public AbstractColorTweenProperty( Color endValue, bool isRelative ) : base( isRelative ) 19 | { 20 | _originalEndValue = endValue; 21 | } 22 | 23 | 24 | public override bool validateTarget( object target ) 25 | { 26 | return ( target is Material || target is GameObject || target is Transform || target is Renderer ); 27 | } 28 | 29 | 30 | public override void init( GoTween owner ) 31 | { 32 | // setup our target before initting 33 | if( owner.target is Material ) 34 | _target = (Material)owner.target; 35 | else if( owner.target is GameObject ) 36 | _target = ((GameObject)owner.target).GetComponent().material; 37 | else if( owner.target is Transform ) 38 | _target = ((Transform)owner.target).GetComponent().material; 39 | else if( owner.target is Renderer ) 40 | _target = ((Renderer)owner.target).material; 41 | 42 | base.init( owner ); 43 | } 44 | 45 | 46 | public override void prepareForUse() 47 | { 48 | if( _isRelative && !_ownerTween.isFrom ) 49 | _diffValue = _endValue; 50 | else 51 | _diffValue = _endValue - _startValue; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/abstracts/AbstractColorTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 06d1e7d9b36ea4b9fb70c40298d959ec 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/abstracts/AbstractQuaternionTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | /// 6 | /// base class for generic Quaternion props 7 | /// 8 | public abstract class AbstractQuaternionTweenProperty : AbstractTweenProperty 9 | { 10 | protected Transform _target; 11 | 12 | protected Quaternion _originalEndValue; 13 | protected Quaternion _startValue; 14 | protected Quaternion _endValue; 15 | 16 | public AbstractQuaternionTweenProperty() 17 | {} 18 | 19 | 20 | public AbstractQuaternionTweenProperty( Quaternion endValue, bool isRelative = false ) : base( isRelative ) 21 | { 22 | _originalEndValue = endValue; 23 | } 24 | 25 | 26 | public override bool validateTarget( object target ) 27 | { 28 | return target is Transform; 29 | } 30 | 31 | 32 | public override void prepareForUse() 33 | { 34 | if (_isRelative && !_ownerTween.isFrom) 35 | _endValue = _startValue * _endValue; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/abstracts/AbstractQuaternionTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91d9cba1487704697be079449afdefbb 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/abstracts/AbstractTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | 5 | 6 | public abstract class AbstractTweenProperty 7 | { 8 | protected bool _isInitialized; 9 | public bool isInitialized { get { return _isInitialized; } } 10 | 11 | protected bool _isRelative; 12 | protected GoTween _ownerTween; 13 | 14 | protected Func _easeFunction; 15 | 16 | 17 | 18 | public AbstractTweenProperty( bool isRelative = false ) 19 | { 20 | _isRelative = isRelative; 21 | } 22 | 23 | 24 | public override int GetHashCode() 25 | { 26 | return base.GetHashCode(); 27 | } 28 | 29 | 30 | /// 31 | /// checks to see if a TweenProperty matches another. checks propertyNames of IGenericPropertys first then 32 | /// resorts to direct type checking 33 | /// 34 | public override bool Equals( object obj ) 35 | { 36 | // null check first 37 | if( obj == null ) 38 | return false; 39 | 40 | // handle IGenericProperty comparisons which just have the property name checked 41 | if( this is IGenericProperty && obj is IGenericProperty ) 42 | return ((IGenericProperty)this).propertyName == ((IGenericProperty)obj).propertyName; 43 | 44 | // check for the same types 45 | if( obj.GetType() == this.GetType() ) 46 | return true; 47 | 48 | return base.Equals( obj ); 49 | } 50 | 51 | 52 | /// 53 | /// called by a Tween just after this property is validated and added to the Tweens property list 54 | /// 55 | public virtual void init( GoTween owner ) 56 | { 57 | _isInitialized = true; 58 | _ownerTween = owner; 59 | 60 | // if we dont have an easeFunction use the owners type 61 | if( _easeFunction == null ) 62 | setEaseType( owner.easeType ); 63 | } 64 | 65 | 66 | /// 67 | /// clones the instance 68 | /// 69 | public AbstractTweenProperty clone() 70 | { 71 | var clone = MemberwiseClone() as AbstractTweenProperty; 72 | clone._ownerTween = null; 73 | clone._isInitialized = false; 74 | clone._easeFunction = null; 75 | 76 | return clone; 77 | } 78 | 79 | 80 | /// 81 | /// sets the ease type for this tween property 82 | /// technically, this should be an internal method 83 | /// 84 | public void setEaseType( GoEaseType easeType ) 85 | { 86 | _easeFunction = GoTweenUtils.easeFunctionForType( easeType ); 87 | } 88 | 89 | 90 | /// 91 | /// each TweenProperty should override this to ensure the object is the correct type 92 | /// 93 | public virtual bool validateTarget( object target ) 94 | { 95 | return true; 96 | } 97 | 98 | 99 | /// 100 | /// subclasses should get the eased time then set the new value on the object 101 | /// 102 | public abstract void tick( float totalElapsedTime ); 103 | 104 | 105 | /// 106 | /// called when a Tween is initially started. 107 | /// subclasses should strongly type the start/end/target and handle isFrom with 108 | /// regard to setting the proper start/end values 109 | /// 110 | public abstract void prepareForUse(); 111 | 112 | } 113 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/abstracts/AbstractTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf8a9f19ff8c84f3d9b75558baec7117 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/abstracts/AbstractVector3TweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | /// 6 | /// base class for position, scale, eulers and the generic Vector3 props 7 | /// 8 | public abstract class AbstractVector3TweenProperty : AbstractTweenProperty 9 | { 10 | protected Transform _target; 11 | 12 | protected Vector3 _originalEndValue; 13 | protected Vector3 _startValue; 14 | protected Vector3 _endValue; 15 | protected Vector3 _diffValue; 16 | 17 | 18 | public AbstractVector3TweenProperty() 19 | {} 20 | 21 | 22 | public AbstractVector3TweenProperty( Vector3 endValue, bool isRelative = false ) : base( isRelative ) 23 | { 24 | _originalEndValue = endValue; 25 | } 26 | 27 | 28 | public override bool validateTarget( object target ) 29 | { 30 | return target is Transform; 31 | } 32 | 33 | 34 | public override void prepareForUse() 35 | { 36 | if( _isRelative && !_ownerTween.isFrom ) 37 | _diffValue = _endValue; 38 | else 39 | _diffValue = _endValue - _startValue; 40 | } 41 | 42 | 43 | public void resetWithNewEndValue( Vector3 endValue ) 44 | { 45 | _originalEndValue = endValue; 46 | prepareForUse(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/abstracts/AbstractVector3TweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f73ba6304fca4593ac3756c9c01864e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 568b4e56e499a47b6b1edebd41563940 3 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/ColorTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | 5 | 6 | public class ColorTweenProperty : AbstractColorTweenProperty, IGenericProperty 7 | { 8 | public string propertyName { get; private set; } 9 | private Action _setter; 10 | 11 | 12 | public ColorTweenProperty( string propertyName, Color endValue, bool isRelative = false ) : base( endValue, isRelative ) 13 | { 14 | this.propertyName = propertyName; 15 | } 16 | 17 | 18 | /// 19 | /// validation checks to make sure the target has a valid property with an accessible setter 20 | /// 21 | public override bool validateTarget( object target ) 22 | { 23 | // cache the setter 24 | _setter = GoTweenUtils.setterForProperty>( target, propertyName ); 25 | return _setter != null; 26 | } 27 | 28 | 29 | public override void prepareForUse() 30 | { 31 | // retrieve the getter 32 | var getter = GoTweenUtils.getterForProperty>( _ownerTween.target, propertyName ); 33 | 34 | _endValue = _originalEndValue; 35 | 36 | // if this is a from tween we need to swap the start and end values 37 | if( _ownerTween.isFrom ) 38 | { 39 | _startValue = _endValue; 40 | _endValue = getter(); 41 | } 42 | else 43 | { 44 | _startValue = getter(); 45 | } 46 | 47 | base.prepareForUse(); 48 | } 49 | 50 | 51 | public override void tick( float totalElapsedTime ) 52 | { 53 | var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration ); 54 | var newColor = GoTweenUtils.unclampedColorLerp( _startValue, _diffValue, easedTime ); 55 | 56 | _setter( newColor ); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/ColorTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8feba848df2ec4a0cb2b5c4b11d09fde 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/FloatTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | 5 | 6 | public class FloatTweenProperty : AbstractTweenProperty, IGenericProperty 7 | { 8 | public string propertyName { get; private set; } 9 | private Action _setter; 10 | 11 | protected float _originalEndValue; 12 | protected float _startValue; 13 | protected float _endValue; 14 | protected float _diffValue; 15 | 16 | 17 | public FloatTweenProperty( string propertyName, float endValue, bool isRelative = false ) : base( isRelative ) 18 | { 19 | this.propertyName = propertyName; 20 | _originalEndValue = endValue; 21 | } 22 | 23 | 24 | /// 25 | /// validation checks to make sure the target has a valid property with an accessible setter 26 | /// 27 | public override bool validateTarget( object target ) 28 | { 29 | // cache the setter 30 | _setter = GoTweenUtils.setterForProperty>( target, propertyName ); 31 | return _setter != null; 32 | } 33 | 34 | 35 | public override void prepareForUse() 36 | { 37 | // retrieve the getter 38 | var getter = GoTweenUtils.getterForProperty>( _ownerTween.target, propertyName ); 39 | 40 | _endValue = _originalEndValue; 41 | 42 | // if this is a from tween we need to swap the start and end values 43 | if( _ownerTween.isFrom ) 44 | { 45 | _startValue = _endValue; 46 | _endValue = getter(); 47 | } 48 | else 49 | { 50 | _startValue = getter(); 51 | } 52 | 53 | // setup the diff value 54 | if( _isRelative && !_ownerTween.isFrom ) 55 | _diffValue = _endValue; 56 | else 57 | _diffValue = _endValue - _startValue; 58 | } 59 | 60 | 61 | public override void tick( float totalElapsedTime ) 62 | { 63 | var easedValue = _easeFunction( totalElapsedTime, _startValue, _diffValue, _ownerTween.duration ); 64 | _setter( easedValue ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/FloatTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69fddc80fa08840df95aeb0cc5631b3b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/IGenericProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | /// 6 | /// interface that simply defines that a generic property tween must have a propertyName. this has the side effect 7 | /// of letting us easily compare generic property tweens vs stongly typed tweens 8 | /// 9 | public interface IGenericProperty 10 | { 11 | string propertyName { get; } 12 | } 13 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/IGenericProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21e55e5f9ed3e437ba9c943917440083 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/IntTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | 5 | 6 | public class IntTweenProperty : AbstractTweenProperty, IGenericProperty 7 | { 8 | public string propertyName { get; private set; } 9 | 10 | private Action _setter; 11 | 12 | protected int _originalEndValue; 13 | protected int _startValue; 14 | protected int _endValue; 15 | protected int _diffValue; 16 | 17 | 18 | public IntTweenProperty( string propertyName, int endValue, bool isRelative = false ) : base( isRelative ) 19 | { 20 | this.propertyName = propertyName; 21 | _originalEndValue = endValue; 22 | } 23 | 24 | 25 | /// 26 | /// validation checks to make sure the target has a valid property with an accessible setter 27 | /// 28 | public override bool validateTarget( object target ) 29 | { 30 | // cache the setter 31 | _setter = GoTweenUtils.setterForProperty>( target, propertyName ); 32 | return _setter != null; 33 | } 34 | 35 | 36 | public override void prepareForUse() 37 | { 38 | // retrieve the getter 39 | var getter = GoTweenUtils.getterForProperty>( _ownerTween.target, propertyName ); 40 | 41 | _endValue = _originalEndValue; 42 | 43 | // if this is a from tween we need to swap the start and end values 44 | if( _ownerTween.isFrom ) 45 | { 46 | _startValue = _endValue; 47 | _endValue = getter(); 48 | } 49 | else 50 | { 51 | _startValue = getter(); 52 | } 53 | 54 | // prep the diff value 55 | if( _isRelative && !_ownerTween.isFrom ) 56 | _diffValue = _endValue; 57 | else 58 | _diffValue = _endValue - _startValue; 59 | } 60 | 61 | 62 | public override void tick( float totalElapsedTime ) 63 | { 64 | var easedValue = _easeFunction( totalElapsedTime, _startValue, _diffValue, _ownerTween.duration ); 65 | _setter( (int)Math.Round( easedValue ) ); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/IntTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26ecf98b31f464c3eab865287ed4f9b2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/Vector2TweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | 5 | 6 | public class Vector2TweenProperty : AbstractTweenProperty, IGenericProperty 7 | { 8 | public string propertyName { get; private set; } 9 | private Action _setter; 10 | 11 | protected Vector2 _originalEndValue; 12 | protected Vector2 _startValue; 13 | protected Vector2 _endValue; 14 | protected Vector2 _diffValue; 15 | 16 | 17 | public Vector2TweenProperty( string propertyName, Vector2 endValue, bool isRelative = false ) : base( isRelative ) 18 | { 19 | this.propertyName = propertyName; 20 | _originalEndValue = endValue; 21 | } 22 | 23 | 24 | /// 25 | /// validation checks to make sure the target has a valid property with an accessible setter 26 | /// 27 | public override bool validateTarget( object target ) 28 | { 29 | // cache the setter 30 | _setter = GoTweenUtils.setterForProperty>( target, propertyName ); 31 | return _setter != null; 32 | } 33 | 34 | 35 | public override void prepareForUse() 36 | { 37 | // retrieve the getter 38 | var getter = GoTweenUtils.getterForProperty>( _ownerTween.target, propertyName ); 39 | 40 | _endValue = _originalEndValue; 41 | 42 | // if this is a from tween we need to swap the start and end values 43 | if( _ownerTween.isFrom ) 44 | { 45 | _startValue = _endValue; 46 | _endValue = getter(); 47 | } 48 | else 49 | { 50 | _startValue = getter(); 51 | } 52 | 53 | // prep the diff value 54 | if( _isRelative && !_ownerTween.isFrom ) 55 | _diffValue = _endValue; 56 | else 57 | _diffValue = _endValue - _startValue; 58 | } 59 | 60 | 61 | public override void tick( float totalElapsedTime ) 62 | { 63 | var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration ); 64 | var vec = GoTweenUtils.unclampedVector2Lerp( _startValue, _diffValue, easedTime ); 65 | 66 | _setter( vec ); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/Vector2TweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22a05f02b0d2d4c579d00c2db33555b1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/Vector3PathTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | 5 | 6 | public class Vector3PathTweenProperty : AbstractTweenProperty, IGenericProperty 7 | { 8 | public string propertyName { get; private set; } 9 | 10 | private Action _setter; 11 | private GoSpline _path; 12 | private Vector3 _startValue; 13 | 14 | 15 | public Vector3PathTweenProperty( string propertyName, GoSpline path, bool isRelative = false ) : base( isRelative ) 16 | { 17 | this.propertyName = propertyName; 18 | _path = path; 19 | } 20 | 21 | 22 | /// 23 | /// validation checks to make sure the target has a valid property with an accessible setter 24 | /// 25 | public override bool validateTarget( object target ) 26 | { 27 | // cache the setter 28 | _setter = GoTweenUtils.setterForProperty>( target, propertyName ); 29 | return _setter != null; 30 | } 31 | 32 | 33 | public override void prepareForUse() 34 | { 35 | // if this is a from tween first reverse the path then build it. we unreverse in case we were copied 36 | if( _ownerTween.isFrom ) 37 | _path.reverseNodes(); 38 | else 39 | _path.unreverseNodes(); 40 | 41 | _path.buildPath(); 42 | 43 | // a from tween means the start value is the last node 44 | if( _ownerTween.isFrom ) 45 | { 46 | _startValue = _path.getLastNode(); 47 | } 48 | else 49 | { 50 | // retrieve the getter only when needed 51 | var getter = GoTweenUtils.getterForProperty>( _ownerTween.target, propertyName ); 52 | _startValue = getter(); 53 | } 54 | } 55 | 56 | 57 | public override void tick( float totalElapsedTime ) 58 | { 59 | var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration ); 60 | var vec = _path.getPointOnPath( easedTime ); 61 | 62 | // if we are relative, add the vec to our startValue 63 | if( _isRelative ) 64 | vec += _startValue; 65 | 66 | _setter( vec ); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/Vector3PathTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0bf2fb33fe8d04ad2a177ab6038c1965 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/Vector3TweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | 5 | 6 | public class Vector3TweenProperty : AbstractVector3TweenProperty, IGenericProperty 7 | { 8 | public string propertyName { get; private set; } 9 | private Action _setter; 10 | 11 | 12 | public Vector3TweenProperty( string propertyName, Vector3 endValue, bool isRelative = false ) : base( endValue, isRelative ) 13 | { 14 | this.propertyName = propertyName; 15 | } 16 | 17 | 18 | /// 19 | /// validation checks to make sure the target has a valid property with an accessible setter 20 | /// 21 | public override bool validateTarget( object target ) 22 | { 23 | // cache the setter 24 | _setter = GoTweenUtils.setterForProperty>( target, propertyName ); 25 | return _setter != null; 26 | } 27 | 28 | 29 | public override void prepareForUse() 30 | { 31 | // retrieve the getter 32 | var getter = GoTweenUtils.getterForProperty>( _ownerTween.target, propertyName ); 33 | 34 | _endValue = _originalEndValue; 35 | 36 | // if this is a from tween we need to swap the start and end values 37 | if( _ownerTween.isFrom ) 38 | { 39 | _startValue = _endValue; 40 | _endValue = getter(); 41 | } 42 | else 43 | { 44 | _startValue = getter(); 45 | } 46 | 47 | base.prepareForUse(); 48 | } 49 | 50 | 51 | public override void tick( float totalElapsedTime ) 52 | { 53 | var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration ); 54 | var vec = GoTweenUtils.unclampedVector3Lerp( _startValue, _diffValue, easedTime ); 55 | 56 | _setter( vec ); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/Vector3TweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ccd327e369c14fac909ab0b6d1d0da5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/Vector3XTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | 5 | 6 | public class Vector3XTweenProperty : AbstractVector3TweenProperty, IGenericProperty 7 | { 8 | public string propertyName { get; private set; } 9 | protected Action _setter; 10 | protected Func _getter; 11 | 12 | protected new float _originalEndValue; 13 | protected new float _startValue; 14 | protected new float _endValue; 15 | protected new float _diffValue; 16 | 17 | 18 | public Vector3XTweenProperty( string propertyName, float endValue, bool isRelative = false ) 19 | { 20 | this.propertyName = propertyName; 21 | _isRelative = isRelative; 22 | _originalEndValue = endValue; 23 | } 24 | 25 | 26 | /// 27 | /// validation checks to make sure the target has a valid property with an accessible setter 28 | /// 29 | public override bool validateTarget( object target ) 30 | { 31 | // cache the setter 32 | _setter = GoTweenUtils.setterForProperty>( target, propertyName ); 33 | return _setter != null; 34 | } 35 | 36 | 37 | public override void prepareForUse() 38 | { 39 | // retrieve the getter 40 | _getter = GoTweenUtils.getterForProperty>( _ownerTween.target, propertyName ); 41 | 42 | _endValue = _originalEndValue; 43 | 44 | // if this is a from tween we need to swap the start and end values 45 | if( _ownerTween.isFrom ) 46 | { 47 | _startValue = _endValue; 48 | _endValue = _getter().x; 49 | } 50 | else 51 | { 52 | _startValue = _getter().x; 53 | } 54 | 55 | // prep the diff value 56 | if( _isRelative && !_ownerTween.isFrom ) 57 | _diffValue = _endValue; 58 | else 59 | _diffValue = _endValue - _startValue; 60 | } 61 | 62 | 63 | public override void tick( float totalElapsedTime ) 64 | { 65 | var currentValue = _getter(); 66 | currentValue.x = _easeFunction( totalElapsedTime, _startValue, _diffValue, _ownerTween.duration ); 67 | 68 | _setter( currentValue ); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/Vector3XTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e4e4541e602d4fbcba6aa19d256cf94 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/Vector3YTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | 5 | 6 | public class Vector3YTweenProperty : Vector3XTweenProperty 7 | { 8 | public Vector3YTweenProperty( string propertyName, float endValue, bool isRelative = false ) : base( propertyName, endValue, isRelative ) 9 | {} 10 | 11 | 12 | public override void prepareForUse() 13 | { 14 | // retrieve the getter 15 | _getter = GoTweenUtils.getterForProperty>( _ownerTween.target, propertyName ); 16 | 17 | _endValue = _originalEndValue; 18 | 19 | // if this is a from tween we need to swap the start and end values 20 | if( _ownerTween.isFrom ) 21 | { 22 | _startValue = _endValue; 23 | _endValue = _getter().y; 24 | } 25 | else 26 | { 27 | _startValue = _getter().y; 28 | } 29 | 30 | // prep the diff value 31 | if( _isRelative && !_ownerTween.isFrom ) 32 | _diffValue = _endValue; 33 | else 34 | _diffValue = _endValue - _startValue; 35 | } 36 | 37 | 38 | public override void tick( float totalElapsedTime ) 39 | { 40 | var currentValue = _getter(); 41 | currentValue.y = _easeFunction( totalElapsedTime, _startValue, _diffValue, _ownerTween.duration ); 42 | 43 | _setter( currentValue ); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/Vector3YTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 576b35d4282a84f26b445f338480bd4d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/Vector3ZTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | 5 | 6 | public class Vector3ZTweenProperty : Vector3XTweenProperty 7 | { 8 | public Vector3ZTweenProperty( string propertyName, float endValue, bool isRelative = false ) : base( propertyName, endValue, isRelative ) 9 | {} 10 | 11 | 12 | public override void prepareForUse() 13 | { 14 | // retrieve the getter 15 | _getter = GoTweenUtils.getterForProperty>( _ownerTween.target, propertyName ); 16 | 17 | _endValue = _originalEndValue; 18 | 19 | // if this is a from tween we need to swap the start and end values 20 | if( _ownerTween.isFrom ) 21 | { 22 | _startValue = _endValue; 23 | _endValue = _getter().z; 24 | } 25 | else 26 | { 27 | _startValue = _getter().z; 28 | } 29 | 30 | // prep the diff value 31 | if( _isRelative && !_ownerTween.isFrom ) 32 | _diffValue = _endValue; 33 | else 34 | _diffValue = _endValue - _startValue; 35 | } 36 | 37 | 38 | public override void tick( float totalElapsedTime ) 39 | { 40 | var currentValue = _getter(); 41 | currentValue.z = _easeFunction( totalElapsedTime, _startValue, _diffValue, _ownerTween.duration ); 42 | 43 | _setter( currentValue ); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/Vector3ZTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31797a4f425d143babbdfd3ab73f8189 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/Vector4TweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | 5 | 6 | public class Vector4TweenProperty : AbstractTweenProperty, IGenericProperty 7 | { 8 | public string propertyName { get; private set; } 9 | private Action _setter; 10 | 11 | protected Vector4 _originalEndValue; 12 | protected Vector4 _startValue; 13 | protected Vector4 _endValue; 14 | protected Vector4 _diffValue; 15 | 16 | 17 | public Vector4TweenProperty( string propertyName, Vector4 endValue, bool isRelative = false ) : base( isRelative ) 18 | { 19 | this.propertyName = propertyName; 20 | _originalEndValue = endValue; 21 | } 22 | 23 | 24 | /// 25 | /// validation checks to make sure the target has a valid property with an accessible setter 26 | /// 27 | public override bool validateTarget( object target ) 28 | { 29 | // cache the setter 30 | _setter = GoTweenUtils.setterForProperty>( target, propertyName ); 31 | return _setter != null; 32 | } 33 | 34 | 35 | public override void prepareForUse() 36 | { 37 | // retrieve the getter 38 | var getter = GoTweenUtils.getterForProperty>( _ownerTween.target, propertyName ); 39 | 40 | _endValue = _originalEndValue; 41 | 42 | // if this is a from tween we need to swap the start and end values 43 | if( _ownerTween.isFrom ) 44 | { 45 | _endValue = _startValue; 46 | _endValue = getter(); 47 | } 48 | else 49 | { 50 | _startValue = getter(); 51 | } 52 | 53 | // prep the diff value 54 | if( _isRelative && !_ownerTween.isFrom ) 55 | _diffValue = _endValue; 56 | else 57 | _diffValue = _endValue - _startValue; 58 | } 59 | 60 | 61 | public override void tick( float totalElapsedTime ) 62 | { 63 | var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration ); 64 | var vec = GoTweenUtils.unclampedVector4Lerp( _startValue, _diffValue, easedTime ); 65 | 66 | _setter( vec ); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/genericTypes/Vector4TweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb950a7d0cdd24204ac8d2be1336b0ea 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/smoothing.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c076f7b25e9c4c27b52cc7847d14056 3 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/smoothing/GoSmoothedQuaternion.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | /// 6 | /// based on the idea by Mike Talbot here http://whydoidoit.com/2012/04/01/smoothed-vector3-quaternions-and-floats-in-unity/ 7 | /// 8 | /// lerps or slerps a Quaternion over time. usage is like so: 9 | /// 10 | /// mySmoothedQuat = target.rotation; // creates the GoSmoothedQuaternion 11 | /// mySmoothedQuat.smoothValue = someNewQuaternion; // update the smoothValue whenever you would normally set the value on your object 12 | /// target.rotation = mySmoothedQuat.smoothValue; // use the smoothValue property in an Update method to lerp/slerp it 13 | /// 14 | /// 15 | public struct GoSmoothedQuaternion 16 | { 17 | public GoSmoothingType smoothingType; 18 | public float duration; 19 | 20 | private Quaternion _currentValue; 21 | private Quaternion _target; 22 | private Quaternion _start; 23 | private float _startTime; 24 | 25 | 26 | public GoSmoothedQuaternion( Quaternion quat ) 27 | { 28 | _currentValue = quat; 29 | _start = quat; 30 | _target = quat; 31 | _startTime = Time.time; 32 | 33 | // set sensible defaults 34 | duration = 0.2f; 35 | smoothingType = GoSmoothingType.Lerp; 36 | } 37 | 38 | 39 | public Quaternion smoothValue 40 | { 41 | get 42 | { 43 | // how far along are we? 44 | var t = ( Time.time - _startTime ) / duration; 45 | 46 | switch( smoothingType ) 47 | { 48 | case GoSmoothingType.Lerp: 49 | _currentValue = Quaternion.Lerp( _start, _target, t ); 50 | break; 51 | case GoSmoothingType.Slerp: 52 | _currentValue = Quaternion.Slerp( _start, _target, t ); 53 | break; 54 | } 55 | 56 | return _currentValue; 57 | } 58 | set 59 | { 60 | _start = smoothValue; 61 | _startTime = Time.time; 62 | _target = value; 63 | } 64 | } 65 | 66 | 67 | public float x 68 | { 69 | get 70 | { 71 | return _currentValue.x; 72 | } 73 | set 74 | { 75 | smoothValue = new Quaternion( value, _target.y, _target.z, _target.w ); 76 | } 77 | } 78 | 79 | public float y 80 | { 81 | get 82 | { 83 | return _currentValue.y; 84 | } 85 | set 86 | { 87 | smoothValue = new Quaternion( _target.x, value, _target.y, _target.w ); 88 | } 89 | } 90 | 91 | public float z 92 | { 93 | get 94 | { 95 | return _currentValue.z; 96 | } 97 | set 98 | { 99 | smoothValue = new Quaternion( _target.x, _target.y, value, _target.w ); 100 | } 101 | 102 | } 103 | 104 | public float w 105 | { 106 | get 107 | { 108 | return _currentValue.w; 109 | } 110 | set 111 | { 112 | 113 | smoothValue = new Quaternion( _target.x, _target.y, _target.z, value ); 114 | } 115 | } 116 | 117 | 118 | public static implicit operator GoSmoothedQuaternion( Quaternion q ) 119 | { 120 | return new GoSmoothedQuaternion( q ); 121 | } 122 | 123 | } 124 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/smoothing/GoSmoothedQuaternion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 806c433a2491044ec8c3f50375392041 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/smoothing/GoSmoothedVector3.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | 6 | public struct GoSmoothedVector3 7 | { 8 | public GoSmoothingType smoothingType; 9 | public float duration; 10 | 11 | private Vector3 _currentValue; 12 | private Vector3 _target; 13 | private Vector3 _start; 14 | private float _startTime; 15 | 16 | 17 | public GoSmoothedVector3( Vector3 vector ) 18 | { 19 | _currentValue = vector; 20 | _start = vector; 21 | _target = vector; 22 | _startTime = Time.time; 23 | 24 | // set sensible defaults 25 | duration = 0.2f; 26 | smoothingType = GoSmoothingType.Lerp; 27 | } 28 | 29 | 30 | public Vector3 smoothValue 31 | { 32 | get 33 | { 34 | // how far along are we? 35 | var t = ( Time.time - _startTime ) / duration; 36 | 37 | switch( smoothingType ) 38 | { 39 | case GoSmoothingType.Lerp: 40 | _currentValue = Vector3.Lerp( _start, _target, t ); 41 | break; 42 | case GoSmoothingType.Slerp: 43 | _currentValue = Vector3.Slerp( _start, _target, t ); 44 | break; 45 | } 46 | 47 | return _currentValue; 48 | } 49 | private set 50 | { 51 | _start = smoothValue; 52 | _startTime = Time.time; 53 | _target = value; 54 | } 55 | } 56 | 57 | 58 | public float x 59 | { 60 | get 61 | { 62 | return _currentValue.x; 63 | } 64 | set 65 | { 66 | smoothValue = new Vector3( value, _target.y, _target.z ); 67 | } 68 | } 69 | 70 | public float y 71 | { 72 | get 73 | { 74 | return _currentValue.y; 75 | } 76 | set 77 | { 78 | smoothValue = new Vector3( _target.x, value, _target.y ); 79 | } 80 | } 81 | 82 | public float z 83 | { 84 | get 85 | { 86 | return _currentValue.z; 87 | } 88 | set 89 | { 90 | smoothValue = new Vector3( _target.x, _target.y, value ); 91 | } 92 | 93 | } 94 | 95 | 96 | public static implicit operator GoSmoothedVector3( Vector3 v ) 97 | { 98 | return new GoSmoothedVector3( v ); 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/smoothing/GoSmoothedVector3.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b796c056272a04cfea12f664f35c98e5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/smoothing/GoSmoothingType.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | public enum GoSmoothingType 6 | { 7 | Lerp, 8 | Slerp 9 | } 10 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/smoothing/GoSmoothingType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b85c904ec09ed418abbdc697bdd916fc 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ad9b033696fb463ea98ab0fb95a3deb 3 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/EulerAnglesTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | public class EulerAnglesTweenProperty : AbstractVector3TweenProperty 6 | { 7 | private bool _useLocalEulers; 8 | public bool useLocalEulers { get { return _useLocalEulers; } } 9 | 10 | public EulerAnglesTweenProperty( Vector3 endValue, bool isRelative = false, bool useLocalEulers = false ) : base( endValue, isRelative ) 11 | { 12 | _useLocalEulers = useLocalEulers; 13 | } 14 | 15 | 16 | #region Object overrides 17 | 18 | public override int GetHashCode() 19 | { 20 | return base.GetHashCode(); 21 | } 22 | 23 | 24 | public override bool Equals( object obj ) 25 | { 26 | // start with a base check and then compare if we are both using local values 27 | if( base.Equals( obj ) ) 28 | return this._useLocalEulers == ((EulerAnglesTweenProperty)obj)._useLocalEulers; 29 | 30 | // if we get here, we need to see if the other object is a rotation tween of the same kind 31 | var otherAsRotation = obj as RotationTweenProperty; 32 | if( otherAsRotation != null ) 33 | return this._useLocalEulers == otherAsRotation.useLocalRotation; 34 | 35 | return false; 36 | } 37 | 38 | #endregion 39 | 40 | 41 | public override void prepareForUse() 42 | { 43 | _target = _ownerTween.target as Transform; 44 | 45 | _endValue = _originalEndValue; 46 | 47 | // swap the start and end if this is a from tween 48 | if( _ownerTween.isFrom ) 49 | { 50 | _startValue = _endValue; 51 | 52 | if( _useLocalEulers ) 53 | _endValue = _target.localEulerAngles; 54 | else 55 | _endValue = _target.eulerAngles; 56 | } 57 | else 58 | { 59 | if( _useLocalEulers ) 60 | _startValue = _target.localEulerAngles; 61 | else 62 | _startValue = _target.eulerAngles; 63 | } 64 | 65 | base.prepareForUse(); 66 | } 67 | 68 | 69 | public override void tick( float totalElapsedTime ) 70 | { 71 | var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration ); 72 | var vec = GoTweenUtils.unclampedVector3Lerp( _startValue, _diffValue, easedTime ); 73 | 74 | if( _useLocalEulers ) 75 | _target.localEulerAngles = vec; 76 | else 77 | _target.eulerAngles = vec; 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/EulerAnglesTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5bbfcb772b13641e1afec2d91d2940f7 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/MaterialColorTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | public class MaterialColorTweenProperty : AbstractColorTweenProperty 6 | { 7 | private string _materialColorName; 8 | 9 | 10 | public MaterialColorTweenProperty( Color endValue, string colorName = "_Color", bool isRelative = false ) : base( endValue, isRelative ) 11 | { 12 | _materialColorName = colorName; 13 | } 14 | 15 | 16 | #region Object overrides 17 | 18 | public override int GetHashCode() 19 | { 20 | return base.GetHashCode(); 21 | } 22 | 23 | 24 | public override bool Equals( object obj ) 25 | { 26 | // start with a base check and then compare our material names 27 | if( base.Equals( obj ) ) 28 | return this._materialColorName == ((MaterialColorTweenProperty)obj)._materialColorName; 29 | 30 | return false; 31 | } 32 | 33 | #endregion 34 | 35 | 36 | public override void prepareForUse() 37 | { 38 | _endValue = _originalEndValue; 39 | 40 | // if this is a from tween we need to swap the start and end values 41 | if( _ownerTween.isFrom ) 42 | { 43 | _startValue = _endValue; 44 | _endValue = _target.GetColor( _materialColorName ); 45 | } 46 | else 47 | { 48 | _startValue = _target.GetColor( _materialColorName ); 49 | } 50 | 51 | base.prepareForUse(); 52 | } 53 | 54 | 55 | public override void tick( float totalElapsedTime ) 56 | { 57 | var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration ); 58 | var color = GoTweenUtils.unclampedColorLerp( _startValue, _diffValue, easedTime ); 59 | 60 | _target.SetColor( _materialColorName, color ); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/MaterialColorTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74b57762d8d034ccc9b9f37bb8c70019 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/PositionPathTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | /// 6 | /// tweens position along a path at constant speed between nodes. isRelative makes the path movement 7 | /// relative to the start position of the object. a "from" tween will reverse the path and make the start 8 | /// position be the last node in the path. 9 | /// 10 | public class PositionPathTweenProperty : AbstractTweenProperty 11 | { 12 | protected bool _useLocalPosition; 13 | public bool useLocalPosition { get { return _useLocalPosition; } } 14 | 15 | protected Transform _target; 16 | protected Vector3 _startValue; 17 | 18 | private GoSpline _path; 19 | private GoLookAtType _lookAtType = GoLookAtType.None; 20 | private Transform _lookTarget; 21 | private GoSmoothedQuaternion _smoothedRotation; 22 | 23 | 24 | public PositionPathTweenProperty( GoSpline path, bool isRelative = false, bool useLocalPosition = false, GoLookAtType lookAtType = GoLookAtType.None, Transform lookTarget = null ) : base( isRelative ) 25 | { 26 | _path = path; 27 | _useLocalPosition = useLocalPosition; 28 | _lookAtType = lookAtType; 29 | _lookTarget = lookTarget; 30 | } 31 | 32 | 33 | #region Object overrides 34 | 35 | public override int GetHashCode() 36 | { 37 | return base.GetHashCode(); 38 | } 39 | 40 | 41 | public override bool Equals( object obj ) 42 | { 43 | // start with a base check and then compare if we are both using local values 44 | if( base.Equals( obj ) ) 45 | return this._useLocalPosition == ((PositionPathTweenProperty)obj)._useLocalPosition; 46 | 47 | // if we get here, we need to see if the other object is a position tween of the same kind 48 | var otherAsPosition = obj as PositionTweenProperty; 49 | if( otherAsPosition != null ) 50 | return this._useLocalPosition == otherAsPosition.useLocalPosition; 51 | 52 | return false; 53 | } 54 | 55 | #endregion 56 | 57 | 58 | public override void prepareForUse() 59 | { 60 | _target = _ownerTween.target as Transform; 61 | 62 | // if this is a from tween first reverse the path then build it 63 | if( _ownerTween.isFrom ) 64 | _path.reverseNodes(); 65 | else 66 | _path.unreverseNodes(); 67 | 68 | _path.buildPath(); 69 | 70 | // a from tween means the start value is the last node 71 | if( _ownerTween.isFrom ) 72 | { 73 | _startValue = _path.getLastNode(); 74 | } 75 | else 76 | { 77 | if( _useLocalPosition ) 78 | _startValue = _target.localPosition; 79 | else 80 | _startValue = _target.position; 81 | } 82 | 83 | // validate the lookTarget if we are set to look at it 84 | if( _lookAtType == GoLookAtType.TargetTransform ) 85 | { 86 | if( _lookTarget == null ) 87 | _lookAtType = GoLookAtType.None; 88 | } 89 | 90 | // prep our smoothed rotation 91 | _smoothedRotation = _target.rotation; 92 | } 93 | 94 | 95 | public override void tick( float totalElapsedTime ) 96 | { 97 | var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration ); 98 | var vec = _path.getPointOnPath( easedTime ); 99 | 100 | // if we are relative, add the vec to our startValue 101 | if( _isRelative ) 102 | vec += _startValue; 103 | 104 | 105 | // handle look types 106 | switch( _lookAtType ) 107 | { 108 | case GoLookAtType.NextPathNode: 109 | { 110 | _smoothedRotation.smoothValue = vec.Equals( _target.position ) ? Quaternion.identity : Quaternion.LookRotation( vec - _target.position ); 111 | _target.rotation = _smoothedRotation.smoothValue; 112 | //var lookAtNode = ( _ownerTween.isReversed || _ownerTween.isLoopoingBackOnPingPong ) ? _path.getPreviousNode() : _path.getNextNode(); 113 | //_target.LookAt( lookAtNode, Vector3.up ); 114 | break; 115 | } 116 | case GoLookAtType.TargetTransform: 117 | { 118 | _target.LookAt( _lookTarget, Vector3.up ); 119 | break; 120 | } 121 | } 122 | 123 | 124 | // assign the position 125 | if( _useLocalPosition ) 126 | _target.localPosition = vec; 127 | else 128 | _target.position = vec; 129 | } 130 | 131 | } 132 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/PositionPathTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c9f58caa7cd847519c748a7132b4e9c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/PositionTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | public class PositionTweenProperty : AbstractVector3TweenProperty 6 | { 7 | protected bool _useLocalPosition; 8 | public bool useLocalPosition { get { return _useLocalPosition; } } 9 | 10 | public PositionTweenProperty( Vector3 endValue, bool isRelative = false, bool useLocalPosition = false ) : base( endValue, isRelative ) 11 | { 12 | _useLocalPosition = useLocalPosition; 13 | } 14 | 15 | 16 | #region Object overrides 17 | 18 | public override int GetHashCode() 19 | { 20 | return base.GetHashCode(); 21 | } 22 | 23 | 24 | public override bool Equals( object obj ) 25 | { 26 | // start with a base check and then compare if we are both using local values 27 | if( base.Equals( obj ) ) 28 | return this._useLocalPosition == ((PositionTweenProperty)obj)._useLocalPosition; 29 | 30 | // if we get here, we need to see if the other object is a position path tween of the same kind 31 | var otherAsPositionPath = obj as PositionPathTweenProperty; 32 | if( otherAsPositionPath != null ) 33 | return this._useLocalPosition == otherAsPositionPath.useLocalPosition; 34 | 35 | return false; 36 | } 37 | 38 | #endregion 39 | 40 | 41 | public override void prepareForUse() 42 | { 43 | _target = _ownerTween.target as Transform; 44 | 45 | _endValue = _originalEndValue; 46 | 47 | // if this is a from tween we need to swap the start and end values 48 | if( _ownerTween.isFrom ) 49 | { 50 | if( _useLocalPosition ) 51 | { 52 | if (_isRelative) 53 | _startValue = _target.localPosition + _endValue; 54 | else 55 | _startValue = _endValue; 56 | 57 | _endValue = _target.localPosition; 58 | } 59 | else 60 | { 61 | if (_isRelative) 62 | _startValue = _target.position + _endValue; 63 | else 64 | _startValue = _endValue; 65 | 66 | _endValue = _target.position; 67 | } 68 | } 69 | else 70 | { 71 | if( _useLocalPosition ) 72 | _startValue = _target.localPosition; 73 | else 74 | _startValue = _target.position; 75 | } 76 | 77 | base.prepareForUse(); 78 | } 79 | 80 | 81 | public override void tick( float totalElapsedTime ) 82 | { 83 | var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration ); 84 | var vec = GoTweenUtils.unclampedVector3Lerp( _startValue, _diffValue, easedTime ); 85 | 86 | if( _useLocalPosition ) 87 | _target.localPosition = vec; 88 | else 89 | _target.position = vec; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/PositionTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f372333393a1a4501a09d64bc262d2e4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/RotationQuaternionTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | public class RotationQuaternionTweenProperty : AbstractQuaternionTweenProperty 6 | { 7 | private bool _useLocalRotation; 8 | public bool useLocalRotation { get { return _useLocalRotation; } } 9 | 10 | 11 | public RotationQuaternionTweenProperty( Quaternion endValue, bool isRelative = false, bool useLocalRotation = false ) : base( endValue, isRelative ) 12 | { 13 | _useLocalRotation = useLocalRotation; 14 | } 15 | 16 | 17 | #region Object overrides 18 | 19 | public override int GetHashCode() 20 | { 21 | return base.GetHashCode(); 22 | } 23 | 24 | 25 | public override bool Equals( object obj ) 26 | { 27 | // start with a base check and then compare if we are both using local values 28 | if( base.Equals( obj ) ) 29 | return this._useLocalRotation == ((RotationQuaternionTweenProperty)obj)._useLocalRotation; 30 | 31 | return false; 32 | } 33 | 34 | #endregion 35 | 36 | 37 | public override void prepareForUse() 38 | { 39 | _target = _ownerTween.target as Transform; 40 | 41 | _endValue = _originalEndValue; 42 | 43 | // if this is a from tween we need to swap the start and end values 44 | if( _ownerTween.isFrom ) 45 | { 46 | _startValue = _endValue; 47 | 48 | if( _useLocalRotation ) 49 | _endValue = _target.localRotation; 50 | else 51 | _endValue = _target.rotation; 52 | } 53 | else 54 | { 55 | if( _useLocalRotation ) 56 | _startValue = _target.localRotation; 57 | else 58 | _startValue = _target.rotation; 59 | } 60 | 61 | base.prepareForUse(); 62 | } 63 | 64 | 65 | public override void tick( float totalElapsedTime ) 66 | { 67 | var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration ); 68 | Quaternion newOrientation = Quaternion.Slerp (_startValue, _endValue, easedTime); 69 | 70 | if( _useLocalRotation ) 71 | _target.localRotation = newOrientation; 72 | else 73 | _target.rotation = newOrientation; 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/RotationQuaternionTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a476a934239a4681b4241f6cce8aa62 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/RotationTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | public class RotationTweenProperty : AbstractVector3TweenProperty 6 | { 7 | private bool _useLocalRotation; 8 | public bool useLocalRotation { get { return _useLocalRotation; } } 9 | 10 | 11 | public RotationTweenProperty( Vector3 endValue, bool isRelative = false, bool useLocalRotation = false ) : base( endValue, isRelative ) 12 | { 13 | _useLocalRotation = useLocalRotation; 14 | } 15 | 16 | 17 | #region Object overrides 18 | 19 | public override int GetHashCode() 20 | { 21 | return base.GetHashCode(); 22 | } 23 | 24 | 25 | public override bool Equals( object obj ) 26 | { 27 | // start with a base check and then compare if we are both using local values 28 | if( base.Equals( obj ) ) 29 | return this._useLocalRotation == ((RotationTweenProperty)obj)._useLocalRotation; 30 | 31 | // if we get here, we need to see if the other object is a eulerAngles tween of the same kind 32 | var otherAsEuler = obj as EulerAnglesTweenProperty; 33 | if( otherAsEuler != null ) 34 | return this._useLocalRotation == otherAsEuler.useLocalEulers; 35 | 36 | return false; 37 | } 38 | 39 | #endregion 40 | 41 | 42 | public override void prepareForUse() 43 | { 44 | _target = _ownerTween.target as Transform; 45 | 46 | _endValue = _originalEndValue; 47 | 48 | // if this is a from tween we need to swap the start and end values 49 | if( _ownerTween.isFrom ) 50 | { 51 | _startValue = _endValue; 52 | 53 | if( _useLocalRotation ) 54 | _endValue = _target.localRotation.eulerAngles; 55 | else 56 | _endValue = _target.rotation.eulerAngles; 57 | } 58 | else 59 | { 60 | if( _useLocalRotation ) 61 | _startValue = _target.localRotation.eulerAngles; 62 | else 63 | _startValue = _target.rotation.eulerAngles; 64 | } 65 | 66 | // handle rotation carefully: when not relative, we always want to go the shortest possible distance to the new angle 67 | if( _isRelative && !_ownerTween.isFrom ) 68 | _diffValue = _startValue + _endValue; 69 | else 70 | _diffValue = new Vector3( Mathf.DeltaAngle( _startValue.x, _endValue.x ), Mathf.DeltaAngle( _startValue.y, _endValue.y ), Mathf.DeltaAngle( _startValue.z, _endValue.z ) ); 71 | } 72 | 73 | 74 | public override void tick( float totalElapsedTime ) 75 | { 76 | var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration ); 77 | var vec = GoTweenUtils.unclampedVector3Lerp( _startValue, _diffValue, easedTime ); 78 | 79 | if( _useLocalRotation ) 80 | _target.localRotation = Quaternion.Euler( vec ); 81 | else 82 | _target.rotation = Quaternion.Euler( vec ); 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/RotationTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e783a8e5c400d4037be1e46fe3c33ee0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/ScalePathTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | /// 6 | /// tweens scale along a path at constant speed between nodes. isRelative makes the path scale 7 | /// relative to the start scale of the object. a "from" tween will reverse the path and make the start 8 | /// scale be the last node in the path. 9 | /// 10 | public class ScalePathTweenProperty : AbstractTweenProperty 11 | { 12 | protected Transform _target; 13 | protected Vector3 _startValue; 14 | 15 | private GoSpline _path; 16 | 17 | 18 | public ScalePathTweenProperty( GoSpline path, bool isRelative = false ) : base( isRelative ) 19 | { 20 | _path = path; 21 | } 22 | 23 | 24 | #region Object overrides 25 | 26 | public override int GetHashCode() 27 | { 28 | return base.GetHashCode(); 29 | } 30 | 31 | 32 | public override bool Equals( object obj ) 33 | { 34 | // if base already determined that we are equal no need to check further 35 | if( base.Equals( obj ) ) 36 | return true; 37 | 38 | // we can be equal if the other object is a ScaleTweenProperty 39 | return obj.GetType() == typeof( ScaleTweenProperty ); 40 | } 41 | 42 | #endregion 43 | 44 | 45 | public override void prepareForUse() 46 | { 47 | _target = _ownerTween.target as Transform; 48 | 49 | // if this is a from tween first reverse the path then build it 50 | if( _ownerTween.isFrom ) 51 | _path.reverseNodes(); 52 | else 53 | _path.unreverseNodes(); 54 | 55 | _path.buildPath(); 56 | 57 | // a from tween means the start value is the last node 58 | if( _ownerTween.isFrom ) 59 | _startValue = _path.getLastNode(); 60 | else 61 | _startValue = _target.localScale; 62 | } 63 | 64 | 65 | public override void tick( float totalElapsedTime ) 66 | { 67 | var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration ); 68 | var vec = _path.getPointOnPath( easedTime ); 69 | 70 | // if we are relative, add the vec to our startValue 71 | if( _isRelative ) 72 | vec += _startValue; 73 | 74 | _target.localScale = vec; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/ScalePathTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed2a9c26628f648cd812a55c3cc09572 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/ScaleTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | public class ScaleTweenProperty : AbstractVector3TweenProperty 6 | { 7 | public ScaleTweenProperty( Vector3 endValue, bool isRelative = false ) : base( endValue, isRelative ) 8 | {} 9 | 10 | 11 | #region Object overrides 12 | 13 | public override int GetHashCode() 14 | { 15 | return base.GetHashCode(); 16 | } 17 | 18 | 19 | public override bool Equals( object obj ) 20 | { 21 | // if base already determined that we are equal no need to check further 22 | if( base.Equals( obj ) ) 23 | return true; 24 | 25 | // we can be equal if the other object is a ScalePathTweenProperty 26 | return obj.GetType() == typeof( ScalePathTweenProperty ); 27 | } 28 | 29 | #endregion 30 | 31 | 32 | public override void prepareForUse() 33 | { 34 | _target = _ownerTween.target as Transform; 35 | 36 | _endValue = _originalEndValue; 37 | 38 | // if this is a from tween we need to swap the start and end values 39 | if( _ownerTween.isFrom ) 40 | { 41 | _startValue = _endValue; 42 | _endValue = _target.localScale; 43 | } 44 | else 45 | { 46 | _startValue = _target.localScale; 47 | } 48 | 49 | base.prepareForUse(); 50 | } 51 | 52 | 53 | public override void tick( float totalElapsedTime ) 54 | { 55 | var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration ); 56 | _target.localScale = GoTweenUtils.unclampedVector3Lerp( _startValue, _diffValue, easedTime ); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/ScaleTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af4196a114d624232b278034ec06ce24 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/ShakeTweenProperty.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | public class ShakeTweenProperty : AbstractTweenProperty 6 | { 7 | private Transform _target; 8 | private Vector3 _shakeMagnitude; 9 | 10 | private Vector3 _originalEndValue; 11 | private Vector3 _startPosition; 12 | private Vector3 _startScale; 13 | private Vector3 _startEulers; 14 | 15 | private GoShakeType _shakeType; 16 | private int _frameCount; 17 | private int _frameMod; 18 | private bool _useLocalProperties; 19 | public bool useLocalProperties { get { return _useLocalProperties; } } 20 | 21 | 22 | /// 23 | /// you can shake any combination of position, scale and eulers by passing in a bitmask of the types you want to shake. frameMod 24 | /// allows you to specify what frame count the shakes should occur on. for example, a frameMod of 3 would mean that only when 25 | /// frameCount % 3 == 0 will the shake occur 26 | /// 27 | public ShakeTweenProperty( Vector3 shakeMagnitude, GoShakeType shakeType, int frameMod = 1, bool useLocalProperties = false ) : base( true ) 28 | { 29 | _shakeMagnitude = shakeMagnitude; 30 | _shakeType = shakeType; 31 | _frameMod = frameMod; 32 | _useLocalProperties = useLocalProperties; 33 | } 34 | 35 | 36 | #region Object overrides 37 | 38 | public override int GetHashCode() 39 | { 40 | return base.GetHashCode(); 41 | } 42 | 43 | 44 | public override bool Equals( object obj ) 45 | { 46 | // start with a base check and then compare our material names 47 | if( base.Equals( obj ) ) 48 | return this._shakeType == ((ShakeTweenProperty)obj)._shakeType; 49 | 50 | return false; 51 | } 52 | 53 | #endregion 54 | 55 | 56 | public override bool validateTarget( object target ) 57 | { 58 | return target is Transform; 59 | } 60 | 61 | 62 | public override void prepareForUse() 63 | { 64 | _target = _ownerTween.target as Transform; 65 | _frameCount = 0; 66 | 67 | // store off any properties we will be shaking 68 | if( ( _shakeType & GoShakeType.Position ) != 0 ) 69 | { 70 | if( _useLocalProperties ) 71 | _startPosition = _target.localPosition; 72 | else 73 | _startPosition = _target.position; 74 | } 75 | 76 | if( ( _shakeType & GoShakeType.Eulers ) != 0 ) 77 | { 78 | if( _useLocalProperties ) 79 | _startEulers = _target.eulerAngles; 80 | else 81 | _startEulers = _target.eulerAngles; 82 | } 83 | 84 | if( ( _shakeType & GoShakeType.Scale ) != 0 ) 85 | _startScale = _target.localScale; 86 | } 87 | 88 | 89 | private Vector3 randomDiminishingTarget( float falloffValue ) 90 | { 91 | return new Vector3 92 | ( 93 | Random.Range( -_shakeMagnitude.x, _shakeMagnitude.x ) * falloffValue, 94 | Random.Range( -_shakeMagnitude.y, _shakeMagnitude.y ) * falloffValue, 95 | Random.Range( -_shakeMagnitude.z, _shakeMagnitude.z ) * falloffValue 96 | ); 97 | } 98 | 99 | 100 | public override void tick( float totalElapsedTime ) 101 | { 102 | // should we skip any frames? 103 | if( _frameMod > 1 && ++_frameCount % _frameMod != 0 ) 104 | return; 105 | 106 | // we want 1 minus the eased time so that we go from 1 - 0 for a shake 107 | var easedTime = 1 - _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration ); 108 | 109 | 110 | // shake any properties required 111 | if( ( _shakeType & GoShakeType.Position ) != 0 ) 112 | { 113 | var val = _startPosition + randomDiminishingTarget( easedTime ); 114 | if( _useLocalProperties ) 115 | _target.localPosition = val; 116 | else 117 | _target.position = val; 118 | } 119 | 120 | if( ( _shakeType & GoShakeType.Eulers ) != 0 ) 121 | { 122 | var val = _startEulers + randomDiminishingTarget( easedTime ); 123 | if( _useLocalProperties ) 124 | _target.localEulerAngles = val; 125 | else 126 | _target.eulerAngles = val; 127 | } 128 | 129 | if( ( _shakeType & GoShakeType.Scale ) != 0 ) 130 | { 131 | _target.localScale = _startScale + randomDiminishingTarget( easedTime ); 132 | } 133 | } 134 | 135 | } 136 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/specificTypes/ShakeTweenProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6cf366ef096364042b041e422af86bbc 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/splines.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82ff7a332193a46a0aed718a4d6af4ba 3 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/splines/AbstractGoSplineSolver.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | public abstract class AbstractGoSplineSolver 7 | { 8 | protected List _nodes; 9 | public List nodes { get { return _nodes; } } 10 | protected float _pathLength; 11 | 12 | // how many subdivisions should we divide each segment into? higher values take longer to build and lookup but 13 | // result in closer to actual constant velocity 14 | protected int totalSubdivisionsPerNodeForLookupTable = 5; 15 | protected Dictionary _segmentTimeForDistance; // holds data in the form [time:distance] as a lookup table 16 | 17 | 18 | 19 | // the default implementation breaks the spline down into segments and approximates distance by adding up 20 | // the length of each segment 21 | public virtual void buildPath() 22 | { 23 | var totalSudivisions = _nodes.Count * totalSubdivisionsPerNodeForLookupTable; 24 | _pathLength = 0; 25 | float timePerSlice = 1f / totalSudivisions; 26 | 27 | // we dont care about the first node for distances because they are always t:0 and len:0 28 | _segmentTimeForDistance = new Dictionary( totalSudivisions ); 29 | 30 | 31 | var lastPoint = getPoint( 0 ); 32 | 33 | // skip the first node and wrap 1 extra node 34 | for( var i = 1; i < totalSudivisions + 1; i++ ) 35 | { 36 | // what is the current time along the path? 37 | float currentTime = timePerSlice * i; 38 | 39 | var currentPoint = getPoint( currentTime ); 40 | _pathLength += Vector3.Distance( currentPoint, lastPoint ); 41 | lastPoint = currentPoint; 42 | 43 | _segmentTimeForDistance.Add( currentTime, _pathLength ); 44 | } 45 | } 46 | 47 | 48 | public abstract void closePath(); 49 | 50 | 51 | // gets the raw point not taking into account constant speed. used for drawing gizmos 52 | public abstract Vector3 getPoint( float t ); 53 | 54 | 55 | // gets the point taking in to account constant speed. the default implementation approximates the length of the spline 56 | // by walking it and calculating the distance between each node 57 | public virtual Vector3 getPointOnPath( float t ) 58 | { 59 | // we know exactly how far along the path we want to be from the passed in t 60 | var targetDistance = _pathLength * t; 61 | 62 | // store the previous and next nodes in our lookup table 63 | var previousNodeTime = 0f; 64 | var previousNodeLength = 0f; 65 | var nextNodeTime = 0f; 66 | var nextNodeLength = 0f; 67 | 68 | // loop through all the values in our lookup table and find the two nodes our targetDistance falls between 69 | foreach( var item in _segmentTimeForDistance ) 70 | { 71 | // have we passed our targetDistance yet? 72 | if( item.Value >= targetDistance ) 73 | { 74 | nextNodeTime = item.Key; 75 | nextNodeLength = item.Value; 76 | 77 | if( previousNodeTime > 0 ) 78 | previousNodeLength = _segmentTimeForDistance[previousNodeTime]; 79 | 80 | break; 81 | } 82 | previousNodeTime = item.Key; 83 | } 84 | 85 | // translate the values from the lookup table estimating the arc length between our known nodes from the lookup table 86 | var segmentTime = nextNodeTime - previousNodeTime; 87 | var segmentLength = nextNodeLength - previousNodeLength; 88 | var distanceIntoSegment = targetDistance - previousNodeLength; 89 | 90 | t = previousNodeTime + ( distanceIntoSegment / segmentLength ) * segmentTime; 91 | 92 | return getPoint( t ); 93 | } 94 | 95 | 96 | public void reverseNodes() 97 | { 98 | _nodes.Reverse(); 99 | } 100 | 101 | 102 | public virtual void drawGizmos() 103 | {} 104 | 105 | } 106 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/splines/AbstractGoSplineSolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f87ecb9f470844d2abef8dbbd08a0102 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/splines/GoSpline.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ed66155442f6467bae99f410e969cc3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/splines/GoSplineCatmullRomSolver.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | public class GoSplineCatmullRomSolver : AbstractGoSplineSolver 7 | { 8 | public GoSplineCatmullRomSolver( List nodes ) 9 | { 10 | _nodes = nodes; 11 | } 12 | 13 | 14 | #region AbstractGoSplineSolver 15 | 16 | // closing a Catmull-Rom spline: http://cl.ly/GOZv 17 | public override void closePath() 18 | { 19 | // first, remove the control points 20 | _nodes.RemoveAt( 0 ); 21 | _nodes.RemoveAt( _nodes.Count - 1 ); 22 | 23 | // if the first and last node are not the same add one 24 | if( _nodes[0] != _nodes[_nodes.Count - 1] ) 25 | _nodes.Add( _nodes[0] ); 26 | 27 | 28 | // figure out the distances from node 0 to the first node and the second to last node (remember above 29 | // we made the last node equal to the first so node 0 and _nodes.Count - 1 are identical) 30 | var distanceToFirstNode = Vector3.Distance( _nodes[0], _nodes[1] ); 31 | var distanceToLastNode = Vector3.Distance( _nodes[0], _nodes[_nodes.Count - 2] ); 32 | 33 | 34 | // handle the first node. we want to use the distance to the LAST (opposite segment) node to figure out where this control point should be 35 | var distanceToFirstTarget = distanceToLastNode / Vector3.Distance( _nodes[1], _nodes[0] ); 36 | var lastControlNode = ( _nodes[0] + ( _nodes[1] - _nodes[0] ) * distanceToFirstTarget ); 37 | 38 | 39 | // handle the last node. for this one, we want the distance to the first node for the control point but it should 40 | // be along the vector to the last node 41 | var distanceToLastTarget = distanceToFirstNode / Vector3.Distance( _nodes[_nodes.Count - 2], _nodes[0] ); 42 | var firstControlNode = ( _nodes[0] + ( _nodes[_nodes.Count - 2] - _nodes[0] ) * distanceToLastTarget ); 43 | 44 | _nodes.Insert( 0, firstControlNode ); 45 | _nodes.Add( lastControlNode ); 46 | } 47 | 48 | 49 | public override Vector3 getPoint( float t ) 50 | { 51 | int numSections = _nodes.Count - 3; 52 | int currentNode = Mathf.Min( Mathf.FloorToInt( t * (float)numSections ), numSections - 1 ); 53 | float u = t * (float)numSections - (float)currentNode; 54 | 55 | Vector3 a = _nodes[currentNode]; 56 | Vector3 b = _nodes[currentNode + 1]; 57 | Vector3 c = _nodes[currentNode + 2]; 58 | Vector3 d = _nodes[currentNode + 3]; 59 | 60 | return .5f * 61 | ( 62 | ( -a + 3f * b - 3f * c + d ) * ( u * u * u ) 63 | + ( 2f * a - 5f * b + 4f * c - d ) * ( u * u ) 64 | + ( -a + c ) * u 65 | + 2f * b 66 | ); 67 | } 68 | 69 | 70 | public override void drawGizmos() 71 | { 72 | if( _nodes.Count < 2 ) 73 | return; 74 | 75 | // draw the control points 76 | var originalColor = Gizmos.color; 77 | Gizmos.color = new Color( 1, 1, 1, 0.3f ); 78 | 79 | Gizmos.DrawLine( _nodes[0], _nodes[1] ); 80 | Gizmos.DrawLine( _nodes[_nodes.Count - 1], _nodes[_nodes.Count - 2] ); 81 | 82 | Gizmos.color = originalColor; 83 | } 84 | 85 | #endregion 86 | 87 | } 88 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/splines/GoSplineCatmullRomSolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4e3d83fc59fd47d3a469ac52b3955ec 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/splines/GoSplineCubicBezierSolver.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | /// 7 | /// nodes should be in the order start, end, control1, control2 8 | /// 9 | public class GoSplineCubicBezierSolver : AbstractGoSplineSolver 10 | { 11 | public GoSplineCubicBezierSolver( List nodes ) 12 | { 13 | _nodes = nodes; 14 | } 15 | 16 | 17 | #region AbstractGoSplineSolver 18 | 19 | public override void closePath() 20 | { 21 | 22 | } 23 | 24 | 25 | public override Vector3 getPoint( float t ) 26 | { 27 | float d = 1f - t; 28 | return d * d * d * _nodes[0] + 3f * d * d * t * _nodes[2] + 3f * d * t * t * _nodes[3] + t * t * t * _nodes[1]; 29 | } 30 | 31 | 32 | public override void drawGizmos() 33 | { 34 | // draw the control points 35 | var originalColor = Gizmos.color; 36 | Gizmos.color = Color.red; 37 | 38 | Gizmos.DrawLine( _nodes[0], _nodes[2] ); 39 | Gizmos.DrawLine( _nodes[3], _nodes[1] ); 40 | 41 | Gizmos.color = originalColor; 42 | } 43 | 44 | #endregion 45 | 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/splines/GoSplineCubicBezierSolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0465a564e2fcd462eb4b5b4bdfd1532c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/splines/GoSplineQuadraticBezierSolver.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | /// 7 | /// nodes should be in the order start, control, end 8 | /// 9 | public class GoSplineQuadraticBezierSolver : AbstractGoSplineSolver 10 | { 11 | public GoSplineQuadraticBezierSolver( List nodes ) 12 | { 13 | _nodes = nodes; 14 | } 15 | 16 | 17 | // http://www.gamedev.net/topic/551455-length-of-a-generalized-quadratic-bezier-curve-in-3d/ 18 | protected float quadBezierLength( Vector3 startPoint, Vector3 controlPoint, Vector3 endPoint ) 19 | { 20 | // ASSERT: all inputs are distinct points. 21 | var A = new Vector3[2]; 22 | A[0] = controlPoint - startPoint; 23 | A[1] = startPoint - 2f * controlPoint + endPoint; 24 | 25 | float length; 26 | 27 | if( A[1] != Vector3.zero ) 28 | { 29 | // Coefficients of f(t) = c*t^2 + b*t + a. 30 | float c = 4.0f * Vector3.Dot( A[1], A[1] ); // A[1].Dot(A[1]); // c > 0 to be in this block of code 31 | float b = 8.0f * Vector3.Dot( A[0], A[1] ); // A[0].Dot(A[1]); 32 | float a = 4.0f * Vector3.Dot( A[0], A[0] ); // A[0].Dot(A[0]); // a > 0 by assumption 33 | float q = 4.0f * a * c - b * b; // = 16*|Cross(A0,A1)| >= 0 34 | 35 | float twoCpB = 2.0f * c + b; 36 | float sumCBA = c + b + a; 37 | float mult0 = 0.25f / c; 38 | float mult1 = q / ( 8.0f * Mathf.Pow( c, 1.5f ) ); 39 | length = mult0 * ( twoCpB * Mathf.Sqrt( sumCBA ) - b * Mathf.Sqrt( a ) ) + 40 | mult1 * ( Mathf.Log( 2.0f * Mathf.Sqrt( c * sumCBA ) + twoCpB ) - Mathf.Log( 2.0f * Mathf.Sqrt( c * a ) + b ) ); 41 | } 42 | else 43 | { 44 | length = 2.0f * A[0].magnitude; 45 | } 46 | 47 | return length; 48 | } 49 | 50 | 51 | #region AbstractGoSplineSolver 52 | 53 | public override void closePath() 54 | { 55 | 56 | } 57 | 58 | 59 | public override Vector3 getPoint( float t ) 60 | { 61 | float d = 1f - t; 62 | return d * d * _nodes[0] + 2f * d * t * _nodes[1] + t * t * _nodes[2]; 63 | } 64 | 65 | 66 | public override void drawGizmos() 67 | { 68 | // draw the control points 69 | var originalColor = Gizmos.color; 70 | Gizmos.color = Color.red; 71 | 72 | Gizmos.DrawLine( _nodes[0], _nodes[1] ); 73 | Gizmos.DrawLine( _nodes[1], _nodes[2] ); 74 | 75 | Gizmos.color = originalColor; 76 | } 77 | 78 | #endregion 79 | 80 | } 81 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/splines/GoSplineQuadraticBezierSolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 474c1029fc1d848998185b77129ed5c0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/splines/GoSplineStraightLineSolver.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | public class GoSplineStraightLineSolver : AbstractGoSplineSolver 7 | { 8 | private Dictionary _segmentStartLocations; 9 | private Dictionary _segmentDistances; 10 | private int _currentSegment; 11 | 12 | 13 | public GoSplineStraightLineSolver( List nodes ) 14 | { 15 | _nodes = nodes; 16 | } 17 | 18 | 19 | #region AbstractGoSplineSolver 20 | 21 | public override void buildPath() 22 | { 23 | // we need at least 3 nodes (more than 1 segment) to bother with building 24 | if( _nodes.Count < 3 ) 25 | return; 26 | 27 | // we dont care about the first node for distances because they are always t:0 and len:0 and we dont need the first or last for locations 28 | _segmentStartLocations = new Dictionary( _nodes.Count - 2 ); 29 | _segmentDistances = new Dictionary( _nodes.Count - 1 ); 30 | 31 | for( var i = 0; i < _nodes.Count - 1; i++ ) 32 | { 33 | // calculate the distance to the next node 34 | var distance = Vector3.Distance( _nodes[i], _nodes[i + 1] ); 35 | _segmentDistances.Add( i, distance ); 36 | _pathLength += distance; 37 | } 38 | 39 | 40 | // now that we have the total length we can loop back through and calculate the segmentStartLocations 41 | var accruedRouteLength = 0f; 42 | for( var i = 0; i < _segmentDistances.Count - 1; i++ ) 43 | { 44 | accruedRouteLength += _segmentDistances[i]; 45 | _segmentStartLocations.Add( i + 1, accruedRouteLength / _pathLength ); 46 | } 47 | } 48 | 49 | 50 | public override void closePath() 51 | { 52 | // add a node to close the route if necessary 53 | if( _nodes[0] != _nodes[_nodes.Count - 1] ) 54 | _nodes.Add( _nodes[0] ); 55 | } 56 | 57 | 58 | public override Vector3 getPoint( float t ) 59 | { 60 | return getPointOnPath( t ); 61 | } 62 | 63 | 64 | public override Vector3 getPointOnPath( float t ) 65 | { 66 | // we need at least 3 nodes (more than 1 segment) to bother using the look up tables. else we just lerp directly from 67 | // node 1 to node 2 68 | if( _nodes.Count < 3 ) 69 | return Vector3.Lerp( _nodes[0], _nodes[1], t ); 70 | 71 | 72 | // which segment are we on? 73 | _currentSegment = 0; 74 | foreach( var info in _segmentStartLocations ) 75 | { 76 | if( info.Value < t ) 77 | { 78 | _currentSegment = info.Key; 79 | continue; 80 | } 81 | 82 | break; 83 | } 84 | 85 | // now we need to know the total distance travelled in all previous segments so we can subtract it from the total 86 | // travelled to get exactly how far along the current segment we are 87 | var totalDistanceTravelled = t * _pathLength; 88 | var i = _currentSegment - 1; // we want all the previous segment lengths 89 | while( i >= 0 ) 90 | { 91 | totalDistanceTravelled -= _segmentDistances[i]; 92 | --i; 93 | } 94 | 95 | return Vector3.Lerp( _nodes[_currentSegment], _nodes[_currentSegment + 1], totalDistanceTravelled / _segmentDistances[_currentSegment] ); 96 | } 97 | 98 | #endregion 99 | 100 | } 101 | -------------------------------------------------------------------------------- /Assets/Plugins/GoKit/properties/splines/GoSplineStraightLineSolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86af7ded131634ccfa3962417a095e05 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /Assets/Standard Assets (Mobile).meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99d520f65e8a545cf966b5179ed81e2c 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets (Mobile)/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81f90a056484f433badb55a7c96de025 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets (Mobile)/Textures/grid.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ricardojmendez/UnitySteerExamples/91dac8b4fbe8f28a171c28db0d757f644eade24b/Assets/Standard Assets (Mobile)/Textures/grid.psd -------------------------------------------------------------------------------- /Assets/Standard Assets (Mobile)/Textures/grid.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b23c9e3952e246c180a8080104ae60b 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: 2 28 | aniso: 9 29 | mipBias: 0 30 | wrapMode: 0 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/UnitySteer.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48ea7d87f29bb4b27bf1a9087d2bc0d7 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03255241200194d4283e8818aca1d0ae 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Utils/SingletonPerLevel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public static class SingletonPerLevel where T : Component 5 | { 6 | static volatile T _instance; 7 | static object _lock = new object(); 8 | 9 | static SingletonPerLevel() 10 | { 11 | } 12 | 13 | public static T Instance 14 | { 15 | get 16 | { 17 | if (!typeof(T).IsSubclassOf(typeof(Component))) return null; 18 | if (!(_instance is Component)) 19 | { 20 | lock(_lock) 21 | { 22 | _instance = GameObject.FindObjectOfType(typeof(T)) as T; 23 | if(_instance == null && Application.isPlaying) 24 | { 25 | #if TRACE_INITIALIZATION 26 | Debug.Log("Initializing in "+Application.loadedLevelName); 27 | var st = new System.Diagnostics.StackTrace(true); 28 | for(int i =0; i< st.FrameCount; i++ ) 29 | { 30 | // Note that high up the call stack, there is only 31 | // one stack frame. 32 | var sf = st.GetFrame(i); 33 | Debug.Log(string.Format("High up the call stack, Method: {0} Line Number: {1} File: {2}", 34 | sf.GetMethod(), sf.GetFileLineNumber(), sf.GetFileName())); 35 | } 36 | #endif 37 | 38 | GameObject go = new GameObject(string.Format("Singleton/Level: {0}", typeof(T).Name)); 39 | _instance = go.AddComponent(); 40 | } 41 | } 42 | } 43 | return _instance; 44 | } 45 | } 46 | 47 | public static void Reset() 48 | { 49 | _instance = null; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Assets/Utils/SingletonPerLevel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9441558f20e4149288eb54423a35f391 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | UnitySteer -- Unity port of OpenSteer 2 | 3 | Ported to Unity and expanded by: 4 | - Ricardo J. Mendez 5 | - Emil Johansen 6 | 7 | UnitySteer is open source software distributed in accordance with the MIT 8 | License (http://www.opensource.org/licenses/mit-license.php). Full text 9 | of the license is below. 10 | 11 | 12 | Based on OpenSteer - pure .net port by Simon Oliver 13 | http://www.handcircus.com 14 | 15 | 16 | OpenSteer -- Steering Behaviors for Autonomous Characters 17 | 18 | Copyright (c) 2002-2003, Sony Computer Entertainment America 19 | Original author: Craig Reynolds 20 | 21 | 22 | OpenSteer is open source software distributed in accordance with the MIT 23 | License (http://www.opensource.org/licenses/mit-license.php) which says: 24 | 25 | 26 | Permission is hereby granted, free of charge, to any person obtaining a 27 | copy of this software and associated documentation files (the "Software"), 28 | to deal in the Software without restriction, including without limitation 29 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 30 | and/or sell copies of the Software, and to permit persons to whom the 31 | Software is furnished to do so, subject to the following conditions: 32 | 33 | The above copyright notice and this permission notice shall be included in 34 | all copies or substantial portions of the Software. 35 | 36 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 37 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 38 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 39 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 40 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 41 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 42 | DEALINGS IN THE SOFTWARE. 43 | 44 | 45 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | m_SpeedOfSound: 347 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_DSPBufferSize: 0 12 | m_DisableAudio: 0 13 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | m_Gravity: {x: 0, y: -9.81000042, z: 0} 7 | m_DefaultMaterial: {fileID: 0} 8 | m_BounceThreshold: 2 9 | m_SleepVelocity: .150000006 10 | m_SleepAngularVelocity: .140000001 11 | m_MaxAngularVelocity: 7 12 | m_MinPenetrationForPenalty: .00999999978 13 | m_SolverIterationCount: 6 14 | m_RaycastsHitTriggers: 1 15 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 16 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Examples/03 - Advanced/PlayingTag/Tag.unity 10 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_ExternalVersionControlSupport: Hidden Meta Files 8 | m_SerializationMode: 2 9 | m_WebSecurityEmulationEnabled: 0 10 | m_WebSecurityEmulationHostUrl: http://www.mydomain.com/mygame.unity3d 11 | m_DefaultBehaviorMode: 0 12 | m_SpritePackerMode: 0 13 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_LegacyDeferred: 14 | m_Mode: 1 15 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 16 | m_AlwaysIncludedShaders: 17 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 18 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 19 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 20 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 21 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 22 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 23 | m_PreloadedShaders: [] 24 | m_ShaderSettings: 25 | useScreenSpaceShadows: 1 26 | m_BuildTargetShaderSettings: [] 27 | m_LightmapStripping: 0 28 | m_FogStripping: 0 29 | m_LightmapKeepPlain: 1 30 | m_LightmapKeepDirCombined: 1 31 | m_LightmapKeepDirSeparate: 1 32 | m_LightmapKeepDynamicPlain: 1 33 | m_LightmapKeepDynamicDirCombined: 1 34 | m_LightmapKeepDynamicDirSeparate: 1 35 | m_FogKeepLinear: 1 36 | m_FogKeepExp: 1 37 | m_FogKeepExp2: 1 38 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshLayers: 5 | m_ObjectHideFlags: 0 6 | Built-in Layer 0: 7 | name: Default 8 | cost: 1 9 | editType: 2 10 | Built-in Layer 1: 11 | name: Not Walkable 12 | cost: 1 13 | editType: 0 14 | Built-in Layer 2: 15 | name: Jump 16 | cost: 2 17 | editType: 2 18 | User Layer 0: 19 | name: 20 | cost: 1 21 | editType: 3 22 | User Layer 1: 23 | name: 24 | cost: 1 25 | editType: 3 26 | User Layer 2: 27 | name: 28 | cost: 1 29 | editType: 3 30 | User Layer 3: 31 | name: 32 | cost: 1 33 | editType: 3 34 | User Layer 4: 35 | name: 36 | cost: 1 37 | editType: 3 38 | User Layer 5: 39 | name: 40 | cost: 1 41 | editType: 3 42 | User Layer 6: 43 | name: 44 | cost: 1 45 | editType: 3 46 | User Layer 7: 47 | name: 48 | cost: 1 49 | editType: 3 50 | User Layer 8: 51 | name: 52 | cost: 1 53 | editType: 3 54 | User Layer 9: 55 | name: 56 | cost: 1 57 | editType: 3 58 | User Layer 10: 59 | name: 60 | cost: 1 61 | editType: 3 62 | User Layer 11: 63 | name: 64 | cost: 1 65 | editType: 3 66 | User Layer 12: 67 | name: 68 | cost: 1 69 | editType: 3 70 | User Layer 13: 71 | name: 72 | cost: 1 73 | editType: 3 74 | User Layer 14: 75 | name: 76 | cost: 1 77 | editType: 3 78 | User Layer 15: 79 | name: 80 | cost: 1 81 | editType: 3 82 | User Layer 16: 83 | name: 84 | cost: 1 85 | editType: 3 86 | User Layer 17: 87 | name: 88 | cost: 1 89 | editType: 3 90 | User Layer 18: 91 | name: 92 | cost: 1 93 | editType: 3 94 | User Layer 19: 95 | name: 96 | cost: 1 97 | editType: 3 98 | User Layer 20: 99 | name: 100 | cost: 1 101 | editType: 3 102 | User Layer 21: 103 | name: 104 | cost: 1 105 | editType: 3 106 | User Layer 22: 107 | name: 108 | cost: 1 109 | editType: 3 110 | User Layer 23: 111 | name: 112 | cost: 1 113 | editType: 3 114 | User Layer 24: 115 | name: 116 | cost: 1 117 | editType: 3 118 | User Layer 25: 119 | name: 120 | cost: 1 121 | editType: 3 122 | User Layer 26: 123 | name: 124 | cost: 1 125 | editType: 3 126 | User Layer 27: 127 | name: 128 | cost: 1 129 | editType: 3 130 | User Layer 28: 131 | name: 132 | cost: 1 133 | editType: 3 134 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshLayers: 5 | m_ObjectHideFlags: 0 6 | Built-in Layer 0: 7 | name: Default 8 | cost: 1 9 | editType: 2 10 | Built-in Layer 1: 11 | name: Not Walkable 12 | cost: 1 13 | editType: 0 14 | Built-in Layer 2: 15 | name: Jump 16 | cost: 2 17 | editType: 2 18 | User Layer 0: 19 | name: 20 | cost: 1 21 | editType: 3 22 | User Layer 1: 23 | name: 24 | cost: 1 25 | editType: 3 26 | User Layer 2: 27 | name: 28 | cost: 1 29 | editType: 3 30 | User Layer 3: 31 | name: 32 | cost: 1 33 | editType: 3 34 | User Layer 4: 35 | name: 36 | cost: 1 37 | editType: 3 38 | User Layer 5: 39 | name: 40 | cost: 1 41 | editType: 3 42 | User Layer 6: 43 | name: 44 | cost: 1 45 | editType: 3 46 | User Layer 7: 47 | name: 48 | cost: 1 49 | editType: 3 50 | User Layer 8: 51 | name: 52 | cost: 1 53 | editType: 3 54 | User Layer 9: 55 | name: 56 | cost: 1 57 | editType: 3 58 | User Layer 10: 59 | name: 60 | cost: 1 61 | editType: 3 62 | User Layer 11: 63 | name: 64 | cost: 1 65 | editType: 3 66 | User Layer 12: 67 | name: 68 | cost: 1 69 | editType: 3 70 | User Layer 13: 71 | name: 72 | cost: 1 73 | editType: 3 74 | User Layer 14: 75 | name: 76 | cost: 1 77 | editType: 3 78 | User Layer 15: 79 | name: 80 | cost: 1 81 | editType: 3 82 | User Layer 16: 83 | name: 84 | cost: 1 85 | editType: 3 86 | User Layer 17: 87 | name: 88 | cost: 1 89 | editType: 3 90 | User Layer 18: 91 | name: 92 | cost: 1 93 | editType: 3 94 | User Layer 19: 95 | name: 96 | cost: 1 97 | editType: 3 98 | User Layer 20: 99 | name: 100 | cost: 1 101 | editType: 3 102 | User Layer 21: 103 | name: 104 | cost: 1 105 | editType: 3 106 | User Layer 22: 107 | name: 108 | cost: 1 109 | editType: 3 110 | User Layer 23: 111 | name: 112 | cost: 1 113 | editType: 3 114 | User Layer 24: 115 | name: 116 | cost: 1 117 | editType: 3 118 | User Layer 25: 119 | name: 120 | cost: 1 121 | editType: 3 122 | User Layer 26: 123 | name: 124 | cost: 1 125 | editType: 3 126 | User Layer 27: 127 | name: 128 | cost: 1 129 | editType: 3 130 | User Layer 28: 131 | name: 132 | cost: 1 133 | editType: 3 134 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | m_Gravity: {x: 0, y: -9.81000042} 7 | m_DefaultMaterial: {fileID: 0} 8 | m_VelocityIterations: 8 9 | m_PositionIterations: 3 10 | m_RaycastsHitTriggers: 1 11 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 12 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.3.1p2 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 3 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Fastest 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | blendWeights: 1 18 | textureQuality: 1 19 | anisotropicTextures: 0 20 | antiAliasing: 0 21 | softParticles: 0 22 | softVegetation: 0 23 | vSyncCount: 0 24 | lodBias: .300000012 25 | maximumLODLevel: 0 26 | particleRaycastBudget: 4 27 | excludedTargetPlatforms: [] 28 | - serializedVersion: 2 29 | name: Fast 30 | pixelLightCount: 0 31 | shadows: 0 32 | shadowResolution: 0 33 | shadowProjection: 1 34 | shadowCascades: 1 35 | shadowDistance: 20 36 | blendWeights: 2 37 | textureQuality: 0 38 | anisotropicTextures: 0 39 | antiAliasing: 0 40 | softParticles: 0 41 | softVegetation: 0 42 | vSyncCount: 0 43 | lodBias: .400000006 44 | maximumLODLevel: 0 45 | particleRaycastBudget: 16 46 | excludedTargetPlatforms: [] 47 | - serializedVersion: 2 48 | name: Simple 49 | pixelLightCount: 1 50 | shadows: 1 51 | shadowResolution: 0 52 | shadowProjection: 1 53 | shadowCascades: 1 54 | shadowDistance: 20 55 | blendWeights: 2 56 | textureQuality: 0 57 | anisotropicTextures: 1 58 | antiAliasing: 0 59 | softParticles: 0 60 | softVegetation: 0 61 | vSyncCount: 0 62 | lodBias: .699999988 63 | maximumLODLevel: 0 64 | particleRaycastBudget: 64 65 | excludedTargetPlatforms: [] 66 | - serializedVersion: 2 67 | name: Good 68 | pixelLightCount: 2 69 | shadows: 2 70 | shadowResolution: 1 71 | shadowProjection: 1 72 | shadowCascades: 2 73 | shadowDistance: 40 74 | blendWeights: 2 75 | textureQuality: 0 76 | anisotropicTextures: 1 77 | antiAliasing: 0 78 | softParticles: 0 79 | softVegetation: 1 80 | vSyncCount: 1 81 | lodBias: 1 82 | maximumLODLevel: 0 83 | particleRaycastBudget: 256 84 | excludedTargetPlatforms: [] 85 | - serializedVersion: 2 86 | name: Beautiful 87 | pixelLightCount: 3 88 | shadows: 2 89 | shadowResolution: 2 90 | shadowProjection: 1 91 | shadowCascades: 2 92 | shadowDistance: 70 93 | blendWeights: 4 94 | textureQuality: 0 95 | anisotropicTextures: 2 96 | antiAliasing: 2 97 | softParticles: 1 98 | softVegetation: 1 99 | vSyncCount: 1 100 | lodBias: 1.5 101 | maximumLODLevel: 0 102 | particleRaycastBudget: 1024 103 | excludedTargetPlatforms: [] 104 | - serializedVersion: 2 105 | name: Fantastic 106 | pixelLightCount: 4 107 | shadows: 2 108 | shadowResolution: 2 109 | shadowProjection: 1 110 | shadowCascades: 4 111 | shadowDistance: 150 112 | blendWeights: 4 113 | textureQuality: 0 114 | anisotropicTextures: 2 115 | antiAliasing: 2 116 | softParticles: 1 117 | softVegetation: 1 118 | vSyncCount: 1 119 | lodBias: 2 120 | maximumLODLevel: 0 121 | particleRaycastBudget: 4096 122 | excludedTargetPlatforms: [] 123 | m_PerPlatformDefaultQuality: 124 | Android: 2 125 | BlackBerry: 2 126 | FlashPlayer: 3 127 | GLES Emulation: 3 128 | PS3: 3 129 | Standalone: 3 130 | Tizen: 2 131 | WP8: 3 132 | Web: 3 133 | Wii: 3 134 | Windows Store Apps: 3 135 | XBOX360: 3 136 | iPhone: 2 137 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | tags: 6 | - 7 | Builtin Layer 0: Default 8 | Builtin Layer 1: TransparentFX 9 | Builtin Layer 2: Ignore Raycast 10 | Builtin Layer 3: 11 | Builtin Layer 4: Water 12 | Builtin Layer 5: 13 | Builtin Layer 6: 14 | Builtin Layer 7: 15 | User Layer 8: 16 | User Layer 9: 17 | User Layer 10: 18 | User Layer 11: 19 | User Layer 12: 20 | User Layer 13: 21 | User Layer 14: 22 | User Layer 15: 23 | User Layer 16: 24 | User Layer 17: 25 | User Layer 18: 26 | User Layer 19: 27 | User Layer 20: 28 | User Layer 21: 29 | User Layer 22: 30 | User Layer 23: 31 | User Layer 24: 32 | User Layer 25: 33 | User Layer 26: 34 | User Layer 27: 35 | User Layer 28: 36 | User Layer 29: 37 | User Layer 30: 38 | User Layer 31: 39 | m_SortingLayers: 40 | - name: Default 41 | userID: 0 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: .0199999996 7 | Maximum Allowed Timestep: .333333343 8 | m_TimeScale: 1 9 | -------------------------------------------------------------------------------- /ProjectSettings/UnityAdsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!292 &1 4 | UnityAdsSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_InitializeOnStartup: 1 8 | m_TestMode: 0 9 | m_EnabledPlatforms: 4294967295 10 | m_IosGameId: 11 | m_AndroidGameId: 12 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | UnityPurchasingSettings: 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | UnityAnalyticsSettings: 10 | m_Enabled: 0 11 | m_InitializeOnStartup: 1 12 | m_TestMode: 0 13 | m_TestEventUrl: 14 | m_TestConfigUrl: 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Examples for UnitySteer 2 | 3 | This repository contains a series of examples for UnitySteer, a library for autonomous agents in Unity written and maintained by 4 | [Ricardo J. Méndez](https://github.com/ricardojmendez). Pull requests are welcome. 5 | 6 | This version requires Unity 5. For the last version supporting Unity 4.x, see the [v.3 tag](https://github.com/ricardojmendez/UnitySteerExamples/tree/v3.0). 7 | 8 | See [SampleList.md](SampleList.md) for a description of the current examples. 9 | 10 | # A word on methodology 11 | 12 | Since these are tutorial examples, I expect I’ll just run development straight off master. The UnitySteer repository does follow git flow, so expect this tutorial repository will be a work-in-progress and might at any given point reference a UnitySteer development branch. 13 | 14 | # Checking out the repository 15 | 16 | It includes the UnitySteer Github repository as a submodule. If you have just cloned the project and find missing behaviours, make sure that: 17 | 18 | * You actually have some files inside the Assets/UnitySteer folder; 19 | * You have run _git submodule update_ to check out the latest referenced version; 20 | 21 | Or you could use an application like [SourceTree](http://www.sourcetreeapp.com/) which handles the submodule semantics for you. 22 | 23 | # License 24 | 25 | UnitySteer is released under the 26 | [MIT license](http://opensource.org/licenses/MIT). See License.txt. 27 | 28 | # Other third-party components 29 | 30 | Includes [GoKit](https://github.com/prime31/GoKit), which has its own license. See [GoKit's repository](https://github.com/prime31/GoKit) for details. 31 | 32 | Includes some textures from Unity’s standard examples. --------------------------------------------------------------------------------