├── ProjectSettings ├── ProjectVersion.txt ├── AudioManager.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── TagManager.asset ├── TimeManager.asset ├── VFXManager.asset ├── NetworkManager.asset ├── PresetManager.asset ├── DynamicsManager.asset ├── GraphicsSettings.asset ├── Physics2DSettings.asset ├── QualitySettings.asset ├── ClusterInputManager.asset ├── EditorBuildSettings.asset ├── UnityConnectSettings.asset └── EditorSettings.asset ├── Assets ├── Materials │ ├── Red.mat │ ├── Black.mat │ ├── Blue.mat │ ├── Gold.mat │ ├── Gray.mat │ ├── Noise.jpg │ ├── Sand.mat │ ├── White.mat │ ├── Ground Squares.mat │ ├── Car Materials │ │ ├── Falg.mat │ │ ├── Gold.mat │ │ ├── Seat.mat │ │ ├── Tyre.mat │ │ ├── Grill.mat │ │ ├── Window.mat │ │ ├── Car cover.mat │ │ ├── Lamp_rear.mat │ │ ├── Material.mat │ │ ├── Lamp_front.mat │ │ ├── Car paint blue.mat │ │ ├── Car paint black.mat │ │ ├── Falg.mat.meta │ │ ├── Gold.mat.meta │ │ ├── Grill.mat.meta │ │ ├── Seat.mat.meta │ │ ├── Tyre.mat.meta │ │ ├── Window.mat.meta │ │ ├── Car cover.mat.meta │ │ ├── Lamp_front.mat.meta │ │ ├── Lamp_rear.mat.meta │ │ ├── Material.mat.meta │ │ ├── Car paint black.mat.meta │ │ └── Car paint blue.mat.meta │ ├── FloorsRegular0204_1_S.jpg │ ├── Materials.meta │ ├── Black.mat.meta │ ├── Blue.mat.meta │ ├── Gold.mat.meta │ ├── Gray.mat.meta │ ├── Red.mat.meta │ ├── Sand.mat.meta │ ├── White.mat.meta │ ├── Ground Squares.mat.meta │ ├── Ground noise.mat.meta │ ├── Car Materials.meta │ ├── Materials │ │ ├── FloorsRegular0204_1_S.mat.meta │ │ └── FloorsRegular0204_1_S.mat │ ├── Noise.jpg.meta │ ├── FloorsRegular0204_1_S.jpg.meta │ └── Ground noise.mat ├── Models │ ├── t_ford.blend │ ├── Materials │ │ ├── Cover.mat │ │ ├── Falg.mat │ │ ├── Gold.mat │ │ ├── Grill.mat │ │ ├── Seat.mat │ │ ├── Tyre.mat │ │ ├── Window.mat │ │ ├── Material.mat │ │ ├── Car paint.mat │ │ ├── Car_paint.mat │ │ ├── Lamp front.mat │ │ ├── Lamp_front.mat │ │ ├── Cover.mat.meta │ │ ├── Falg.mat.meta │ │ ├── Gold.mat.meta │ │ ├── Grill.mat.meta │ │ ├── Material.mat.meta │ │ ├── Seat.mat.meta │ │ ├── Tyre.mat.meta │ │ ├── Window.mat.meta │ │ ├── Car_paint.mat.meta │ │ ├── Lamp_front.mat.meta │ │ ├── Car paint.mat.meta │ │ └── Lamp front.mat.meta │ ├── Materials.meta │ └── t_ford.blend.meta ├── Prefabs │ ├── Cube.prefab │ ├── Car.prefab.meta │ ├── Cube.prefab.meta │ ├── Propeller.prefab.meta │ └── Propeller.prefab ├── _Rotating Arm │ ├── Prefabs │ │ ├── Ball.prefab │ │ └── Ball.prefab.meta │ ├── stabilize_propeller.unity │ ├── stabilize_propeller.unity.meta │ ├── Prefabs.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── Ball.meta │ │ ├── Ball │ │ ├── RemoveBall.cs │ │ ├── FireBall.cs.meta │ │ ├── RemoveBall.cs.meta │ │ └── FireBall.cs │ │ ├── PropellerController.cs.meta │ │ └── PropellerController.cs ├── Standard Assets │ ├── CrossPlatformInput │ │ ├── CrossPlatformInputGuidelines.txt.meta │ │ ├── Prefabs │ │ │ ├── CarTiltControls.prefab.meta │ │ │ ├── DualTouchControls.prefab.meta │ │ │ ├── MobileTiltControlRig.prefab.meta │ │ │ ├── MobileAircraftControls.prefab.meta │ │ │ ├── MobileSingleStickControl.prefab.meta │ │ │ └── MobileTiltControlRig.prefab │ │ ├── Sprites │ │ │ ├── TouchpadSprite.png │ │ │ ├── ButtonResetSprite.png │ │ │ ├── ButtonArrowUpSprite.png │ │ │ ├── ButtonBrakeUpSprite.png │ │ │ ├── ButtonSpacebarSprite.png │ │ │ ├── SliderHandleSprite.png │ │ │ ├── ButtonArrowOverSprite.png │ │ │ ├── ButtonBrakeOverSprite.png │ │ │ ├── SliderBackgroundSprite.png │ │ │ ├── ButtonAcceleratorUpSprite.png │ │ │ ├── ButtonCameraCycleUpSprite.png │ │ │ ├── ButtonThumbstickUpSprite.png │ │ │ ├── ButtonAcceleratorOverSprite.png │ │ │ ├── ButtonThumbstickOverSprite.png │ │ │ ├── ButtonTimescaleFullUpSprite.png │ │ │ ├── ButtonTimescaleSlowUpSprite.png │ │ │ ├── ButtonArrowOverSprite.png.meta │ │ │ ├── ButtonArrowUpSprite.png.meta │ │ │ ├── ButtonBrakeOverSprite.png.meta │ │ │ ├── ButtonBrakeUpSprite.png.meta │ │ │ ├── SliderHandleSprite.png.meta │ │ │ ├── ButtonAcceleratorUpSprite.png.meta │ │ │ ├── ButtonCameraCycleUpSprite.png.meta │ │ │ ├── ButtonThumbstickOverSprite.png.meta │ │ │ ├── ButtonThumbstickUpSprite.png.meta │ │ │ ├── ButtonAcceleratorOverSprite.png.meta │ │ │ ├── ButtonTimescaleFullUpSprite.png.meta │ │ │ ├── ButtonTimescaleSlowUpSprite.png.meta │ │ │ ├── ButtonResetSprite.png.meta │ │ │ ├── TouchpadSprite.png.meta │ │ │ ├── ButtonSpacebarSprite.png.meta │ │ │ └── SliderBackgroundSprite.png.meta │ │ ├── Prefabs.meta │ │ ├── Scripts.meta │ │ ├── Sprites.meta │ │ ├── Scripts │ │ │ ├── PlatformSpecific.meta │ │ │ ├── Joystick.cs.meta │ │ │ ├── TouchPad.cs.meta │ │ │ ├── AxisTouchButton.cs.meta │ │ │ ├── ButtonHandler.cs.meta │ │ │ ├── MobileControlRig.cs.meta │ │ │ ├── VirtualInput.cs.meta │ │ │ ├── InputAxisScrollbar.cs.meta │ │ │ ├── PlatformSpecific │ │ │ │ ├── MobileInput.cs.meta │ │ │ │ ├── StandaloneInput.cs.meta │ │ │ │ ├── StandaloneInput.cs │ │ │ │ └── MobileInput.cs │ │ │ ├── CrossPlatformInputManager.cs.meta │ │ │ ├── TiltInput.cs.meta │ │ │ ├── InputAxisScrollbar.cs │ │ │ ├── ButtonHandler.cs │ │ │ ├── MobileControlRig.cs │ │ │ ├── AxisTouchButton.cs │ │ │ ├── Joystick.cs │ │ │ ├── TouchPad.cs │ │ │ ├── TiltInput.cs │ │ │ └── VirtualInput.cs │ │ └── CrossPlatformInputGuidelines.txt │ └── CrossPlatformInput.meta ├── _Robot arm.meta ├── _Robot arm │ ├── Scripts.meta │ ├── robot arm.unity.meta │ └── Scripts │ │ ├── RobotJoint.cs.meta │ │ ├── RobotController.cs.meta │ │ ├── RobotJoint.cs │ │ └── RobotController.cs ├── _Quadcopter │ ├── quadcopter.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── CreateEnvironment.cs.meta │ │ ├── RotatePropeller.cs.meta │ │ ├── QuadcopterController.cs.meta │ │ ├── RotatePropeller.cs │ │ └── CreateEnvironment.cs ├── Editor.meta ├── Models.meta ├── Prefabs.meta ├── _Car Follow Path │ ├── pid_controller.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── Math.cs.meta │ │ ├── CarController.cs.meta │ │ ├── Math.cs │ │ └── CarController.cs ├── Materials.meta ├── _Inverted Pendulum │ ├── inverted pendulum.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── BasicCar.cs.meta │ │ ├── InvertedPendulum.cs.meta │ │ ├── InvertedPendulum.cs │ │ └── BasicCar.cs ├── _Quadcopter.meta ├── _Rotating Arm.meta ├── General Scripts.meta ├── Standard Assets.meta ├── _Car Follow Path.meta ├── _Inverted Pendulum.meta ├── General Scripts │ ├── Camera.meta │ ├── PIDController.cs.meta │ ├── Camera │ │ ├── SidewaysCam.cs.meta │ │ ├── MoveAlongCam.cs.meta │ │ ├── RotateAroundCam.cs.meta │ │ ├── MoveAlongCam.cs │ │ ├── RotateAroundCam.cs │ │ └── SidewaysCam.cs │ └── PIDController.cs └── Editor │ ├── CrossPlatformInput.meta │ └── CrossPlatformInput │ ├── CrossPlatformInputInitialize.cs.meta │ └── CrossPlatformInputInitialize.cs ├── README.md ├── LICENSE ├── .gitignore └── Packages └── manifest.json /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.4.14f1 2 | -------------------------------------------------------------------------------- /Assets/Materials/Red.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Red.mat -------------------------------------------------------------------------------- /Assets/Materials/Black.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Black.mat -------------------------------------------------------------------------------- /Assets/Materials/Blue.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Blue.mat -------------------------------------------------------------------------------- /Assets/Materials/Gold.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Gold.mat -------------------------------------------------------------------------------- /Assets/Materials/Gray.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Gray.mat -------------------------------------------------------------------------------- /Assets/Materials/Noise.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Noise.jpg -------------------------------------------------------------------------------- /Assets/Materials/Sand.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Sand.mat -------------------------------------------------------------------------------- /Assets/Materials/White.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/White.mat -------------------------------------------------------------------------------- /Assets/Models/t_ford.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Models/t_ford.blend -------------------------------------------------------------------------------- /Assets/Prefabs/Cube.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Prefabs/Cube.prefab -------------------------------------------------------------------------------- /Assets/Models/Materials/Cover.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Models/Materials/Cover.mat -------------------------------------------------------------------------------- /Assets/Models/Materials/Falg.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Models/Materials/Falg.mat -------------------------------------------------------------------------------- /Assets/Models/Materials/Gold.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Models/Materials/Gold.mat -------------------------------------------------------------------------------- /Assets/Models/Materials/Grill.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Models/Materials/Grill.mat -------------------------------------------------------------------------------- /Assets/Models/Materials/Seat.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Models/Materials/Seat.mat -------------------------------------------------------------------------------- /Assets/Models/Materials/Tyre.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Models/Materials/Tyre.mat -------------------------------------------------------------------------------- /Assets/Models/Materials/Window.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Models/Materials/Window.mat -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/VFXManager.asset -------------------------------------------------------------------------------- /Assets/Materials/Ground Squares.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Ground Squares.mat -------------------------------------------------------------------------------- /Assets/Models/Materials/Material.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Models/Materials/Material.mat -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/PresetManager.asset -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Falg.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Car Materials/Falg.mat -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Gold.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Car Materials/Gold.mat -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Seat.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Car Materials/Seat.mat -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Tyre.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Car Materials/Tyre.mat -------------------------------------------------------------------------------- /Assets/Models/Materials/Car paint.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Models/Materials/Car paint.mat -------------------------------------------------------------------------------- /Assets/Models/Materials/Car_paint.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Models/Materials/Car_paint.mat -------------------------------------------------------------------------------- /Assets/Models/Materials/Lamp front.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Models/Materials/Lamp front.mat -------------------------------------------------------------------------------- /Assets/Models/Materials/Lamp_front.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Models/Materials/Lamp_front.mat -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Grill.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Car Materials/Grill.mat -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Window.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Car Materials/Window.mat -------------------------------------------------------------------------------- /Assets/_Rotating Arm/Prefabs/Ball.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/_Rotating Arm/Prefabs/Ball.prefab -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Car cover.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Car Materials/Car cover.mat -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Lamp_rear.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Car Materials/Lamp_rear.mat -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Material.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Car Materials/Material.mat -------------------------------------------------------------------------------- /Assets/Materials/FloorsRegular0204_1_S.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/FloorsRegular0204_1_S.jpg -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Lamp_front.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Car Materials/Lamp_front.mat -------------------------------------------------------------------------------- /Assets/_Rotating Arm/stabilize_propeller.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/_Rotating Arm/stabilize_propeller.unity -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Car paint blue.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Car Materials/Car paint blue.mat -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Car paint black.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Materials/Car Materials/Car paint black.mat -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/CrossPlatformInputGuidelines.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3b997593a4f12c4c991490593f3b513 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Prefabs/CarTiltControls.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 174090ae7f9eff84abe76f0ff062efac 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/TouchpadSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/TouchpadSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Prefabs/DualTouchControls.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2169821f0567671499a5c10104c69c24 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Prefabs/MobileTiltControlRig.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 999388b68bb99b44099461bfbed94358 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonResetSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonResetSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Prefabs/MobileAircraftControls.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3369231b1ed7ad34e84d9240a571db81 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Prefabs/MobileSingleStickControl.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9529ecc3d479da5499993355e6c2cb4f 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowUpSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeUpSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonSpacebarSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonSpacebarSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/SliderHandleSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/SliderHandleSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowOverSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowOverSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeOverSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeOverSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/SliderBackgroundSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/SliderBackgroundSprite.png -------------------------------------------------------------------------------- /Assets/_Robot arm.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c93fa54b9420204881690626257fe8b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorUpSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonCameraCycleUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonCameraCycleUpSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickUpSprite.png -------------------------------------------------------------------------------- /Assets/Materials/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 386b7d150c3732247b57c147f9e0c1cf 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorOverSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorOverSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickOverSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickOverSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleFullUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleFullUpSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleSlowUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Control-systems-Tutorial/HEAD/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleSlowUpSprite.png -------------------------------------------------------------------------------- /Assets/_Robot arm/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efe135bc219423440be01ae05c87ac31 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Black.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e096b9c6c814f3408b8ac0b1d93eb3d 3 | timeCreated: 1479121753 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Blue.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 78572c47c52a1c844a76efe6471ccb49 3 | timeCreated: 1478164645 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Gold.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a19543220466cb40b4654ea6b071fd8 3 | timeCreated: 1472628626 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Gray.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a0633545b2829348b72124c5b32ac8f 3 | timeCreated: 1479110820 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Red.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3aa1631ee0b273543bcd4a3f23807a2a 3 | timeCreated: 1479120508 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Sand.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b4935ecacab5e84e92523de2e9dfb10 3 | timeCreated: 1478162753 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/White.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37d568a4d2672724a85afb3b924c730b 3 | timeCreated: 1479121534 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Car.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eac0e8e446fb1724bb7ece6fcac10d08 3 | timeCreated: 1479224472 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Cube.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 783dc814191e9c4468cefa76fc346492 3 | timeCreated: 1479644670 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Propeller.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a7bfdc95a2f59f48bc1555cf994bce7 3 | timeCreated: 1479227469 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/_Quadcopter/quadcopter.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e062e689b015ec4aad787e0c80f0738 3 | timeCreated: 1479120300 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/_Robot arm/robot arm.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 78f702e9b750fd4498f9a3e85c8d8983 3 | timeCreated: 1495525791 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Ground Squares.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73f80b70d258de14b8e5327d851f5a82 3 | timeCreated: 1479289232 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Ground noise.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0725124fa9e9c774cac6bf02f68f217b 3 | timeCreated: 1472628526 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Models/Materials/Cover.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57d3bdb7b8834504486649c4630b0511 3 | timeCreated: 1472627950 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Models/Materials/Falg.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac13084c99585684a81b8fb0be721fa1 3 | timeCreated: 1472627949 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Models/Materials/Gold.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9e1e89e11866e245a23176a01e6598a 3 | timeCreated: 1472627949 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Models/Materials/Grill.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 661f9fdb9e4ffbb4cbb48ab9e6a5eaa7 3 | timeCreated: 1472627950 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Models/Materials/Material.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3506137a1ff71864991ca60b4b1c5752 3 | timeCreated: 1472627950 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Models/Materials/Seat.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff41a6854075d4342a49a370074b450d 3 | timeCreated: 1472627950 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Models/Materials/Tyre.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0b0901a25f0dde4c867e18edb4ab717 3 | timeCreated: 1472627949 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Models/Materials/Window.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 433625e195a8871409c61c569c27ba0e 3 | timeCreated: 1472627950 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcec42659c53a11419749028aeaad4f2 3 | folderAsset: yes 4 | timeCreated: 1479227600 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Falg.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df117a4908180fb43a1d834906a3e325 3 | timeCreated: 1472294062 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Gold.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ea93191425a6d9418da4cbacbab1402 3 | timeCreated: 1472294062 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Grill.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca01b77bb0b611940a67b9708e586ddd 3 | timeCreated: 1472294063 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Seat.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d955e3ccd5cd29d4f8d9d6eab9f4fbf0 3 | timeCreated: 1472294063 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Tyre.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9baeb4943eba134ba6b51bf3fa494f0 3 | timeCreated: 1472294061 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Window.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd4ac9157a59de84992d36ad8b44f684 3 | timeCreated: 1472294063 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Models.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13963427de5844b439330894df565262 3 | folderAsset: yes 4 | timeCreated: 1479110620 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Models/Materials/Car_paint.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84142543ab8e2fc4084a2d6d4f558dcb 3 | timeCreated: 1472627950 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Models/Materials/Lamp_front.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea27b9ab7f96b0e42be6a0bc98f3f855 3 | timeCreated: 1472627950 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c8e066c872592948875c9a46424a73d 3 | folderAsset: yes 4 | timeCreated: 1479110620 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/_Car Follow Path/pid_controller.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f183875adac2dc743b5b9a700818c6cb 3 | timeCreated: 1472627678 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/_Rotating Arm/Prefabs/Ball.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5aa9a4d914f9514ea490ec0275b90d3 3 | timeCreated: 1478166006 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/_Rotating Arm/stabilize_propeller.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5eb76ec82e484e14f9a3e86724cc8444 3 | timeCreated: 1478161968 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60cecc886ec11304580d4cf3dfad1daf 3 | folderAsset: yes 4 | timeCreated: 1478162729 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Car cover.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f59a8513ffd8954ab2655267914786d 3 | timeCreated: 1472294063 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Lamp_front.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8546e84cf098794eac84e6d15968ba5 3 | timeCreated: 1472294062 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Lamp_rear.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bea63f2194cd0994ebe319007ca200bb 3 | timeCreated: 1472294062 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Material.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 977562eecae5d954d8c7aaf3355146af 3 | timeCreated: 1472294063 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Models/Materials/Car paint.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fb1333a806081942b8a4d28241630c5 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Models/Materials/Lamp front.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e85080fd025c414bab68a5f66064981 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/_Inverted Pendulum/inverted pendulum.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5cc52aec0b24eae439eb6376e9e0b7b2 3 | timeCreated: 1479224370 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/_Quadcopter.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f2690fb903061d458a0af8d375b1d9c 3 | folderAsset: yes 4 | timeCreated: 1479120247 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/_Rotating Arm.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 941dec2016fe77148a16f959f652bb1c 3 | folderAsset: yes 4 | timeCreated: 1479110436 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/General Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 63e949731b5f38449bc7b798de649b81 3 | folderAsset: yes 4 | timeCreated: 1479110684 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Car paint black.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 805e56c38d72e6446b8b60bb2f7535d4 3 | timeCreated: 1472294063 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Car Materials/Car paint blue.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7919e6ad0ec5b54eb89d9451fa08df0 3 | timeCreated: 1472294063 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Models/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fbe7cc1ecc375643be3b37779bd84d5 3 | folderAsset: yes 4 | timeCreated: 1479110620 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 207103e8e047b2c4f909bdd596fd7c98 3 | folderAsset: yes 4 | timeCreated: 1479227600 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/_Car Follow Path.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b086f2041ba5e984a83dd0afd63ad58c 3 | folderAsset: yes 4 | timeCreated: 1479110472 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/_Inverted Pendulum.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32fa599f5f4ee3f4684acb1a3639f32b 3 | folderAsset: yes 4 | timeCreated: 1479223377 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/General Scripts/Camera.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: daaf45855a8b6734eab6612e0bb28907 3 | folderAsset: yes 4 | timeCreated: 1479468913 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Materials/Car Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd715cff57ab1f64c94e21bddd0a0068 3 | folderAsset: yes 4 | timeCreated: 1479110620 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/_Quadcopter/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4478e8552e09a742aac05d46e5e3edf 3 | folderAsset: yes 4 | timeCreated: 1479120975 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/_Rotating Arm/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4341df22f3f38fc40b0d9a2e8ef91dcb 3 | folderAsset: yes 4 | timeCreated: 1478166002 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/_Rotating Arm/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 369c0c054ddac7044ac0b57297c12dec 3 | folderAsset: yes 4 | timeCreated: 1478163494 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Editor/CrossPlatformInput.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 696c0e7b8c74e1442acbf15c2df9e72d 3 | folderAsset: yes 4 | timeCreated: 1436977288 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Materials/Materials/FloorsRegular0204_1_S.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f4e8857b66dd0b45bfb62ae2bee3783 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/_Car Follow Path/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac113f494a91f784a8b7c9fde4035162 3 | folderAsset: yes 4 | timeCreated: 1479110620 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/_Inverted Pendulum/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8902b7585d9a9442a729ccb05f4287c 3 | folderAsset: yes 4 | timeCreated: 1479224357 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/_Rotating Arm/Scripts/Ball.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8eb6121b530b6534e87ee2bf85d7d4ca 3 | folderAsset: yes 4 | timeCreated: 1478167263 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 710bc43f80d178548bd226c252c8e65b 3 | folderAsset: yes 4 | timeCreated: 1436977288 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d3fb8e05edcf4b41aef584ca1b0d06f 3 | folderAsset: yes 4 | timeCreated: 1436977288 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f66eeca8ac36914e9ec9a716a9d9f73 3 | folderAsset: yes 4 | timeCreated: 1436977288 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1835e4537efbdd94b93c2dd136860f1d 3 | folderAsset: yes 4 | timeCreated: 1436977288 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0bc72db1e9dcb9647818df5a07871127 3 | folderAsset: yes 4 | timeCreated: 1436977288 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Editor/CrossPlatformInput/CrossPlatformInputInitialize.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db7667203062c644ea1877077e30ebd6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/Joystick.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00c3c865782347f41b6358d9fba14b48 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/TouchPad.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1caf40fc8bebb6b43b2550c05ca791d6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/AxisTouchButton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ab98b66288df7b4fa182075f2f12bd6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/ButtonHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85bf3be603548374ca46f521a3aa7fda 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71398ce7fbc3a5b4fa50b50bd54317a7 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/VirtualInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f57aeb1b8dce3342bea5c28ac17db24 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/InputAxisScrollbar.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d3269566d48b8447bb48d2259e28f8b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/MobileInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9703d53e47195aa4190acd11369ccd1b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/StandaloneInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9961032f4f02c4f41997c3ea399d2f22 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/CrossPlatformInputManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ac1ce5a5adfd9f46adbf5b6f752a47c 3 | labels: 4 | - Done 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: -1010 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | -------------------------------------------------------------------------------- /Assets/_Rotating Arm/Scripts/Ball/RemoveBall.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | //Removes a ball after x seconds 5 | public class RemoveBall : MonoBehaviour 6 | { 7 | 8 | 9 | void Start() 10 | { 11 | Destroy(gameObject, 120f); 12 | } 13 | 14 | 15 | void Update() 16 | { 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/General Scripts/PIDController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0fec792d68957304d909a57960cd3b15 3 | timeCreated: 1472628738 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/_Car Follow Path/Scripts/Math.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fbbef3940af65f4da50cd3fea2e049b 3 | timeCreated: 1472303453 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/_Robot arm/Scripts/RobotJoint.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f782ba4879a65e746961acd2d0c4919e 3 | timeCreated: 1495530973 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/General Scripts/Camera/SidewaysCam.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b5b639b4978b46a4ab100d530bc0d44b 3 | timeCreated: 1472335698 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/TiltInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c2d84226fbbaf94e9c1451f1c39b06a 3 | labels: 4 | - Not 5 | - Fully 6 | - Implemented 7 | MonoImporter: 8 | serializedVersion: 2 9 | defaultReferences: [] 10 | executionOrder: -1001 11 | icon: {instanceID: 0} 12 | userData: 13 | assetBundleName: 14 | -------------------------------------------------------------------------------- /Assets/_Robot arm/Scripts/RobotController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17b84513cbfcc4141b91f80036950b77 3 | timeCreated: 1495531423 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/General Scripts/Camera/MoveAlongCam.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c1a832025a6c1f4c88d8153a593e998 3 | timeCreated: 1479288358 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/General Scripts/Camera/RotateAroundCam.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec9b349d1e80576438deada0a3e30228 3 | timeCreated: 1478164225 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/_Car Follow Path/Scripts/CarController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a16e4f95fa07f0e4487799d7b922fa8d 3 | timeCreated: 1472296192 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/_Inverted Pendulum/Scripts/BasicCar.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4dea757d368ef241bb6325bda9cea01 3 | timeCreated: 1479283377 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/_Quadcopter/Scripts/CreateEnvironment.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81b69a60ec7ad514c85d3d3fc9be2d02 3 | timeCreated: 1479643508 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/_Quadcopter/Scripts/RotatePropeller.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80fd031bbd39a624891098b6faf1fd42 3 | timeCreated: 1478163505 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/_Rotating Arm/Scripts/Ball/FireBall.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c774b8ddc7fba784facf345df5f7c4cc 3 | timeCreated: 1478165649 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/_Rotating Arm/Scripts/Ball/RemoveBall.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6586559b825ffb74fb836646c1ce60f7 3 | timeCreated: 1478167236 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/_Inverted Pendulum/Scripts/InvertedPendulum.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ef5d167b648a8e42a27059d7d2acbd2 3 | timeCreated: 1479283391 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/_Quadcopter/Scripts/QuadcopterController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b95d44265d89e2642a48d3bd90573b40 3 | timeCreated: 1479120990 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/_Rotating Arm/Scripts/PropellerController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6709c76721d4f4f4dbfed1abb89f5333 3 | timeCreated: 1478167741 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/InputAxisScrollbar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput 5 | { 6 | public class InputAxisScrollbar : MonoBehaviour 7 | { 8 | public string axis; 9 | 10 | void Update() { } 11 | 12 | public void HandleInput(float value) 13 | { 14 | CrossPlatformInputManager.SetAxis(axis, (value*2f) - 1f); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unity Control systems Tutorial 2 | 3 | Learn about an engineering area called Control systems: 4 | 5 | Use PID-controllers to build: 6 | * Quadcopter 7 | * A self-driving car that will follow a path 8 | 9 | Link to the tutorial: https://www.habrador.com/tutorials/pid-controller/ 10 | 11 | As a bonus you will also get the following: 12 | * Stabilize a propeller with a PID controller (left click to shoot balls at it) 13 | * Stabilize a inverted pendulum with a PID controller 14 | * Make a linked robot move towards a point 15 | 16 | Follow me on Twitter for more Unity stuff: https://twitter.com/eriknordeus 17 | -------------------------------------------------------------------------------- /Assets/_Quadcopter/Scripts/RotatePropeller.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | //Will just rotate the propeller 5 | public class RotatePropeller : MonoBehaviour 6 | { 7 | public float rotationSpeed; 8 | 9 | public bool shouldRotate = true; 10 | 11 | public bool shouldRotateOtherDirection = false; 12 | 13 | void Start() 14 | { 15 | 16 | } 17 | 18 | 19 | void Update() 20 | { 21 | //Rotate the propeller around local axis 22 | if (shouldRotate) 23 | { 24 | if (shouldRotateOtherDirection && rotationSpeed > 0f) 25 | { 26 | rotationSpeed *= -1; 27 | } 28 | 29 | transform.Rotate(Vector3.up * rotationSpeed * Time.deltaTime); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Assets/General Scripts/Camera/MoveAlongCam.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class MoveAlongCam : MonoBehaviour 5 | { 6 | public Transform carTrans; 7 | 8 | public float sideDistance; 9 | public float upDistance; 10 | 11 | void Start() 12 | { 13 | 14 | } 15 | 16 | 17 | void Update() 18 | { 19 | //Get the cameras new position 20 | Vector3 newPos = carTrans.position; 21 | 22 | //Move to the side 23 | newPos += carTrans.right * sideDistance; 24 | 25 | //Move up 26 | newPos += transform.up * upDistance; 27 | 28 | //Move the camera to this new position 29 | transform.position = newPos; 30 | 31 | //Look at the car 32 | transform.LookAt(carTrans); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /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: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 1 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 2 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 0 16 | m_EtcTextureFastCompressor: 2 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 5 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInPlayMode: 1 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Erik Nordeus 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/ButtonHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput 5 | { 6 | public class ButtonHandler : MonoBehaviour 7 | { 8 | 9 | public string Name; 10 | 11 | void OnEnable() 12 | { 13 | 14 | } 15 | 16 | public void SetDownState() 17 | { 18 | CrossPlatformInputManager.SetButtonDown(Name); 19 | } 20 | 21 | 22 | public void SetUpState() 23 | { 24 | CrossPlatformInputManager.SetButtonUp(Name); 25 | } 26 | 27 | 28 | public void SetAxisPositiveState() 29 | { 30 | CrossPlatformInputManager.SetAxisPositive(Name); 31 | } 32 | 33 | 34 | public void SetAxisNeutralState() 35 | { 36 | CrossPlatformInputManager.SetAxisZero(Name); 37 | } 38 | 39 | 40 | public void SetAxisNegativeState() 41 | { 42 | CrossPlatformInputManager.SetAxisNegative(Name); 43 | } 44 | 45 | public void Update() 46 | { 47 | 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Asset meta data should only be ignored when the corresponding asset is also ignored 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # Autogenerated Jetbrains Rider plugin 20 | [Aa]ssets/Plugins/Editor/JetBrains* 21 | 22 | # Visual Studio cache directory 23 | .vs/ 24 | 25 | # Gradle cache directory 26 | .gradle/ 27 | 28 | # Autogenerated VS/MD/Consulo solution and project files 29 | ExportedObj/ 30 | .consulo/ 31 | *.csproj 32 | *.unityproj 33 | *.sln 34 | *.suo 35 | *.tmp 36 | *.user 37 | *.userprefs 38 | *.pidb 39 | *.booproj 40 | *.svd 41 | *.pdb 42 | *.mdb 43 | *.opendb 44 | *.VC.db 45 | 46 | # Unity3D generated meta files 47 | *.pidb.meta 48 | *.pdb.meta 49 | *.mdb.meta 50 | 51 | # Unity3D generated file on crash reports 52 | sysinfo.txt 53 | 54 | # Builds 55 | *.apk 56 | *.unitypackage 57 | 58 | # Crashlytics generated file 59 | crashlytics-build.properties 60 | 61 | -------------------------------------------------------------------------------- /Assets/_Rotating Arm/Scripts/Ball/FireBall.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class FireBall : MonoBehaviour 5 | { 6 | //The ball we will fire 7 | public GameObject ballObj; 8 | //The force we will use to throw balls 9 | public float ballForce; 10 | 11 | void Start() 12 | { 13 | 14 | } 15 | 16 | 17 | void Update() 18 | { 19 | //Fire when click with left mouse 20 | if (Input.GetMouseButtonDown(0)) 21 | { 22 | Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); 23 | 24 | RaycastHit hit; 25 | 26 | if (Physics.Raycast(ray, out hit)) 27 | { 28 | //From where should we fire the ball 29 | Vector3 firePos = Camera.main.transform.position; 30 | 31 | //Create a new ball and parent it to this transform 32 | GameObject newBall = Instantiate(ballObj, firePos, Quaternion.identity, transform) as GameObject; 33 | 34 | //In which direction should we fire the ball 35 | Vector3 fireDir = (hit.point - firePos).normalized; 36 | 37 | //Fire the ball against the position we hit 38 | newBall.GetComponent().AddForce(ballForce * fireDir, ForceMode.Impulse); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Assets/Materials/Noise.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0c24c7e1b6620744a3ebc042f756ac6 3 | timeCreated: 1472628553 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 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: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: -1 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Materials/FloorsRegular0204_1_S.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8f6791b8324cbe4887d8bbfa134ca78 3 | timeCreated: 1479289219 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 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: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: -1 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/_Robot arm/Scripts/RobotJoint.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class RobotJoint : MonoBehaviour 6 | { 7 | //The joint can onlyy rotate around 1 axis, so indicate this with 1 8 | public Vector3 rotationAxis; 9 | //The distance between this joint and the previous joint 10 | public Vector3 startOffset; 11 | //The local angle 12 | public Vector3 localRotationAngle; 13 | 14 | 15 | void Awake() 16 | { 17 | startOffset = transform.localPosition; 18 | 19 | localRotationAngle = transform.localEulerAngles; 20 | } 21 | 22 | 23 | 24 | //Get the angle of the active rotation axis 25 | public float GetRotationAngle() 26 | { 27 | if (rotationAxis.x != 0f) 28 | { 29 | return transform.localEulerAngles.x; 30 | } 31 | else if (rotationAxis.y != 0f) 32 | { 33 | return transform.localEulerAngles.y; 34 | } 35 | else 36 | { 37 | return transform.localEulerAngles.z; 38 | } 39 | } 40 | 41 | 42 | 43 | //Add a new angle to the robot 44 | public void AddRotationAngle(float angle) 45 | { 46 | if (rotationAxis.x != 0f) 47 | { 48 | transform.localEulerAngles = new Vector3(angle, 0f, 0f); 49 | } 50 | else if (rotationAxis.y != 0f) 51 | { 52 | transform.localEulerAngles = new Vector3(0f, angle, 0f); 53 | } 54 | else 55 | { 56 | transform.localEulerAngles = new Vector3(0f, 0f, angle); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Assets/_Quadcopter/Scripts/CreateEnvironment.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class CreateEnvironment : MonoBehaviour 5 | { 6 | public GameObject cubeObj; 7 | public Material[] materials; 8 | 9 | 10 | void Start() 11 | { 12 | AddStuffToEnvironment(); 13 | } 14 | 15 | 16 | void AddStuffToEnvironment() 17 | { 18 | float maxScale = 100f; 19 | 20 | for (int i = 0; i < 200; i++) 21 | { 22 | Vector3 pos = GenerateRandomPos(); 23 | 24 | Vector3 scale = new Vector3(Random.Range(1f, maxScale), Random.Range(1f, maxScale), Random.Range(1f, maxScale)); 25 | 26 | GameObject newCube = Instantiate(cubeObj, pos, Quaternion.identity, transform) as GameObject; 27 | 28 | newCube.transform.localScale = scale; 29 | 30 | newCube.GetComponent().material = materials[Random.Range(0, materials.Length)]; 31 | } 32 | } 33 | 34 | 35 | 36 | Vector3 GenerateRandomPos() 37 | { 38 | float mapSize = 1000f; 39 | 40 | //To avoid creating buildings on the start positon 41 | float startSize = 20f; 42 | 43 | float randomX = Random.Range(-mapSize, mapSize); 44 | 45 | float randomZ = Random.Range(-mapSize, mapSize); 46 | 47 | while (randomX < startSize && randomX > -startSize) 48 | { 49 | randomX = Random.Range(-mapSize, mapSize); 50 | } 51 | 52 | while (randomZ < startSize && randomZ > -startSize) 53 | { 54 | randomZ = Random.Range(-mapSize, mapSize); 55 | } 56 | 57 | Vector3 finalPos = new Vector3(randomX, 0f, randomZ); 58 | 59 | return finalPos; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.0.8", 4 | "com.unity.analytics": "3.2.2", 5 | "com.unity.collab-proxy": "1.2.15", 6 | "com.unity.package-manager-ui": "2.0.8", 7 | "com.unity.purchasing": "2.0.3", 8 | "com.unity.textmeshpro": "1.4.1", 9 | "com.unity.modules.ai": "1.0.0", 10 | "com.unity.modules.animation": "1.0.0", 11 | "com.unity.modules.assetbundle": "1.0.0", 12 | "com.unity.modules.audio": "1.0.0", 13 | "com.unity.modules.cloth": "1.0.0", 14 | "com.unity.modules.director": "1.0.0", 15 | "com.unity.modules.imageconversion": "1.0.0", 16 | "com.unity.modules.imgui": "1.0.0", 17 | "com.unity.modules.jsonserialize": "1.0.0", 18 | "com.unity.modules.particlesystem": "1.0.0", 19 | "com.unity.modules.physics": "1.0.0", 20 | "com.unity.modules.physics2d": "1.0.0", 21 | "com.unity.modules.screencapture": "1.0.0", 22 | "com.unity.modules.terrain": "1.0.0", 23 | "com.unity.modules.terrainphysics": "1.0.0", 24 | "com.unity.modules.tilemap": "1.0.0", 25 | "com.unity.modules.ui": "1.0.0", 26 | "com.unity.modules.uielements": "1.0.0", 27 | "com.unity.modules.umbra": "1.0.0", 28 | "com.unity.modules.unityanalytics": "1.0.0", 29 | "com.unity.modules.unitywebrequest": "1.0.0", 30 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 31 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 32 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 33 | "com.unity.modules.unitywebrequestwww": "1.0.0", 34 | "com.unity.modules.vehicles": "1.0.0", 35 | "com.unity.modules.video": "1.0.0", 36 | "com.unity.modules.vr": "1.0.0", 37 | "com.unity.modules.wind": "1.0.0", 38 | "com.unity.modules.xr": "1.0.0" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Assets/General Scripts/Camera/RotateAroundCam.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class RotateAroundCam : MonoBehaviour { 5 | 6 | public Transform LookAtThisOBJ; 7 | 8 | 9 | float distance = 5.0f; 10 | float xSpeed = 180.0f; 11 | float ySpeed = 90.0f; 12 | float yMinLimit = 0.0f; 13 | float yMaxLimit = 80f; 14 | float speed = 0.14f; 15 | float x = 0.0f; 16 | float y = 0.0f; 17 | 18 | Quaternion rotation; 19 | 20 | void Start() { 21 | Vector3 angles = transform.eulerAngles; 22 | x = angles.y; 23 | y = angles.x; 24 | 25 | // Make the rigid body not change rotation 26 | if (GetComponent()) 27 | GetComponent().freezeRotation = true; 28 | 29 | transform.position += new Vector3(0f, 5f, 0f); 30 | } 31 | 32 | 33 | 34 | void LateUpdate () { 35 | if (LookAtThisOBJ && Input.GetMouseButton(0)) { 36 | x += Input.GetAxis("Mouse X") * xSpeed * 0.02f; 37 | y -= Input.GetAxis("Mouse Y") * ySpeed * 0.02f; 38 | 39 | y = ClampAngle(y, yMinLimit, yMaxLimit); 40 | 41 | rotation = Quaternion.Euler(y, x, 0f); 42 | transform.rotation = rotation; 43 | } 44 | 45 | //Always change zoom 46 | Vector3 position = rotation * new Vector3(0.0f, 0.0f, -distance) + LookAtThisOBJ.position; 47 | 48 | transform.position = position; 49 | 50 | transform.LookAt(LookAtThisOBJ.position + LookAtThisOBJ.up * 1f); 51 | } 52 | 53 | 54 | 55 | float ClampAngle(float angle, float min, float max) { 56 | if (angle < -360f) 57 | angle += 360f; 58 | if (angle > 360f) 59 | angle -= 360f; 60 | 61 | return Mathf.Clamp(angle, min, max); 62 | } 63 | 64 | 65 | 66 | void Update () { 67 | //transform.LookAt(LookAtThisOBJ); 68 | 69 | //This will move the camera slowly around the object 70 | //transform.position -= transform.right * speed * Time.deltaTime; 71 | 72 | if (Input.GetMouseButton(0)) { 73 | transform.LookAt(LookAtThisOBJ); 74 | transform.RotateAround(LookAtThisOBJ.position, Vector3.up, Input.GetAxis("Mouse X") * speed); 75 | } 76 | 77 | //Zoom in/out 78 | if (Input.GetAxis("Mouse ScrollWheel") > 0f) { 79 | distance -= 0.2f; 80 | } 81 | else if (Input.GetAxis("Mouse ScrollWheel") < 0f) { 82 | distance += 0.2f; 83 | } 84 | 85 | distance = Mathf.Clamp(distance, 1f, 10f); 86 | } 87 | 88 | 89 | 90 | 91 | } 92 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49b611e658efbf443b686a4036f74fe3 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 256 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 256 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: e76c152eaa776f744826ecd57b7aecd7 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4db017495c69e8140a56a0e2b669e3f8 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 256 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 256 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 5c40ca5435c1a854a845a3b45210c6a4 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b1a64ea234fb2343b8d0686c51280de 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 256 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 256 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 52a5d292e3f376949a567f324b647824 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 827c9cd4a3943534f909ac6473e17288 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 256 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 256 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 9ca940d63b09cab4aaf2bf8c79688d1c 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/SliderHandleSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0626b924325d1c34cafa6b22297f4e4f 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 256 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 256 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: e208664f1dd5ce44a89a248e9fff288f 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f588d850485d0ae479d73cf3bd0b7b00 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 256 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 256 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: ff682436fcd5f4d49be275b83ff9e886 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonCameraCycleUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3983c59ebf804b4abba687bd7c9e92f 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 256 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 256 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: d3d2f2ee3cd8a8c4aaf1b1e57c21debc 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5485e2f56028a3c4cb54f5caa167377e 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 256 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 256 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 1eb0aaa81f458a947b93d2a2dc5ad6ac 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9866a92691696b346901281f2b329034 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 256 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 256 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 24b052d3f0da420499f00ff7922d21c5 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Materials/Ground noise.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Ground noise 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _EMISSION 13 | m_LightmapFlags: 1 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 50, y: 50} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0.30147058, g: 0.30147058, b: 0.30147058, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb5f6e2757c821940b69cf1456f7865a 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 256 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 256 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 5757754874ed5e243bd078b216803d0f 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleFullUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c6271a290ef75b4c97d58746c86c5b8 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 256 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 256 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 322c7c5d82c1490429abda86d3c6aafe 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleSlowUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d7c6e4896067aa4fa512a00f692ac1c 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 256 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 256 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: eb51638ccde199149a1fab99e05322a6 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonResetSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a94c9a7eb94ceec4a8d67a1890e22e51 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: ResetButton 6 | externalObjects: {} 7 | serializedVersion: 9 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | streamingMipmaps: 0 26 | streamingMipmapsPriority: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: -1 32 | maxTextureSize: 256 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 16 37 | mipBias: -100 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | platformSettings: 62 | - serializedVersion: 2 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 256 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | spriteSheet: 74 | serializedVersion: 2 75 | sprites: [] 76 | outline: [] 77 | physicsShape: [] 78 | bones: [] 79 | spriteID: 827f5951c76509746a65baca20994fbf 80 | vertices: [] 81 | indices: 82 | edges: [] 83 | weights: [] 84 | spritePackingTag: 85 | pSDRemoveMatte: 0 86 | pSDShowRemoveMatteOption: 0 87 | userData: 88 | assetBundleName: 89 | assetBundleVariant: 90 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/TouchpadSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4f1fee3de32377429fd1348fae62b10 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: JumpButton 6 | externalObjects: {} 7 | serializedVersion: 9 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | streamingMipmaps: 0 26 | streamingMipmapsPriority: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: -1 32 | maxTextureSize: 1024 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 16 37 | mipBias: -100 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 65, y: 65, z: 65, w: 65} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | platformSettings: 62 | - serializedVersion: 2 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 1024 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | spriteSheet: 74 | serializedVersion: 2 75 | sprites: [] 76 | outline: [] 77 | physicsShape: [] 78 | bones: [] 79 | spriteID: 44e91eafb65619847a0d387aca67d893 80 | vertices: [] 81 | indices: 82 | edges: [] 83 | weights: [] 84 | spritePackingTag: 85 | pSDRemoveMatte: 0 86 | pSDShowRemoveMatteOption: 0 87 | userData: 88 | assetBundleName: 89 | assetBundleVariant: 90 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonSpacebarSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d8675433a508ec47b8f895201eacf20 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: JumpButton 6 | externalObjects: {} 7 | serializedVersion: 9 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | streamingMipmaps: 0 26 | streamingMipmapsPriority: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: -1 32 | maxTextureSize: 1024 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 16 37 | mipBias: -100 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 40, y: 40, z: 40, w: 40} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | platformSettings: 62 | - serializedVersion: 2 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 1024 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | spriteSheet: 74 | serializedVersion: 2 75 | sprites: [] 76 | outline: [] 77 | physicsShape: [] 78 | bones: [] 79 | spriteID: 491cdf8a1204f2c498cff7e7d6490134 80 | vertices: [] 81 | indices: 82 | edges: [] 83 | weights: [] 84 | spritePackingTag: 85 | pSDRemoveMatte: 0 86 | pSDShowRemoveMatteOption: 0 87 | userData: 88 | assetBundleName: 89 | assetBundleVariant: 90 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/SliderBackgroundSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea5873cfd9158664f89459f0c9e1d853 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: SliderBackground 6 | externalObjects: {} 7 | serializedVersion: 9 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | streamingMipmaps: 0 26 | streamingMipmapsPriority: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: -1 32 | maxTextureSize: 256 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 16 37 | mipBias: -100 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 31, y: 15, z: 31, w: 15} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | platformSettings: 62 | - serializedVersion: 2 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 256 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | spriteSheet: 74 | serializedVersion: 2 75 | sprites: [] 76 | outline: [] 77 | physicsShape: [] 78 | bones: [] 79 | spriteID: 93587f537905a1f4d90f06c12974ba5b 80 | vertices: [] 81 | indices: 82 | edges: [] 83 | weights: [] 84 | spritePackingTag: 85 | pSDRemoveMatte: 0 86 | pSDShowRemoveMatteOption: 0 87 | userData: 88 | assetBundleName: 89 | assetBundleVariant: 90 | -------------------------------------------------------------------------------- /Assets/Materials/Materials/FloorsRegular0204_1_S.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: FloorsRegular0204_1_S 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 2800000, guid: b8f6791b8324cbe4887d8bbfa134ca78, type: 3} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 1, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | #if UNITY_EDITOR 3 | using UnityEditor; 4 | #endif 5 | using UnityEngine; 6 | 7 | 8 | namespace UnityStandardAssets.CrossPlatformInput 9 | { 10 | [ExecuteInEditMode] 11 | public class MobileControlRig : MonoBehaviour 12 | { 13 | // this script enables or disables the child objects of a control rig 14 | // depending on whether the USE_MOBILE_INPUT define is declared. 15 | 16 | // This define is set or unset by a menu item that is included with 17 | // the Cross Platform Input package. 18 | 19 | #if !UNITY_EDITOR 20 | void OnEnable() 21 | { 22 | CheckEnableControlRig(); 23 | } 24 | #endif 25 | 26 | private void Start() 27 | { 28 | #if UNITY_EDITOR 29 | if (Application.isPlaying) //if in the editor, need to check if we are playing, as start is also called just after exiting play 30 | #endif 31 | { 32 | UnityEngine.EventSystems.EventSystem system = GameObject.FindObjectOfType(); 33 | 34 | if (system == null) 35 | {//the scene have no event system, spawn one 36 | GameObject o = new GameObject("EventSystem"); 37 | 38 | o.AddComponent(); 39 | o.AddComponent(); 40 | } 41 | } 42 | } 43 | 44 | #if UNITY_EDITOR 45 | 46 | private void OnEnable() 47 | { 48 | EditorUserBuildSettings.activeBuildTargetChanged += Update; 49 | EditorApplication.update += Update; 50 | } 51 | 52 | 53 | private void OnDisable() 54 | { 55 | EditorUserBuildSettings.activeBuildTargetChanged -= Update; 56 | EditorApplication.update -= Update; 57 | } 58 | 59 | 60 | private void Update() 61 | { 62 | CheckEnableControlRig(); 63 | } 64 | #endif 65 | 66 | 67 | private void CheckEnableControlRig() 68 | { 69 | #if MOBILE_INPUT 70 | EnableControlRig(true); 71 | #else 72 | EnableControlRig(false); 73 | #endif 74 | } 75 | 76 | 77 | private void EnableControlRig(bool enabled) 78 | { 79 | foreach (Transform t in transform) 80 | { 81 | t.gameObject.SetActive(enabled); 82 | } 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Assets/General Scripts/Camera/SidewaysCam.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SidewaysCam : MonoBehaviour { 5 | 6 | float height = 10f; 7 | float distanceBack = 10f; 8 | 9 | float camMoveSpeed = 50f; 10 | float zoomSpeed = 3f; 11 | 12 | float minZoomDistance = 10f; 13 | float maxZoomDistance = 30f; 14 | 15 | 16 | void Start() 17 | { 18 | transform.position = Vector3.zero; 19 | //Move up 20 | transform.position += new Vector3(0f, height, 0f); 21 | //Move back 22 | transform.position -= new Vector3(0f, 0f, distanceBack); 23 | //Look at the center to get an angle 24 | transform.LookAt(Vector3.zero); 25 | 26 | transform.eulerAngles = new Vector3(transform.rotation.eulerAngles.x, -90f, transform.rotation.eulerAngles.z); 27 | } 28 | 29 | 30 | 31 | void LateUpdate() 32 | { 33 | //Move camera with keys 34 | //Move left/right 35 | if (Input.GetKey(KeyCode.W)) 36 | { 37 | transform.position -= new Vector3(camMoveSpeed * Time.deltaTime, 0f, 0f); 38 | } 39 | else if (Input.GetKey(KeyCode.S)) 40 | { 41 | transform.position += new Vector3(camMoveSpeed * Time.deltaTime, 0f, 0f); 42 | } 43 | 44 | //Move forward/back 45 | if (Input.GetKey(KeyCode.A)) 46 | { 47 | transform.position -= new Vector3(0f, 0f, camMoveSpeed * Time.deltaTime); 48 | } 49 | else if (Input.GetKey(KeyCode.D)) 50 | { 51 | transform.position += new Vector3(0f, 0f, camMoveSpeed * Time.deltaTime); 52 | } 53 | 54 | //Zoom 55 | float currentHeight = transform.position.y; 56 | 57 | float zoomDistance = 0f; 58 | 59 | if (currentHeight > minZoomDistance && currentHeight < maxZoomDistance) 60 | { 61 | if (Input.GetAxis("Mouse ScrollWheel") > 0f || Input.GetKeyDown(KeyCode.I)) 62 | { 63 | zoomDistance += zoomSpeed; 64 | } 65 | else if (Input.GetAxis("Mouse ScrollWheel") < 0f || Input.GetKeyDown(KeyCode.O)) 66 | { 67 | zoomDistance -= zoomSpeed; 68 | } 69 | } 70 | //Can only zoom in 71 | else if (currentHeight >= maxZoomDistance) 72 | { 73 | if (Input.GetAxis("Mouse ScrollWheel") > 0f || Input.GetKeyDown(KeyCode.I)) 74 | { 75 | zoomDistance += zoomSpeed; 76 | } 77 | } 78 | //Can only zoom out 79 | else if (currentHeight <= minZoomDistance) 80 | { 81 | if (Input.GetAxis("Mouse ScrollWheel") < 0f || Input.GetKeyDown(KeyCode.O)) 82 | { 83 | zoomDistance -= zoomSpeed; 84 | } 85 | } 86 | 87 | transform.Translate(Vector3.forward * zoomDistance); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/StandaloneInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput.PlatformSpecific 5 | { 6 | public class StandaloneInput : VirtualInput 7 | { 8 | public override float GetAxis(string name, bool raw) 9 | { 10 | return raw ? Input.GetAxisRaw(name) : Input.GetAxis(name); 11 | } 12 | 13 | 14 | public override bool GetButton(string name) 15 | { 16 | return Input.GetButton(name); 17 | } 18 | 19 | 20 | public override bool GetButtonDown(string name) 21 | { 22 | return Input.GetButtonDown(name); 23 | } 24 | 25 | 26 | public override bool GetButtonUp(string name) 27 | { 28 | return Input.GetButtonUp(name); 29 | } 30 | 31 | 32 | public override void SetButtonDown(string name) 33 | { 34 | throw new Exception( 35 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 36 | } 37 | 38 | 39 | public override void SetButtonUp(string name) 40 | { 41 | throw new Exception( 42 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 43 | } 44 | 45 | 46 | public override void SetAxisPositive(string name) 47 | { 48 | throw new Exception( 49 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 50 | } 51 | 52 | 53 | public override void SetAxisNegative(string name) 54 | { 55 | throw new Exception( 56 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 57 | } 58 | 59 | 60 | public override void SetAxisZero(string name) 61 | { 62 | throw new Exception( 63 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 64 | } 65 | 66 | 67 | public override void SetAxis(string name, float value) 68 | { 69 | throw new Exception( 70 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 71 | } 72 | 73 | 74 | public override Vector3 MousePosition() 75 | { 76 | return Input.mousePosition; 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/AxisTouchButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | 5 | namespace UnityStandardAssets.CrossPlatformInput 6 | { 7 | public class AxisTouchButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler 8 | { 9 | // designed to work in a pair with another axis touch button 10 | // (typically with one having -1 and one having 1 axisValues) 11 | public string axisName = "Horizontal"; // The name of the axis 12 | public float axisValue = 1; // The axis that the value has 13 | public float responseSpeed = 3; // The speed at which the axis touch button responds 14 | public float returnToCentreSpeed = 3; // The speed at which the button will return to its centre 15 | 16 | AxisTouchButton m_PairedWith; // Which button this one is paired with 17 | CrossPlatformInputManager.VirtualAxis m_Axis; // A reference to the virtual axis as it is in the cross platform input 18 | 19 | void OnEnable() 20 | { 21 | if (!CrossPlatformInputManager.AxisExists(axisName)) 22 | { 23 | // if the axis doesnt exist create a new one in cross platform input 24 | m_Axis = new CrossPlatformInputManager.VirtualAxis(axisName); 25 | CrossPlatformInputManager.RegisterVirtualAxis(m_Axis); 26 | } 27 | else 28 | { 29 | m_Axis = CrossPlatformInputManager.VirtualAxisReference(axisName); 30 | } 31 | FindPairedButton(); 32 | } 33 | 34 | void FindPairedButton() 35 | { 36 | // find the other button witch which this button should be paired 37 | // (it should have the same axisName) 38 | var otherAxisButtons = FindObjectsOfType(typeof(AxisTouchButton)) as AxisTouchButton[]; 39 | 40 | if (otherAxisButtons != null) 41 | { 42 | for (int i = 0; i < otherAxisButtons.Length; i++) 43 | { 44 | if (otherAxisButtons[i].axisName == axisName && otherAxisButtons[i] != this) 45 | { 46 | m_PairedWith = otherAxisButtons[i]; 47 | } 48 | } 49 | } 50 | } 51 | 52 | void OnDisable() 53 | { 54 | // The object is disabled so remove it from the cross platform input system 55 | m_Axis.Remove(); 56 | } 57 | 58 | 59 | public void OnPointerDown(PointerEventData data) 60 | { 61 | if (m_PairedWith == null) 62 | { 63 | FindPairedButton(); 64 | } 65 | // update the axis and record that the button has been pressed this frame 66 | m_Axis.Update(Mathf.MoveTowards(m_Axis.GetValue, axisValue, responseSpeed * Time.deltaTime)); 67 | } 68 | 69 | 70 | public void OnPointerUp(PointerEventData data) 71 | { 72 | m_Axis.Update(Mathf.MoveTowards(m_Axis.GetValue, 0, responseSpeed * Time.deltaTime)); 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /Assets/General Scripts/PIDController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | public class PIDController 7 | { 8 | float error_old = 0f; 9 | //The controller will be more robust if you are using a further back sampe 10 | float error_old_2 = 0f; 11 | float error_sum = 0f; 12 | //If we want to average an error as input 13 | float error_sum2 = 0f; 14 | 15 | //PID parameters 16 | public float gain_P = 0f; 17 | public float gain_I = 0f; 18 | public float gain_D = 0f; 19 | //Sometimes you have to limit the total sum of all errors used in the I 20 | private float error_sumMax = 20f; 21 | 22 | 23 | 24 | public float GetFactorFromPIDController(float error) 25 | { 26 | float output = CalculatePIDOutput(error); 27 | 28 | return output; 29 | } 30 | 31 | 32 | 33 | //Use this when experimenting with PID parameters 34 | public float GetFactorFromPIDController(float gain_P, float gain_I, float gain_D, float error) 35 | { 36 | this.gain_P = gain_P; 37 | this.gain_I = gain_I; 38 | this.gain_D = gain_D; 39 | 40 | float output = CalculatePIDOutput(error); 41 | 42 | return output; 43 | } 44 | 45 | 46 | 47 | //Use this when experimenting with PID parameters and the gains are stored in a Vector3 48 | public float GetFactorFromPIDController(Vector3 gains, float error) 49 | { 50 | this.gain_P = gains.x; 51 | this.gain_I = gains.y; 52 | this.gain_D = gains.z; 53 | 54 | float output = CalculatePIDOutput(error); 55 | 56 | return output; 57 | } 58 | 59 | 60 | 61 | private float CalculatePIDOutput(float error) 62 | { 63 | //Test to use the average error as input 64 | //float averageAmount = 5f; 65 | 66 | //CTE = CTE_sum2 + ((CTE - CTE_sum2) / averageAmount); 67 | 68 | //CTE_sum2 = CTE; 69 | 70 | 71 | //The output from PID 72 | float output = 0f; 73 | 74 | 75 | //P 76 | output += gain_P * error; 77 | 78 | 79 | //I 80 | error_sum += Time.fixedDeltaTime * error; 81 | 82 | //Clamp the sum 83 | this.error_sum = Mathf.Clamp(error_sum, -error_sumMax, error_sumMax); 84 | 85 | //Sometimes better to just sum the last errors 86 | //float averageAmount = 20f; 87 | 88 | //CTE_sum = CTE_sum + ((CTE - CTE_sum) / averageAmount); 89 | 90 | output += gain_I * error_sum; 91 | 92 | 93 | //D 94 | float d_dt_error = (error - error_old) / Time.fixedDeltaTime; 95 | 96 | //Save the last errors 97 | this.error_old_2 = error_old; 98 | 99 | this.error_old = error; 100 | 101 | output += gain_D * d_dt_error; 102 | 103 | 104 | return output; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Assets/_Car Follow Path/Scripts/Math.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public static class Math 5 | { 6 | //Have we passed a waypoint? 7 | //From http://www.habrador.com/tutorials/linear-algebra/2-passed-waypoint/ 8 | public static bool HasPassedWaypoint(Vector3 carPos, Vector3 goingFromPos, Vector3 goingToPos) 9 | { 10 | bool hasPassedWaypoint = false; 11 | 12 | //The vector between the character and the waypoint we are going from 13 | Vector3 a = carPos - goingFromPos; 14 | 15 | //The vector between the waypoints 16 | Vector3 b = goingToPos - goingFromPos; 17 | 18 | //Vector projection from https://en.wikipedia.org/wiki/Vector_projection 19 | //To know if we have passed the upcoming waypoint we need to find out how much of b is a1 20 | //a1 = (a.b / |b|^2) * b 21 | //a1 = progress * b -> progress = a1 / b -> progress = (a.b / |b|^2) 22 | float progress = (a.x * b.x + a.y * b.y + a.z * b.z) / (b.x * b.x + b.y * b.y + b.z * b.z); 23 | 24 | //If progress is above 1 we know we have passed the waypoint 25 | if (progress > 1.0f) 26 | { 27 | hasPassedWaypoint = true; 28 | } 29 | 30 | return hasPassedWaypoint; 31 | } 32 | 33 | 34 | 35 | //Should we turn left or right to reach the next waypoint? 36 | //From: http://www.habrador.com/tutorials/linear-algebra/3-turn-left-or-right/ 37 | public static float SteerDirection(Transform carTrans, Vector3 steerPosition, Vector3 waypointPos) 38 | { 39 | //The right direction of the direction you are facing 40 | Vector3 youDir = carTrans.right; 41 | 42 | //The direction from you to the waypoint 43 | Vector3 waypointDir = waypointPos - steerPosition; 44 | 45 | //The dot product between the vectors 46 | float dotProduct = Vector3.Dot(youDir, waypointDir); 47 | 48 | //Now we can decide if we should turn left or right 49 | float steerDirection = 0f; 50 | if (dotProduct > 0f) 51 | { 52 | steerDirection = 1f; 53 | } 54 | else 55 | { 56 | steerDirection = -1f; 57 | } 58 | 59 | return steerDirection; 60 | } 61 | 62 | 63 | 64 | //Get the distance between where the car is and where it should be 65 | public static float GetCrossTrackError(Vector3 carPos, Vector3 goingFromPos, Vector3 goingToPos) 66 | { 67 | //The first part is the same as when we check if we have passed a waypoint 68 | 69 | //The vector between the character and the waypoint we are going from 70 | Vector3 a = carPos - goingFromPos; 71 | 72 | //The vector between the waypoints 73 | Vector3 b = goingToPos - goingFromPos; 74 | 75 | //Vector projection from https://en.wikipedia.org/wiki/Vector_projection 76 | //To know if we have passed the upcoming waypoint we need to find out how much of b is a1 77 | //a1 = (a.b / |b|^2) * b 78 | //a1 = progress * b -> progress = a1 / b -> progress = (a.b / |b|^2) 79 | float progress = (a.x * b.x + a.y * b.y + a.z * b.z) / (b.x * b.x + b.y * b.y + b.z * b.z); 80 | 81 | //The coordinate of the position where the car should be 82 | Vector3 errorPos = goingFromPos + progress * b; 83 | 84 | //The error between the position where the car should be and where it is 85 | float error = (errorPos - carPos).magnitude; 86 | 87 | return error; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/Joystick.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | 5 | namespace UnityStandardAssets.CrossPlatformInput 6 | { 7 | public class Joystick : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IDragHandler 8 | { 9 | public enum AxisOption 10 | { 11 | // Options for which axes to use 12 | Both, // Use both 13 | OnlyHorizontal, // Only horizontal 14 | OnlyVertical // Only vertical 15 | } 16 | 17 | public int MovementRange = 100; 18 | public AxisOption axesToUse = AxisOption.Both; // The options for the axes that the still will use 19 | public string horizontalAxisName = "Horizontal"; // The name given to the horizontal axis for the cross platform input 20 | public string verticalAxisName = "Vertical"; // The name given to the vertical axis for the cross platform input 21 | 22 | Vector3 m_StartPos; 23 | bool m_UseX; // Toggle for using the x axis 24 | bool m_UseY; // Toggle for using the Y axis 25 | CrossPlatformInputManager.VirtualAxis m_HorizontalVirtualAxis; // Reference to the joystick in the cross platform input 26 | CrossPlatformInputManager.VirtualAxis m_VerticalVirtualAxis; // Reference to the joystick in the cross platform input 27 | 28 | void OnEnable() 29 | { 30 | CreateVirtualAxes(); 31 | } 32 | 33 | void Start() 34 | { 35 | m_StartPos = transform.position; 36 | } 37 | 38 | void UpdateVirtualAxes(Vector3 value) 39 | { 40 | var delta = m_StartPos - value; 41 | delta.y = -delta.y; 42 | delta /= MovementRange; 43 | if (m_UseX) 44 | { 45 | m_HorizontalVirtualAxis.Update(-delta.x); 46 | } 47 | 48 | if (m_UseY) 49 | { 50 | m_VerticalVirtualAxis.Update(delta.y); 51 | } 52 | } 53 | 54 | void CreateVirtualAxes() 55 | { 56 | // set axes to use 57 | m_UseX = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyHorizontal); 58 | m_UseY = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyVertical); 59 | 60 | // create new axes based on axes to use 61 | if (m_UseX) 62 | { 63 | m_HorizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(horizontalAxisName); 64 | CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis); 65 | } 66 | if (m_UseY) 67 | { 68 | m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisName); 69 | CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis); 70 | } 71 | } 72 | 73 | 74 | public void OnDrag(PointerEventData data) 75 | { 76 | Vector3 newPos = Vector3.zero; 77 | 78 | if (m_UseX) 79 | { 80 | int delta = (int)(data.position.x - m_StartPos.x); 81 | delta = Mathf.Clamp(delta, - MovementRange, MovementRange); 82 | newPos.x = delta; 83 | } 84 | 85 | if (m_UseY) 86 | { 87 | int delta = (int)(data.position.y - m_StartPos.y); 88 | delta = Mathf.Clamp(delta, -MovementRange, MovementRange); 89 | newPos.y = delta; 90 | } 91 | transform.position = new Vector3(m_StartPos.x + newPos.x, m_StartPos.y + newPos.y, m_StartPos.z + newPos.z); 92 | UpdateVirtualAxes(transform.position); 93 | } 94 | 95 | 96 | public void OnPointerUp(PointerEventData data) 97 | { 98 | transform.position = m_StartPos; 99 | UpdateVirtualAxes(m_StartPos); 100 | } 101 | 102 | 103 | public void OnPointerDown(PointerEventData data) { } 104 | 105 | void OnDisable() 106 | { 107 | // remove the joysticks from the cross platform input 108 | if (m_UseX) 109 | { 110 | m_HorizontalVirtualAxis.Remove(); 111 | } 112 | if (m_UseY) 113 | { 114 | m_VerticalVirtualAxis.Remove(); 115 | } 116 | } 117 | } 118 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/CrossPlatformInputGuidelines.txt: -------------------------------------------------------------------------------- 1 | 2 | Importing the CrossPlatformInput package adds a menu item to Unity, "CrossPlatformInput", which allows you to enable or disable the CrossPlatformInput in the editor. You must enable the CrossPlatformInput in order to see the control rigs in the editor, and to start using Unity Remote to control your game. 3 | 4 | The CrossPlatformInput sample assets contains two main sections. 5 | 6 | 1) The folder of prefabs provide a variety of ready-to-use "MobileControlRigs". Each control rig is suitable for a different purpose, and each implements the touch or tilt-based equivalent of some of the default standalone axes or buttons. These are ready to drop into your scene, and to use them you simply need to read the axes via the CrossPlatformInput class, rather than Unity's regular Input class. 7 | 8 | 2) The set of scripts provided are the scripts we used to put together the control rigs prefabs. They provide a simplified way of reading basic mobile input, such as tilt, taps and swipe gestures. They are designed so that various mobile controls can be read in the same way as regular Unity axes and buttons. You can use these scripts to build your own MobileControlRigs. 9 | 10 | 11 | 12 | For example the Car control rig feeds the tilt input of the mobile device to the "Horizontal" axis, and has an accelerator and brake touch button which are fed as a pair into the "Vertical" axis. These are virtual equivalents of the real "Horizontal" and "Vertical" axes defined in Unity's Input Manager. 13 | 14 | Therefore when you read CrossPlatformInput.GetAxis("Horizontal"), you will either get the "real" input value - if your build target is non-mobile, or the value from the mobile control rig - if your build target is set to a mobile platform. 15 | 16 | The CrossPlatformInput scripts and prefabs are provided together as an example of how you can implement a cross-platform control solution in Unity. They also allow us to provide our other sample scenes in a form that can be published as standalone or to mobile targets with no modification. 17 | 18 | To use the CrossPlatformInput, you need to drop a "Mobile Control Rig" into your scene (or create your own), and then make calls to CrossPlatformInput functions, referring to the axes and buttons that the Rig implements. 19 | 20 | When reading input from the CrossPlatformInput class, the values returned will be taken either from Unity's Input Manager settings, or from the mobile-specific controls set up, depending on which build target you have selected. 21 | 22 | The CrossPlatformInput class is designed to be called instead of Unity's own Input class, and so mirrors certain parts of the Input API - specifically the functions relating to Axes and Buttons: 23 | GetAxis, GetAxisRaw 24 | GetButton, GetButtonDown, GetButtonUp 25 | 26 | Notes for coders: 27 | This package sets two compiler define symbols. One is always set automatically, the other is optionally set from a menu item. 28 | 29 | Importing the "CrossPlatformInput" package will automatically add a compiler define symbol, "CROSS_PLATFORM_INPUT". This enables the CrossPlatformInput functions defined in some of the other Sample Asset packages (such as the Characters, Planes, etc). Without this symbol defined, those packages use Unity's regular Input class, which means they can be imported alone and still work without the CrossPlatformInput package. 30 | 31 | The optional define (which is set by default, but can be disabled using the "Mobile Input" menu), is "MOBILE_INPUT". This causes the MobileControlRigs to become active when a mobile build target is selected. It also enables certain mobile-specific control nuances in some of the packages, which make more sense when the character or vehicle is being controlled using mobile input (such as auto-leveling the character's look direction). This define is optional because some developers prefer to use standalone input methods instead of the Unity Remote app, when testing mobile apps in the editor's play mode. 32 | 33 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/MobileInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput.PlatformSpecific 5 | { 6 | public class MobileInput : VirtualInput 7 | { 8 | private void AddButton(string name) 9 | { 10 | // we have not registered this button yet so add it, happens in the constructor 11 | CrossPlatformInputManager.RegisterVirtualButton(new CrossPlatformInputManager.VirtualButton(name)); 12 | } 13 | 14 | 15 | private void AddAxes(string name) 16 | { 17 | // we have not registered this button yet so add it, happens in the constructor 18 | CrossPlatformInputManager.RegisterVirtualAxis(new CrossPlatformInputManager.VirtualAxis(name)); 19 | } 20 | 21 | 22 | public override float GetAxis(string name, bool raw) 23 | { 24 | if (!m_VirtualAxes.ContainsKey(name)) 25 | { 26 | AddAxes(name); 27 | } 28 | return m_VirtualAxes[name].GetValue; 29 | } 30 | 31 | 32 | public override void SetButtonDown(string name) 33 | { 34 | if (!m_VirtualButtons.ContainsKey(name)) 35 | { 36 | AddButton(name); 37 | } 38 | m_VirtualButtons[name].Pressed(); 39 | } 40 | 41 | 42 | public override void SetButtonUp(string name) 43 | { 44 | if (!m_VirtualButtons.ContainsKey(name)) 45 | { 46 | AddButton(name); 47 | } 48 | m_VirtualButtons[name].Released(); 49 | } 50 | 51 | 52 | public override void SetAxisPositive(string name) 53 | { 54 | if (!m_VirtualAxes.ContainsKey(name)) 55 | { 56 | AddAxes(name); 57 | } 58 | m_VirtualAxes[name].Update(1f); 59 | } 60 | 61 | 62 | public override void SetAxisNegative(string name) 63 | { 64 | if (!m_VirtualAxes.ContainsKey(name)) 65 | { 66 | AddAxes(name); 67 | } 68 | m_VirtualAxes[name].Update(-1f); 69 | } 70 | 71 | 72 | public override void SetAxisZero(string name) 73 | { 74 | if (!m_VirtualAxes.ContainsKey(name)) 75 | { 76 | AddAxes(name); 77 | } 78 | m_VirtualAxes[name].Update(0f); 79 | } 80 | 81 | 82 | public override void SetAxis(string name, float value) 83 | { 84 | if (!m_VirtualAxes.ContainsKey(name)) 85 | { 86 | AddAxes(name); 87 | } 88 | m_VirtualAxes[name].Update(value); 89 | } 90 | 91 | 92 | public override bool GetButtonDown(string name) 93 | { 94 | if (m_VirtualButtons.ContainsKey(name)) 95 | { 96 | return m_VirtualButtons[name].GetButtonDown; 97 | } 98 | 99 | AddButton(name); 100 | return m_VirtualButtons[name].GetButtonDown; 101 | } 102 | 103 | 104 | public override bool GetButtonUp(string name) 105 | { 106 | if (m_VirtualButtons.ContainsKey(name)) 107 | { 108 | return m_VirtualButtons[name].GetButtonUp; 109 | } 110 | 111 | AddButton(name); 112 | return m_VirtualButtons[name].GetButtonUp; 113 | } 114 | 115 | 116 | public override bool GetButton(string name) 117 | { 118 | if (m_VirtualButtons.ContainsKey(name)) 119 | { 120 | return m_VirtualButtons[name].GetButton; 121 | } 122 | 123 | AddButton(name); 124 | return m_VirtualButtons[name].GetButton; 125 | } 126 | 127 | 128 | public override Vector3 MousePosition() 129 | { 130 | return virtualMousePosition; 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /Assets/Prefabs/Propeller.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &1000011960120476 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 4000013476110164} 12 | - component: {fileID: 114000012474635768} 13 | m_Layer: 0 14 | m_Name: Propeller 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &4000013476110164 21 | Transform: 22 | m_ObjectHideFlags: 0 23 | m_CorrespondingSourceObject: {fileID: 0} 24 | m_PrefabInstance: {fileID: 0} 25 | m_PrefabAsset: {fileID: 0} 26 | m_GameObject: {fileID: 1000011960120476} 27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 28 | m_LocalPosition: {x: 0, y: 1.99, z: 0} 29 | m_LocalScale: {x: 1, y: 1, z: 1} 30 | m_Children: 31 | - {fileID: 3048580441547322273} 32 | m_Father: {fileID: 0} 33 | m_RootOrder: 0 34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 35 | --- !u!114 &114000012474635768 36 | MonoBehaviour: 37 | m_ObjectHideFlags: 0 38 | m_CorrespondingSourceObject: {fileID: 0} 39 | m_PrefabInstance: {fileID: 0} 40 | m_PrefabAsset: {fileID: 0} 41 | m_GameObject: {fileID: 1000011960120476} 42 | m_Enabled: 1 43 | m_EditorHideFlags: 0 44 | m_Script: {fileID: 11500000, guid: 80fd031bbd39a624891098b6faf1fd42, type: 3} 45 | m_Name: 46 | m_EditorClassIdentifier: 47 | rotationSpeed: 1000 48 | shouldRotate: 1 49 | shouldRotateOtherDirection: 0 50 | --- !u!1 &5652895381976952277 51 | GameObject: 52 | m_ObjectHideFlags: 0 53 | m_CorrespondingSourceObject: {fileID: 0} 54 | m_PrefabInstance: {fileID: 0} 55 | m_PrefabAsset: {fileID: 0} 56 | serializedVersion: 6 57 | m_Component: 58 | - component: {fileID: 3048580441547322273} 59 | - component: {fileID: 4140796099248607971} 60 | - component: {fileID: 6360887435112019321} 61 | m_Layer: 0 62 | m_Name: Cube 63 | m_TagString: Untagged 64 | m_Icon: {fileID: 0} 65 | m_NavMeshLayer: 0 66 | m_StaticEditorFlags: 0 67 | m_IsActive: 1 68 | --- !u!4 &3048580441547322273 69 | Transform: 70 | m_ObjectHideFlags: 0 71 | m_CorrespondingSourceObject: {fileID: 0} 72 | m_PrefabInstance: {fileID: 0} 73 | m_PrefabAsset: {fileID: 0} 74 | m_GameObject: {fileID: 5652895381976952277} 75 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 76 | m_LocalPosition: {x: 0, y: 0, z: 0} 77 | m_LocalScale: {x: 0.1, y: 0.01, z: 0.8} 78 | m_Children: [] 79 | m_Father: {fileID: 4000013476110164} 80 | m_RootOrder: 0 81 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 82 | --- !u!33 &4140796099248607971 83 | MeshFilter: 84 | m_ObjectHideFlags: 0 85 | m_CorrespondingSourceObject: {fileID: 0} 86 | m_PrefabInstance: {fileID: 0} 87 | m_PrefabAsset: {fileID: 0} 88 | m_GameObject: {fileID: 5652895381976952277} 89 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 90 | --- !u!23 &6360887435112019321 91 | MeshRenderer: 92 | m_ObjectHideFlags: 0 93 | m_CorrespondingSourceObject: {fileID: 0} 94 | m_PrefabInstance: {fileID: 0} 95 | m_PrefabAsset: {fileID: 0} 96 | m_GameObject: {fileID: 5652895381976952277} 97 | m_Enabled: 1 98 | m_CastShadows: 1 99 | m_ReceiveShadows: 1 100 | m_DynamicOccludee: 1 101 | m_MotionVectors: 1 102 | m_LightProbeUsage: 1 103 | m_ReflectionProbeUsage: 1 104 | m_RenderingLayerMask: 1 105 | m_RendererPriority: 0 106 | m_Materials: 107 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 108 | m_StaticBatchInfo: 109 | firstSubMesh: 0 110 | subMeshCount: 0 111 | m_StaticBatchRoot: {fileID: 0} 112 | m_ProbeAnchor: {fileID: 0} 113 | m_LightProbeVolumeOverride: {fileID: 0} 114 | m_ScaleInLightmap: 1 115 | m_PreserveUVs: 0 116 | m_IgnoreNormalsForChartDetection: 0 117 | m_ImportantGI: 0 118 | m_StitchLightmapSeams: 0 119 | m_SelectedEditorRenderState: 3 120 | m_MinimumChartSize: 4 121 | m_AutoUVMaxDistance: 0.5 122 | m_AutoUVMaxAngle: 89 123 | m_LightmapParameters: {fileID: 0} 124 | m_SortingLayerID: 0 125 | m_SortingLayer: 0 126 | m_SortingOrder: 0 127 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Prefabs/MobileTiltControlRig.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: 11400004} 12 | m_Layer: 0 13 | m_Name: MobileTiltControlRig 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!1 &100002 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: 400002} 27 | - 114: {fileID: 11400000} 28 | m_Layer: 0 29 | m_Name: TiltSteerInputH 30 | m_TagString: Untagged 31 | m_Icon: {fileID: 0} 32 | m_NavMeshLayer: 0 33 | m_StaticEditorFlags: 0 34 | m_IsActive: 1 35 | --- !u!1 &100004 36 | GameObject: 37 | m_ObjectHideFlags: 0 38 | m_PrefabParentObject: {fileID: 0} 39 | m_PrefabInternal: {fileID: 100100000} 40 | serializedVersion: 4 41 | m_Component: 42 | - 4: {fileID: 400004} 43 | - 114: {fileID: 11400002} 44 | m_Layer: 0 45 | m_Name: TiltSteerInputV 46 | m_TagString: Untagged 47 | m_Icon: {fileID: 0} 48 | m_NavMeshLayer: 0 49 | m_StaticEditorFlags: 0 50 | m_IsActive: 1 51 | --- !u!4 &400000 52 | Transform: 53 | m_ObjectHideFlags: 1 54 | m_PrefabParentObject: {fileID: 0} 55 | m_PrefabInternal: {fileID: 100100000} 56 | m_GameObject: {fileID: 100000} 57 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 58 | m_LocalPosition: {x: 385.509033, y: 268.018066, z: -62.2695312} 59 | m_LocalScale: {x: 1, y: 1, z: 1} 60 | m_Children: 61 | - {fileID: 400004} 62 | - {fileID: 400002} 63 | m_Father: {fileID: 0} 64 | m_RootOrder: 0 65 | --- !u!4 &400002 66 | Transform: 67 | m_ObjectHideFlags: 1 68 | m_PrefabParentObject: {fileID: 0} 69 | m_PrefabInternal: {fileID: 100100000} 70 | m_GameObject: {fileID: 100002} 71 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 72 | m_LocalPosition: {x: -928.193604, y: -473.736786, z: -.00032043457} 73 | m_LocalScale: {x: 1, y: 1, z: 1} 74 | m_Children: [] 75 | m_Father: {fileID: 400000} 76 | m_RootOrder: 1 77 | --- !u!4 &400004 78 | Transform: 79 | m_ObjectHideFlags: 1 80 | m_PrefabParentObject: {fileID: 0} 81 | m_PrefabInternal: {fileID: 100100000} 82 | m_GameObject: {fileID: 100004} 83 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 84 | m_LocalPosition: {x: -928.193604, y: -473.736786, z: -.00032043457} 85 | m_LocalScale: {x: 1, y: 1, z: 1} 86 | m_Children: [] 87 | m_Father: {fileID: 400000} 88 | m_RootOrder: 0 89 | --- !u!114 &11400000 90 | MonoBehaviour: 91 | m_ObjectHideFlags: 1 92 | m_PrefabParentObject: {fileID: 0} 93 | m_PrefabInternal: {fileID: 100100000} 94 | m_GameObject: {fileID: 100002} 95 | m_Enabled: 1 96 | m_EditorHideFlags: 0 97 | m_Script: {fileID: 11500000, guid: 5c2d84226fbbaf94e9c1451f1c39b06a, type: 3} 98 | m_Name: 99 | m_EditorClassIdentifier: 100 | mapping: 101 | type: 0 102 | axisName: Horizontal 103 | tiltAroundAxis: 0 104 | fullTiltAngle: 50 105 | centreAngleOffset: 0 106 | --- !u!114 &11400002 107 | MonoBehaviour: 108 | m_ObjectHideFlags: 1 109 | m_PrefabParentObject: {fileID: 0} 110 | m_PrefabInternal: {fileID: 100100000} 111 | m_GameObject: {fileID: 100004} 112 | m_Enabled: 1 113 | m_EditorHideFlags: 0 114 | m_Script: {fileID: 11500000, guid: 5c2d84226fbbaf94e9c1451f1c39b06a, type: 3} 115 | m_Name: 116 | m_EditorClassIdentifier: 117 | mapping: 118 | type: 0 119 | axisName: Vertical 120 | tiltAroundAxis: 1 121 | fullTiltAngle: -35 122 | centreAngleOffset: 45 123 | --- !u!114 &11400004 124 | MonoBehaviour: 125 | m_ObjectHideFlags: 1 126 | m_PrefabParentObject: {fileID: 0} 127 | m_PrefabInternal: {fileID: 100100000} 128 | m_GameObject: {fileID: 100000} 129 | m_Enabled: 1 130 | m_EditorHideFlags: 0 131 | m_Script: {fileID: 11500000, guid: 71398ce7fbc3a5b4fa50b50bd54317a7, type: 3} 132 | m_Name: 133 | m_EditorClassIdentifier: 134 | --- !u!1001 &100100000 135 | Prefab: 136 | m_ObjectHideFlags: 1 137 | serializedVersion: 2 138 | m_Modification: 139 | m_TransformParent: {fileID: 0} 140 | m_Modifications: [] 141 | m_RemovedComponents: [] 142 | m_ParentPrefab: {fileID: 0} 143 | m_RootGameObject: {fileID: 100000} 144 | m_IsPrefabParent: 1 145 | -------------------------------------------------------------------------------- /Assets/_Inverted Pendulum/Scripts/InvertedPendulum.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class InvertedPendulum : MonoBehaviour 5 | { 6 | //The car the pendulum is attached to 7 | public GameObject carObj; 8 | //Have to move the center of mass because it's not at the center of the hinge 9 | public float centerOfMassChangeUp; 10 | //The force 11 | public float force; 12 | 13 | //PID parameters 14 | public float gain_P = 0f; 15 | public float gain_I = 0f; 16 | public float gain_D = 0f; 17 | //Sometimes you have to limit the total sum of all errors used in the I 18 | //public float error_sumMax = 20f; 19 | private PIDController pidController; 20 | 21 | //Scripts and modules 22 | private HingeJoint hingeJoint; 23 | //To control if the car should drive forward or reverse 24 | private BasicCar carScript; 25 | //The PID controller 26 | //private PIDController pidScript; 27 | //The rigid body 28 | private Rigidbody hingeRB; 29 | 30 | 31 | void Start() 32 | { 33 | hingeJoint = gameObject.GetComponent(); 34 | 35 | carScript = carObj.GetComponent(); 36 | 37 | //pidScript = gameObject.GetComponent(); 38 | 39 | hingeRB = gameObject.GetComponent(); 40 | 41 | hingeRB.centerOfMass = hingeRB.centerOfMass + centerOfMassChangeUp * transform.up; 42 | 43 | pidController = new PIDController(); 44 | } 45 | 46 | 47 | 48 | void FixedUpdate() 49 | { 50 | //Move the center of mass 51 | //Could do this once in the beginning but more fun to experiment with different values 52 | //transform.GetComponent().centerOfMass = hingeJoint.transform.position + centerOfMassChangeUp * transform.GetChild(0).transform.up; 53 | 54 | //MoveCarNaive(); 55 | 56 | MoveCarPID(); 57 | 58 | 59 | //Add a force to the pendulum 60 | //We can also lift up the pendulum with the force so we dont have to reset if it falls 61 | //This can be seen as driving forward/reverse with a segway 62 | //should be 6 degrees according to report 63 | //hingeJoint.useMotor = false; 64 | if (Input.GetKey(KeyCode.W) && hingeJoint.angle < 6f) 65 | { 66 | //Could maybe control this as well with a PID controller 67 | hingeRB.AddForceAtPosition(transform.forward * force, transform.position + transform.up * centerOfMassChangeUp * 2f); 68 | 69 | //hingeJoint.useMotor = true; 70 | 71 | //JointMotor motor = new JointMotor(); 72 | 73 | //motor.force = force; 74 | //motor.targetVelocity = 5f; 75 | 76 | //hingeJoint.motor = motor; 77 | } 78 | else if (Input.GetKey(KeyCode.S) && hingeJoint.angle > -6f) 79 | { 80 | hingeRB.AddForceAtPosition(-transform.forward * force, transform.position + transform.up * centerOfMassChangeUp * 2f); 81 | 82 | //JointMotor motor = new JointMotor(); 83 | 84 | //motor.force = force; 85 | //motor.targetVelocity = -5f; 86 | 87 | //hingeJoint.motor = motor; 88 | 89 | //hingeJoint.useMotor = true; 90 | } 91 | 92 | 93 | Debug.DrawRay(transform.position + transform.up * centerOfMassChangeUp * 2f, transform.forward * 2f, Color.red); 94 | Debug.DrawRay(transform.position + transform.up * centerOfMassChangeUp * 2f, -transform.forward * 2f, Color.blue); 95 | } 96 | 97 | 98 | 99 | //Move the car by just using the angle of the stick 100 | void MoveCarNaive() 101 | { 102 | //print(hingeJoint.angle); 103 | 104 | float angle = hingeJoint.angle; 105 | 106 | //If the pendulum is swinging forward the angle is positive and the car should drive forward 107 | if (angle > 0f) 108 | { 109 | carScript.MotorTorque = carScript.MotorTorque; 110 | } 111 | else if (angle < 0f) 112 | { 113 | carScript.MotorTorque = -carScript.MotorTorque; 114 | } 115 | else 116 | { 117 | carScript.MotorTorque = 0f; 118 | } 119 | } 120 | 121 | 122 | 123 | //Move the car with a PID controller 124 | void MoveCarPID() 125 | { 126 | float error = 0f - hingeJoint.angle; 127 | 128 | error *= -1f; 129 | 130 | float outputFromPID = pidController.GetFactorFromPIDController(gain_P, gain_I, gain_D, error); 131 | 132 | float maxMotorTorque = carScript.MotorTorque; 133 | 134 | float motorTorque = Mathf.Clamp(outputFromPID * maxMotorTorque, -maxMotorTorque, maxMotorTorque); 135 | 136 | //Give the motor torque to the car 137 | carScript.MotorTorque = motorTorque; 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/TouchPad.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | using UnityEngine.UI; 5 | 6 | namespace UnityStandardAssets.CrossPlatformInput 7 | { 8 | [RequireComponent(typeof(Image))] 9 | public class TouchPad : MonoBehaviour, IPointerDownHandler, IPointerUpHandler 10 | { 11 | // Options for which axes to use 12 | public enum AxisOption 13 | { 14 | Both, // Use both 15 | OnlyHorizontal, // Only horizontal 16 | OnlyVertical // Only vertical 17 | } 18 | 19 | 20 | public enum ControlStyle 21 | { 22 | Absolute, // operates from teh center of the image 23 | Relative, // operates from the center of the initial touch 24 | Swipe, // swipe to touch touch no maintained center 25 | } 26 | 27 | 28 | public AxisOption axesToUse = AxisOption.Both; // The options for the axes that the still will use 29 | public ControlStyle controlStyle = ControlStyle.Absolute; // control style to use 30 | public string horizontalAxisName = "Horizontal"; // The name given to the horizontal axis for the cross platform input 31 | public string verticalAxisName = "Vertical"; // The name given to the vertical axis for the cross platform input 32 | public float Xsensitivity = 1f; 33 | public float Ysensitivity = 1f; 34 | 35 | Vector3 m_StartPos; 36 | Vector2 m_PreviousDelta; 37 | Vector3 m_JoytickOutput; 38 | bool m_UseX; // Toggle for using the x axis 39 | bool m_UseY; // Toggle for using the Y axis 40 | CrossPlatformInputManager.VirtualAxis m_HorizontalVirtualAxis; // Reference to the joystick in the cross platform input 41 | CrossPlatformInputManager.VirtualAxis m_VerticalVirtualAxis; // Reference to the joystick in the cross platform input 42 | bool m_Dragging; 43 | int m_Id = -1; 44 | Vector2 m_PreviousTouchPos; // swipe style control touch 45 | 46 | 47 | #if !UNITY_EDITOR 48 | private Vector3 m_Center; 49 | private Image m_Image; 50 | #else 51 | Vector3 m_PreviousMouse; 52 | #endif 53 | 54 | void OnEnable() 55 | { 56 | CreateVirtualAxes(); 57 | } 58 | 59 | void Start() 60 | { 61 | #if !UNITY_EDITOR 62 | m_Image = GetComponent(); 63 | m_Center = m_Image.transform.position; 64 | #endif 65 | } 66 | 67 | void CreateVirtualAxes() 68 | { 69 | // set axes to use 70 | m_UseX = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyHorizontal); 71 | m_UseY = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyVertical); 72 | 73 | // create new axes based on axes to use 74 | if (m_UseX) 75 | { 76 | m_HorizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(horizontalAxisName); 77 | CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis); 78 | } 79 | if (m_UseY) 80 | { 81 | m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisName); 82 | CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis); 83 | } 84 | } 85 | 86 | void UpdateVirtualAxes(Vector3 value) 87 | { 88 | value = value.normalized; 89 | if (m_UseX) 90 | { 91 | m_HorizontalVirtualAxis.Update(value.x); 92 | } 93 | 94 | if (m_UseY) 95 | { 96 | m_VerticalVirtualAxis.Update(value.y); 97 | } 98 | } 99 | 100 | 101 | public void OnPointerDown(PointerEventData data) 102 | { 103 | m_Dragging = true; 104 | m_Id = data.pointerId; 105 | #if !UNITY_EDITOR 106 | if (controlStyle != ControlStyle.Absolute ) 107 | m_Center = data.position; 108 | #endif 109 | } 110 | 111 | void Update() 112 | { 113 | if (!m_Dragging) 114 | { 115 | return; 116 | } 117 | if (Input.touchCount >= m_Id + 1 && m_Id != -1) 118 | { 119 | #if !UNITY_EDITOR 120 | 121 | if (controlStyle == ControlStyle.Swipe) 122 | { 123 | m_Center = m_PreviousTouchPos; 124 | m_PreviousTouchPos = Input.touches[m_Id].position; 125 | } 126 | Vector2 pointerDelta = new Vector2(Input.touches[m_Id].position.x - m_Center.x , Input.touches[m_Id].position.y - m_Center.y).normalized; 127 | pointerDelta.x *= Xsensitivity; 128 | pointerDelta.y *= Ysensitivity; 129 | #else 130 | Vector2 pointerDelta; 131 | pointerDelta.x = Input.mousePosition.x - m_PreviousMouse.x; 132 | pointerDelta.y = Input.mousePosition.y - m_PreviousMouse.y; 133 | m_PreviousMouse = new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0f); 134 | #endif 135 | UpdateVirtualAxes(new Vector3(pointerDelta.x, pointerDelta.y, 0)); 136 | } 137 | } 138 | 139 | 140 | public void OnPointerUp(PointerEventData data) 141 | { 142 | m_Dragging = false; 143 | m_Id = -1; 144 | UpdateVirtualAxes(Vector3.zero); 145 | } 146 | 147 | void OnDisable() 148 | { 149 | if (CrossPlatformInputManager.AxisExists(horizontalAxisName)) 150 | CrossPlatformInputManager.UnRegisterVirtualAxis(horizontalAxisName); 151 | 152 | if (CrossPlatformInputManager.AxisExists(verticalAxisName)) 153 | CrossPlatformInputManager.UnRegisterVirtualAxis(verticalAxisName); 154 | } 155 | } 156 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/TiltInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | #if UNITY_EDITOR 4 | using UnityEditor; 5 | #endif 6 | 7 | namespace UnityStandardAssets.CrossPlatformInput 8 | { 9 | // helps with managing tilt input on mobile devices 10 | public class TiltInput : MonoBehaviour 11 | { 12 | // options for the various orientations 13 | public enum AxisOptions 14 | { 15 | ForwardAxis, 16 | SidewaysAxis, 17 | } 18 | 19 | 20 | [Serializable] 21 | public class AxisMapping 22 | { 23 | public enum MappingType 24 | { 25 | NamedAxis, 26 | MousePositionX, 27 | MousePositionY, 28 | MousePositionZ 29 | }; 30 | 31 | 32 | public MappingType type; 33 | public string axisName; 34 | } 35 | 36 | 37 | public AxisMapping mapping; 38 | public AxisOptions tiltAroundAxis = AxisOptions.ForwardAxis; 39 | public float fullTiltAngle = 25; 40 | public float centreAngleOffset = 0; 41 | 42 | 43 | private CrossPlatformInputManager.VirtualAxis m_SteerAxis; 44 | 45 | 46 | private void OnEnable() 47 | { 48 | if (mapping.type == AxisMapping.MappingType.NamedAxis) 49 | { 50 | m_SteerAxis = new CrossPlatformInputManager.VirtualAxis(mapping.axisName); 51 | CrossPlatformInputManager.RegisterVirtualAxis(m_SteerAxis); 52 | } 53 | } 54 | 55 | 56 | private void Update() 57 | { 58 | float angle = 0; 59 | if (Input.acceleration != Vector3.zero) 60 | { 61 | switch (tiltAroundAxis) 62 | { 63 | case AxisOptions.ForwardAxis: 64 | angle = Mathf.Atan2(Input.acceleration.x, -Input.acceleration.y)*Mathf.Rad2Deg + 65 | centreAngleOffset; 66 | break; 67 | case AxisOptions.SidewaysAxis: 68 | angle = Mathf.Atan2(Input.acceleration.z, -Input.acceleration.y)*Mathf.Rad2Deg + 69 | centreAngleOffset; 70 | break; 71 | } 72 | } 73 | 74 | float axisValue = Mathf.InverseLerp(-fullTiltAngle, fullTiltAngle, angle)*2 - 1; 75 | switch (mapping.type) 76 | { 77 | case AxisMapping.MappingType.NamedAxis: 78 | m_SteerAxis.Update(axisValue); 79 | break; 80 | case AxisMapping.MappingType.MousePositionX: 81 | CrossPlatformInputManager.SetVirtualMousePositionX(axisValue*Screen.width); 82 | break; 83 | case AxisMapping.MappingType.MousePositionY: 84 | CrossPlatformInputManager.SetVirtualMousePositionY(axisValue*Screen.width); 85 | break; 86 | case AxisMapping.MappingType.MousePositionZ: 87 | CrossPlatformInputManager.SetVirtualMousePositionZ(axisValue*Screen.width); 88 | break; 89 | } 90 | } 91 | 92 | 93 | private void OnDisable() 94 | { 95 | m_SteerAxis.Remove(); 96 | } 97 | } 98 | } 99 | 100 | 101 | namespace UnityStandardAssets.CrossPlatformInput.Inspector 102 | { 103 | #if UNITY_EDITOR 104 | [CustomPropertyDrawer(typeof (TiltInput.AxisMapping))] 105 | public class TiltInputAxisStylePropertyDrawer : PropertyDrawer 106 | { 107 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 108 | { 109 | EditorGUI.BeginProperty(position, label, property); 110 | 111 | float x = position.x; 112 | float y = position.y; 113 | float inspectorWidth = position.width; 114 | 115 | // Don't make child fields be indented 116 | var indent = EditorGUI.indentLevel; 117 | EditorGUI.indentLevel = 0; 118 | 119 | var props = new[] {"type", "axisName"}; 120 | var widths = new[] {.4f, .6f}; 121 | if (property.FindPropertyRelative("type").enumValueIndex > 0) 122 | { 123 | // hide name if not a named axis 124 | props = new[] {"type"}; 125 | widths = new[] {1f}; 126 | } 127 | const float lineHeight = 18; 128 | for (int n = 0; n < props.Length; ++n) 129 | { 130 | float w = widths[n]*inspectorWidth; 131 | 132 | // Calculate rects 133 | Rect rect = new Rect(x, y, w, lineHeight); 134 | x += w; 135 | 136 | EditorGUI.PropertyField(rect, property.FindPropertyRelative(props[n]), GUIContent.none); 137 | } 138 | 139 | // Set indent back to what it was 140 | EditorGUI.indentLevel = indent; 141 | EditorGUI.EndProperty(); 142 | } 143 | } 144 | #endif 145 | } 146 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/VirtualInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace UnityStandardAssets.CrossPlatformInput 7 | { 8 | public abstract class VirtualInput 9 | { 10 | public Vector3 virtualMousePosition { get; private set; } 11 | 12 | 13 | protected Dictionary m_VirtualAxes = 14 | new Dictionary(); 15 | // Dictionary to store the name relating to the virtual axes 16 | protected Dictionary m_VirtualButtons = 17 | new Dictionary(); 18 | protected List m_AlwaysUseVirtual = new List(); 19 | // list of the axis and button names that have been flagged to always use a virtual axis or button 20 | 21 | 22 | public bool AxisExists(string name) 23 | { 24 | return m_VirtualAxes.ContainsKey(name); 25 | } 26 | 27 | public bool ButtonExists(string name) 28 | { 29 | return m_VirtualButtons.ContainsKey(name); 30 | } 31 | 32 | 33 | public void RegisterVirtualAxis(CrossPlatformInputManager.VirtualAxis axis) 34 | { 35 | // check if we already have an axis with that name and log and error if we do 36 | if (m_VirtualAxes.ContainsKey(axis.name)) 37 | { 38 | Debug.LogError("There is already a virtual axis named " + axis.name + " registered."); 39 | } 40 | else 41 | { 42 | // add any new axes 43 | m_VirtualAxes.Add(axis.name, axis); 44 | 45 | // if we dont want to match with the input manager setting then revert to always using virtual 46 | if (!axis.matchWithInputManager) 47 | { 48 | m_AlwaysUseVirtual.Add(axis.name); 49 | } 50 | } 51 | } 52 | 53 | 54 | public void RegisterVirtualButton(CrossPlatformInputManager.VirtualButton button) 55 | { 56 | // check if already have a buttin with that name and log an error if we do 57 | if (m_VirtualButtons.ContainsKey(button.name)) 58 | { 59 | Debug.LogError("There is already a virtual button named " + button.name + " registered."); 60 | } 61 | else 62 | { 63 | // add any new buttons 64 | m_VirtualButtons.Add(button.name, button); 65 | 66 | // if we dont want to match to the input manager then always use a virtual axis 67 | if (!button.matchWithInputManager) 68 | { 69 | m_AlwaysUseVirtual.Add(button.name); 70 | } 71 | } 72 | } 73 | 74 | 75 | public void UnRegisterVirtualAxis(string name) 76 | { 77 | // if we have an axis with that name then remove it from our dictionary of registered axes 78 | if (m_VirtualAxes.ContainsKey(name)) 79 | { 80 | m_VirtualAxes.Remove(name); 81 | } 82 | } 83 | 84 | 85 | public void UnRegisterVirtualButton(string name) 86 | { 87 | // if we have a button with this name then remove it from our dictionary of registered buttons 88 | if (m_VirtualButtons.ContainsKey(name)) 89 | { 90 | m_VirtualButtons.Remove(name); 91 | } 92 | } 93 | 94 | 95 | // returns a reference to a named virtual axis if it exists otherwise null 96 | public CrossPlatformInputManager.VirtualAxis VirtualAxisReference(string name) 97 | { 98 | return m_VirtualAxes.ContainsKey(name) ? m_VirtualAxes[name] : null; 99 | } 100 | 101 | 102 | public void SetVirtualMousePositionX(float f) 103 | { 104 | virtualMousePosition = new Vector3(f, virtualMousePosition.y, virtualMousePosition.z); 105 | } 106 | 107 | 108 | public void SetVirtualMousePositionY(float f) 109 | { 110 | virtualMousePosition = new Vector3(virtualMousePosition.x, f, virtualMousePosition.z); 111 | } 112 | 113 | 114 | public void SetVirtualMousePositionZ(float f) 115 | { 116 | virtualMousePosition = new Vector3(virtualMousePosition.x, virtualMousePosition.y, f); 117 | } 118 | 119 | 120 | public abstract float GetAxis(string name, bool raw); 121 | 122 | public abstract bool GetButton(string name); 123 | public abstract bool GetButtonDown(string name); 124 | public abstract bool GetButtonUp(string name); 125 | 126 | public abstract void SetButtonDown(string name); 127 | public abstract void SetButtonUp(string name); 128 | public abstract void SetAxisPositive(string name); 129 | public abstract void SetAxisNegative(string name); 130 | public abstract void SetAxisZero(string name); 131 | public abstract void SetAxis(string name, float value); 132 | public abstract Vector3 MousePosition(); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /Assets/_Inverted Pendulum/Scripts/BasicCar.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | //Modified basic car controller from Unity 6 | //https://docs.unity3d.com/Manual/WheelColliderTutorial.html 7 | 8 | public class BasicCar : MonoBehaviour 9 | { 10 | public List axleInfos; 11 | 12 | //Car data 13 | float maxMotorTorque = 5000f; 14 | float maxSteeringAngle = 40f; 15 | 16 | //To get a more realistic behavior 17 | public Vector3 centerOfMassChange; 18 | 19 | //The difference between the center of the car and the position where we steer 20 | public float centerSteerDifference; 21 | //The position where the car is steering 22 | private Vector3 steerPosition; 23 | 24 | //All waypoints 25 | public List allWaypoints; 26 | //The current index of the list with all waypoints 27 | private int currentWaypointIndex = 0; 28 | //The waypoint we are going towards and the waypoint we are going from 29 | private Vector3 currentWaypoint; 30 | private Vector3 previousWaypoint; 31 | 32 | //Average the steering angles to simulate the time it takes to turn the wheel 33 | float averageSteeringAngle = 0f; 34 | 35 | PIDController PIDControllerScript; 36 | 37 | //Car modes 38 | public enum CarModes { Forward, Stop, Reverse }; 39 | public CarModes carMode; 40 | 41 | private float currentMotorTorque; 42 | 43 | 44 | 45 | void Start() 46 | { 47 | //Move the center of mass 48 | transform.GetComponent().centerOfMass = transform.GetComponent().centerOfMass + centerOfMassChange; 49 | 50 | carMode = CarModes.Stop; 51 | } 52 | 53 | 54 | 55 | //Finds the corresponding visual wheel, correctly applies the transform 56 | void ApplyLocalPositionToVisuals(WheelCollider collider) 57 | { 58 | if (collider.transform.childCount == 0) 59 | { 60 | return; 61 | } 62 | 63 | Transform visualWheel = collider.transform.GetChild(0); 64 | 65 | Vector3 position; 66 | Quaternion rotation; 67 | collider.GetWorldPose(out position, out rotation); 68 | 69 | visualWheel.transform.position = position; 70 | visualWheel.transform.rotation = rotation; 71 | } 72 | 73 | 74 | 75 | void Update() 76 | { 77 | //So we can experiment with the position where the car is checking if it should steer left/right 78 | //doesn't have to be where the wheels are - especially if we are reversing 79 | steerPosition = transform.position + transform.forward * centerSteerDifference; 80 | } 81 | 82 | 83 | 84 | void FixedUpdate() 85 | { 86 | //Manual controls for debugging 87 | //float motor = maxMotorTorque * Input.GetAxis("Vertical"); 88 | //float steeringAngle = maxSteeringAngle * Input.GetAxis("Horizontal"); 89 | 90 | 91 | //Automatic controls 92 | //float motorTorque = 0f; 93 | 94 | //if (carMode == CarModes.Forward) 95 | //{ 96 | // motorTorque = currentMotorTorque; 97 | //} 98 | //else if (carMode == CarModes.Reverse) 99 | //{ 100 | // motorTorque = -currentMotorTorque; 101 | //} 102 | 103 | float motorTorque = currentMotorTorque; 104 | 105 | float steeringAngle = 0f; 106 | 107 | //This is a value between -1 and 1, where -1 is left 108 | //float steeringFactor = Input.GetAxis("Horizontal"); 109 | 110 | ////Now we need to change the motor torque on the wheels depending on if we are steering left or right 111 | //float leftMotorTorque = motorTorque; 112 | //float rightMotorTorque = motorTorque; 113 | 114 | ////Steer left = more power to the right wheel 115 | //if (steeringFactor < 0f) 116 | //{ 117 | // leftMotorTorque = motorTorque * (1f - Mathf.Abs(steeringFactor)) * -1f; 118 | //} 119 | //else if (steeringFactor > 0f) 120 | //{ 121 | // rightMotorTorque = motorTorque * (1f - Mathf.Abs(steeringFactor)) * -1f; 122 | //} 123 | 124 | //print(rightMotorTorque); 125 | 126 | 127 | //Limit speed 128 | 129 | //Get the speed in km/h 130 | float speed = transform.GetComponent().velocity.magnitude * 3.600f; 131 | 132 | //print(speed); 133 | 134 | if (transform.GetComponent().velocity.magnitude * 3.600f > 40f) 135 | { 136 | motorTorque *= 0.6f; 137 | } 138 | 139 | //Apply everything to the car 140 | foreach (AxleInfo axleInfo in axleInfos) 141 | { 142 | if (axleInfo.steering) 143 | { 144 | axleInfo.leftWheel.steerAngle = steeringAngle; 145 | axleInfo.rightWheel.steerAngle = steeringAngle; 146 | } 147 | if (axleInfo.motor) 148 | { 149 | axleInfo.leftWheel.motorTorque = motorTorque; 150 | axleInfo.rightWheel.motorTorque = motorTorque; 151 | } 152 | 153 | ApplyLocalPositionToVisuals(axleInfo.leftWheel); 154 | ApplyLocalPositionToVisuals(axleInfo.rightWheel); 155 | } 156 | } 157 | 158 | 159 | //Get Set motorTorque 160 | public float MotorTorque 161 | { 162 | get { return this.maxMotorTorque; } 163 | 164 | set { this.currentMotorTorque = value; } 165 | } 166 | } 167 | 168 | -------------------------------------------------------------------------------- /Assets/Editor/CrossPlatformInput/CrossPlatformInputInitialize.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | 5 | namespace UnityStandardAssets.CrossPlatformInput.Inspector 6 | { 7 | [InitializeOnLoad] 8 | public class CrossPlatformInitialize 9 | { 10 | // Custom compiler defines: 11 | // 12 | // CROSS_PLATFORM_INPUT : denotes that cross platform input package exists, so that other packages can use their CrossPlatformInput functions. 13 | // EDITOR_MOBILE_INPUT : denotes that mobile input should be used in editor, if a mobile build target is selected. (i.e. using Unity Remote app). 14 | // MOBILE_INPUT : denotes that mobile input should be used right now! 15 | 16 | static CrossPlatformInitialize() 17 | { 18 | var defines = GetDefinesList(buildTargetGroups[0]); 19 | if (!defines.Contains("CROSS_PLATFORM_INPUT")) 20 | { 21 | SetEnabled("CROSS_PLATFORM_INPUT", true, false); 22 | SetEnabled("MOBILE_INPUT", true, true); 23 | } 24 | } 25 | 26 | 27 | [MenuItem("Mobile Input/Enable")] 28 | private static void Enable() 29 | { 30 | SetEnabled("MOBILE_INPUT", true, true); 31 | switch (EditorUserBuildSettings.activeBuildTarget) 32 | { 33 | case BuildTarget.Android: 34 | case BuildTarget.iOS: 35 | case BuildTarget.PSM: 36 | case BuildTarget.Tizen: 37 | case BuildTarget.WSAPlayer: 38 | EditorUtility.DisplayDialog("Mobile Input", 39 | "You have enabled Mobile Input. You'll need to use the Unity Remote app on a connected device to control your game in the Editor.", 40 | "OK"); 41 | break; 42 | 43 | default: 44 | EditorUtility.DisplayDialog("Mobile Input", 45 | "You have enabled Mobile Input, but you have a non-mobile build target selected in your build settings. The mobile control rigs won't be active or visible on-screen until you switch the build target to a mobile platform.", 46 | "OK"); 47 | break; 48 | } 49 | } 50 | 51 | 52 | [MenuItem("Mobile Input/Enable", true)] 53 | private static bool EnableValidate() 54 | { 55 | var defines = GetDefinesList(mobileBuildTargetGroups[0]); 56 | return !defines.Contains("MOBILE_INPUT"); 57 | } 58 | 59 | 60 | [MenuItem("Mobile Input/Disable")] 61 | private static void Disable() 62 | { 63 | SetEnabled("MOBILE_INPUT", false, true); 64 | switch (EditorUserBuildSettings.activeBuildTarget) 65 | { 66 | case BuildTarget.Android: 67 | case BuildTarget.iOS: 68 | EditorUtility.DisplayDialog("Mobile Input", 69 | "You have disabled Mobile Input. Mobile control rigs won't be visible, and the Cross Platform Input functions will always return standalone controls.", 70 | "OK"); 71 | break; 72 | } 73 | } 74 | 75 | 76 | [MenuItem("Mobile Input/Disable", true)] 77 | private static bool DisableValidate() 78 | { 79 | var defines = GetDefinesList(mobileBuildTargetGroups[0]); 80 | return defines.Contains("MOBILE_INPUT"); 81 | } 82 | 83 | 84 | private static BuildTargetGroup[] buildTargetGroups = new BuildTargetGroup[] 85 | { 86 | BuildTargetGroup.Standalone, 87 | BuildTargetGroup.Android, 88 | BuildTargetGroup.iOS, 89 | BuildTargetGroup.WSA 90 | }; 91 | 92 | private static BuildTargetGroup[] mobileBuildTargetGroups = new BuildTargetGroup[] 93 | { 94 | BuildTargetGroup.Android, 95 | BuildTargetGroup.iOS, 96 | BuildTargetGroup.PSM, 97 | BuildTargetGroup.SamsungTV, 98 | BuildTargetGroup.Tizen, 99 | BuildTargetGroup.WSA 100 | }; 101 | 102 | 103 | private static void SetEnabled(string defineName, bool enable, bool mobile) 104 | { 105 | //Debug.Log("setting "+defineName+" to "+enable); 106 | foreach (var group in mobile ? mobileBuildTargetGroups : buildTargetGroups) 107 | { 108 | var defines = GetDefinesList(group); 109 | if (enable) 110 | { 111 | if (defines.Contains(defineName)) 112 | { 113 | return; 114 | } 115 | defines.Add(defineName); 116 | } 117 | else 118 | { 119 | if (!defines.Contains(defineName)) 120 | { 121 | return; 122 | } 123 | while (defines.Contains(defineName)) 124 | { 125 | defines.Remove(defineName); 126 | } 127 | } 128 | string definesString = string.Join(";", defines.ToArray()); 129 | PlayerSettings.SetScriptingDefineSymbolsForGroup(group, definesString); 130 | } 131 | } 132 | 133 | 134 | private static List GetDefinesList(BuildTargetGroup group) 135 | { 136 | return new List(PlayerSettings.GetScriptingDefineSymbolsForGroup(group).Split(';')); 137 | } 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /Assets/_Robot arm/Scripts/RobotController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class RobotController : MonoBehaviour 6 | { 7 | //All joints belong to this robot 8 | public Transform[] jointTrans; 9 | 10 | //The tip of the robot 11 | public Transform robotTip; 12 | 13 | //The target the tip of the robot arm is trying to reach 14 | public Transform targetTrans; 15 | 16 | //A help array with all joint scripts to speed up the gradient calculations 17 | private RobotJoint[] joints; 18 | 19 | 20 | 21 | void Start() 22 | { 23 | joints = new RobotJoint[jointTrans.Length]; 24 | 25 | for (int i = 0; i < jointTrans.Length; i++) 26 | { 27 | joints[i] = jointTrans[i].GetComponent(); 28 | } 29 | } 30 | 31 | 32 | 33 | void Update() 34 | { 35 | //Move the robot to the wanted position 36 | //Alternative 1 - check if each joint should move "left/right to reach a waypoint" - start with the joint 37 | //furthest away 38 | //Alternative 2 - Gradient descent 39 | //Alternative 3 - move each joint with transform.LookAt() 40 | MoveRobotGradientDescent(); 41 | 42 | //Debug 43 | //DebugCalculateTipPosition(); 44 | } 45 | 46 | 47 | 48 | //Move the robot arm to a desired position with gradient descent 49 | private void MoveRobotGradientDescent() 50 | { 51 | float[] angles = GetLocalAngles(); 52 | 53 | //The distance to the wanted pos 54 | float distance = CalculateDistance(angles); 55 | 56 | //Main loop 57 | float[] gradients = new float[jointTrans.Length]; 58 | 59 | //To avoid ending up in infinite loop if we never reaches the min error because the robot is too far away 60 | int iterations = 0; 61 | 62 | float learningRate = 0.5f; 63 | 64 | while (distance > 0.001f && iterations < 200) 65 | { 66 | iterations += 1; 67 | 68 | //Calculate the gradients with central difference derivation 69 | float delta = 0.01f; 70 | 71 | for (int i = 0; i < gradients.Length; i++) 72 | { 73 | float startAngle = angles[i]; 74 | 75 | angles[i] = startAngle + delta; 76 | 77 | float gradientPositive = CalculateDistance(angles); 78 | 79 | angles[i] = startAngle - delta; 80 | 81 | float gradientNegative = CalculateDistance(angles); 82 | 83 | gradients[i] = (gradientPositive - gradientNegative) / (2f * delta); 84 | 85 | angles[i] = startAngle; 86 | } 87 | 88 | 89 | //Change the angle based on the gradients 90 | for (int i = 0; i < angles.Length; i++) 91 | { 92 | angles[i] -= learningRate * gradients[i]; 93 | } 94 | 95 | 96 | //Calculate the new distance 97 | float newDistance = CalculateDistance(angles); 98 | 99 | //Change learning rate if we improved 100 | if (newDistance < distance) 101 | { 102 | learningRate *= 1.05f; 103 | } 104 | else 105 | { 106 | learningRate = 1.0f; 107 | } 108 | 109 | distance = newDistance; 110 | } 111 | 112 | if (iterations == 200) 113 | { 114 | //print(iterations); 115 | } 116 | 117 | //Add the new angles to the robot 118 | for (int i = 0; i < angles.Length; i++) 119 | { 120 | joints[i].AddRotationAngle(angles[i]); 121 | } 122 | } 123 | 124 | 125 | 126 | //Calculate the distance from the tip to the target - this is the cost function we want to minimize 127 | //angles[] is local rotation 128 | private float CalculateDistance(float[] angles) 129 | { 130 | float distance = (targetTrans.position - CalculateTipPosition(angles)).magnitude; 131 | 132 | return distance; 133 | } 134 | 135 | 136 | 137 | //Returns the position of the end effector in global coordinates given an array of angles 138 | //where each angle is the angle a joint has 139 | //Is used so we dont have to move the "physical" robot to test a new set of angles 140 | private Vector3 CalculateTipPosition(float[] angles) 141 | { 142 | Vector3 prevPoint = joints[0].transform.position; 143 | Quaternion rotation = Quaternion.identity; 144 | 145 | for (int i = 1; i < joints.Length; i++) 146 | { 147 | //Rotates around a new axis 148 | //Multiplying two quaternions creates a new quaternion, which incorporates both rotations. 149 | //During each iteration of the for loop, the variable rotation is multiplied by the current quaternion. 150 | //This means that it incorporate the rotations for all the joints. 151 | rotation *= Quaternion.AngleAxis(angles[i - 1], joints[i - 1].rotationAxis); 152 | Vector3 nextPoint = prevPoint + rotation * joints[i].startOffset; 153 | 154 | prevPoint = nextPoint; 155 | } 156 | 157 | 158 | //The tip which is never rotating 159 | prevPoint = prevPoint + rotation * robotTip.localPosition; 160 | 161 | return prevPoint; 162 | } 163 | 164 | 165 | 166 | //Display the tip of the robot with a ray 167 | private void DebugCalculateTipPosition() 168 | { 169 | float[] angles = GetLocalAngles(); 170 | 171 | Vector3 tipPos = CalculateTipPosition(angles); 172 | 173 | Debug.DrawRay(tipPos, Vector3.up); 174 | } 175 | 176 | 177 | 178 | //Add all local joint angles to an array 179 | private float[] GetLocalAngles() 180 | { 181 | float[] angles = new float[jointTrans.Length]; 182 | 183 | for (int i = 0; i < jointTrans.Length; i++) 184 | { 185 | angles[i] = joints[i].GetRotationAngle(); 186 | } 187 | 188 | return angles; 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /Assets/Models/t_ford.blend.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: adbddf80d01620b42ab1f908b7e18d8a 3 | ModelImporter: 4 | serializedVersion: 23 5 | fileIDToRecycleName: 6 | 100000: Bounding_box 7 | 100002: Circle 8 | 100004: Circle_001 9 | 100006: Circle_002 10 | 100008: Circle_003 11 | 100010: Front_lamp 12 | 100012: Grill_ventil 13 | 100014: Hull 14 | 100016: Rear_lamp 15 | 100018: Seat 16 | 100020: //RootNode 17 | 100022: Top_cover 18 | 100024: Bounding box 19 | 100026: Circle.001 20 | 100028: Circle.002 21 | 100030: Circle.003 22 | 100032: Front lamp 23 | 100034: Grill ventil 24 | 100036: Rear lamp 25 | 100038: Top cover 26 | 400000: Bounding_box 27 | 400002: Circle 28 | 400004: Circle_001 29 | 400006: Circle_002 30 | 400008: Circle_003 31 | 400010: Front_lamp 32 | 400012: Grill_ventil 33 | 400014: Hull 34 | 400016: Rear_lamp 35 | 400018: Seat 36 | 400020: //RootNode 37 | 400022: Top_cover 38 | 400024: Bounding box 39 | 400026: Circle.001 40 | 400028: Circle.002 41 | 400030: Circle.003 42 | 400032: Front lamp 43 | 400034: Grill ventil 44 | 400036: Rear lamp 45 | 400038: Top cover 46 | 2300000: Bounding_box 47 | 2300002: Circle 48 | 2300004: Circle_001 49 | 2300006: Circle_002 50 | 2300008: Circle_003 51 | 2300010: Front_lamp 52 | 2300012: Grill_ventil 53 | 2300014: Hull 54 | 2300016: Rear_lamp 55 | 2300018: Seat 56 | 2300020: Top_cover 57 | 2300022: Bounding box 58 | 2300024: Circle.001 59 | 2300026: Circle.002 60 | 2300028: Circle.003 61 | 2300030: Front lamp 62 | 2300032: Grill ventil 63 | 2300034: Rear lamp 64 | 2300036: Top cover 65 | 3300000: Bounding_box 66 | 3300002: Circle 67 | 3300004: Circle_001 68 | 3300006: Circle_002 69 | 3300008: Circle_003 70 | 3300010: Front_lamp 71 | 3300012: Grill_ventil 72 | 3300014: Hull 73 | 3300016: Rear_lamp 74 | 3300018: Seat 75 | 3300020: Top_cover 76 | 3300022: Bounding box 77 | 3300024: Circle.001 78 | 3300026: Circle.002 79 | 3300028: Circle.003 80 | 3300030: Front lamp 81 | 3300032: Grill ventil 82 | 3300034: Rear lamp 83 | 3300036: Top cover 84 | 4300000: Circle_003 85 | 4300002: Circle_002 86 | 4300004: Circle_001 87 | 4300006: Circle 88 | 4300008: Rear_lamp 89 | 4300010: Grill_ventil 90 | 4300012: Front_lamp 91 | 4300014: Top_cover 92 | 4300016: Seat 93 | 4300018: Hull 94 | 4300020: Bounding_box 95 | 4300022: Circle.003 96 | 4300024: Circle.002 97 | 4300026: Circle.001 98 | 4300028: Rear lamp 99 | 4300030: Grill ventil 100 | 4300032: Front lamp 101 | 4300034: Top cover 102 | 4300036: Bounding box 103 | 7400000: Default Take 104 | 9500000: //RootNode 105 | externalObjects: 106 | - first: 107 | type: UnityEngine:Material 108 | assembly: UnityEngine.CoreModule 109 | name: Car paint 110 | second: {fileID: 2100000, guid: 3fb1333a806081942b8a4d28241630c5, type: 2} 111 | - first: 112 | type: UnityEngine:Material 113 | assembly: UnityEngine.CoreModule 114 | name: Cover 115 | second: {fileID: 2100000, guid: 57d3bdb7b8834504486649c4630b0511, type: 2} 116 | - first: 117 | type: UnityEngine:Material 118 | assembly: UnityEngine.CoreModule 119 | name: Falg 120 | second: {fileID: 2100000, guid: ac13084c99585684a81b8fb0be721fa1, type: 2} 121 | - first: 122 | type: UnityEngine:Material 123 | assembly: UnityEngine.CoreModule 124 | name: Gold 125 | second: {fileID: 2100000, guid: f9e1e89e11866e245a23176a01e6598a, type: 2} 126 | - first: 127 | type: UnityEngine:Material 128 | assembly: UnityEngine.CoreModule 129 | name: Grill 130 | second: {fileID: 2100000, guid: 661f9fdb9e4ffbb4cbb48ab9e6a5eaa7, type: 2} 131 | - first: 132 | type: UnityEngine:Material 133 | assembly: UnityEngine.CoreModule 134 | name: Lamp front 135 | second: {fileID: 2100000, guid: 9e85080fd025c414bab68a5f66064981, type: 2} 136 | - first: 137 | type: UnityEngine:Material 138 | assembly: UnityEngine.CoreModule 139 | name: Material 140 | second: {fileID: 2100000, guid: 3506137a1ff71864991ca60b4b1c5752, type: 2} 141 | - first: 142 | type: UnityEngine:Material 143 | assembly: UnityEngine.CoreModule 144 | name: Seat 145 | second: {fileID: 2100000, guid: ff41a6854075d4342a49a370074b450d, type: 2} 146 | - first: 147 | type: UnityEngine:Material 148 | assembly: UnityEngine.CoreModule 149 | name: Tyre 150 | second: {fileID: 2100000, guid: a0b0901a25f0dde4c867e18edb4ab717, type: 2} 151 | - first: 152 | type: UnityEngine:Material 153 | assembly: UnityEngine.CoreModule 154 | name: Window 155 | second: {fileID: 2100000, guid: 433625e195a8871409c61c569c27ba0e, type: 2} 156 | materials: 157 | importMaterials: 1 158 | materialName: 0 159 | materialSearch: 1 160 | materialLocation: 0 161 | animations: 162 | legacyGenerateAnimations: 4 163 | bakeSimulation: 0 164 | resampleCurves: 1 165 | optimizeGameObjects: 0 166 | motionNodeName: 167 | rigImportErrors: 168 | rigImportWarnings: 169 | animationImportErrors: 170 | animationImportWarnings: 171 | animationRetargetingWarnings: 172 | animationDoRetargetingWarnings: 0 173 | importAnimatedCustomProperties: 0 174 | importConstraints: 0 175 | animationCompression: 1 176 | animationRotationError: 0.5 177 | animationPositionError: 0.5 178 | animationScaleError: 0.5 179 | animationWrapMode: 0 180 | extraExposedTransformPaths: [] 181 | extraUserProperties: [] 182 | clipAnimations: [] 183 | isReadable: 1 184 | meshes: 185 | lODScreenPercentages: [] 186 | globalScale: 1 187 | meshCompression: 0 188 | addColliders: 0 189 | useSRGBMaterialColor: 1 190 | importVisibility: 0 191 | importBlendShapes: 1 192 | importCameras: 0 193 | importLights: 0 194 | swapUVChannels: 0 195 | generateSecondaryUV: 0 196 | useFileUnits: 1 197 | optimizeMeshForGPU: 1 198 | keepQuads: 0 199 | weldVertices: 1 200 | preserveHierarchy: 0 201 | indexFormat: 1 202 | secondaryUVAngleDistortion: 8 203 | secondaryUVAreaDistortion: 15.000001 204 | secondaryUVHardAngle: 88 205 | secondaryUVPackMargin: 4 206 | useFileScale: 1 207 | previousCalculatedGlobalScale: 1 208 | hasPreviousCalculatedGlobalScale: 1 209 | tangentSpace: 210 | normalSmoothAngle: 60 211 | normalImportMode: 0 212 | tangentImportMode: 3 213 | normalCalculationMode: 0 214 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1 215 | blendShapeNormalImportMode: 1 216 | normalSmoothingSource: 0 217 | importAnimation: 1 218 | copyAvatar: 0 219 | humanDescription: 220 | serializedVersion: 2 221 | human: [] 222 | skeleton: [] 223 | armTwist: 0.5 224 | foreArmTwist: 0.5 225 | upperLegTwist: 0.5 226 | legTwist: 0.5 227 | armStretch: 0.05 228 | legStretch: 0.05 229 | feetSpacing: 0 230 | rootMotionBoneName: 231 | hasTranslationDoF: 0 232 | hasExtraRoot: 0 233 | skeletonHasParents: 0 234 | lastHumanDescriptionAvatarSource: {instanceID: 0} 235 | animationType: 2 236 | humanoidOversampling: 1 237 | additionalBone: 0 238 | userData: 239 | assetBundleName: 240 | assetBundleVariant: 241 | -------------------------------------------------------------------------------- /Assets/_Rotating Arm/Scripts/PropellerController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class PropellerController : MonoBehaviour 5 | { 6 | //The propeller obj 7 | public Transform propellerTrans; 8 | //Propeller force 9 | public float maxPropellerForce; 10 | //PID controller parameters 11 | public float Kp; 12 | public float Ki; 13 | public float Kd; 14 | //Sometimes you should limit the sum in I 15 | public float maxSum; 16 | 17 | //PID private variables 18 | private float errorSum = 0f; 19 | private float lastError = 0f; 20 | //To get the error before the lastError 21 | private float lastError2 = 0f; 22 | 23 | //The hinge joint so we can measure the angle 24 | //Cant use the arms rotation because of strange angles 25 | HingeJoint armHinge; 26 | 27 | //The rigid body attached to the arm 28 | private Rigidbody armRB; 29 | 30 | //The angle we want the arm to be at 31 | private float wantedAngle = 0f; 32 | 33 | //The propeller rotation script so we can stop the propeller 34 | private RotatePropeller rotatePropellerScript; 35 | 36 | 37 | void Start() 38 | { 39 | //The arm is the parent to the propeller 40 | Transform armTrans = propellerTrans.parent; 41 | 42 | //The rb is attached to the arm 43 | armRB = armTrans.GetComponent(); 44 | 45 | //The hinge 46 | armHinge = armTrans.GetComponent(); 47 | 48 | rotatePropellerScript = propellerTrans.GetComponent(); 49 | } 50 | 51 | 52 | 53 | void FixedUpdate() 54 | { 55 | AddForceToPropeller(); 56 | } 57 | 58 | 59 | 60 | //Add a force to the propeller 61 | void AddForceToPropeller() 62 | { 63 | //To control we need an error. We could use height, whoch is easy to get with an Altimeter, 64 | //but we are going to use the angle 65 | 66 | //What's the error to the wanted angle, this is what we want to minimize 67 | float error = wantedAngle - armHinge.angle; 68 | 69 | //print(error); 70 | 71 | //float propellerForce = GetForceNaive(error); 72 | //float propellerForce = GetForceProportional(error); 73 | float propellerForce = GetForcePID(error); 74 | 75 | //Give the propeller an up force like a real propeller 76 | armRB.AddForceAtPosition(propellerTrans.up * propellerForce, propellerTrans.position); 77 | 78 | //Add a torque - doesnt matter where we add the torque, so no need to add it at a position 79 | //armRB.AddTorque(); 80 | 81 | //Test that we are applying the force in the correct direction 82 | //Debug.DrawRay(propellerTrans.position, propellerTrans.up * 2f, Color.red); 83 | } 84 | 85 | 86 | 87 | //Method 1 - Naive where we start the propeller if the arm is below 88 | private float GetForceNaive(float error) 89 | { 90 | float propellerForce = 0f; 91 | 92 | //Negative if above, so no propeller force needed 93 | //Positive if below, so propeller force needed 94 | //Also not needed to add force when angle is > 90 because gravity will move 95 | //the arm down in that case, or the entire arm will move round-round if not using this parameter 96 | if (error > 0f && error < 90f) 97 | { 98 | propellerForce = maxPropellerForce; 99 | 100 | //Start the propeller 101 | rotatePropellerScript.shouldRotate = true; 102 | } 103 | else 104 | { 105 | //Stop the propeller 106 | rotatePropellerScript.shouldRotate = false; 107 | } 108 | 109 | return propellerForce; 110 | } 111 | 112 | 113 | 114 | //Method 2 - Proportional controller 115 | private float GetForceProportional(float error) 116 | { 117 | float propellerForce = 0f; 118 | 119 | //Negative if above, so no propeller force needed 120 | //Positive if below, so propeller force needed 121 | //Also not needed to add force when angle is > 90 because gravity will move 122 | //the arm down in that case, or the entire arm will move round-round if not using this parameter 123 | if (error > 0f && error < 90f) 124 | { 125 | //The motor can be adjusted so we don't have to always give it a max force 126 | //Also limit it so we dont give the propeller more than it can take 127 | propellerForce = Mathf.Min(Mathf.Max(Kp * Mathf.Abs(error) * maxPropellerForce, 0f), maxPropellerForce); 128 | 129 | //Start the propeller 130 | rotatePropellerScript.shouldRotate = true; 131 | } 132 | else 133 | { 134 | //Stop the propeller 135 | rotatePropellerScript.shouldRotate = false; 136 | } 137 | 138 | return propellerForce; 139 | } 140 | 141 | 142 | 143 | //Method 3 - PID controller 144 | private float GetForcePID(float error) 145 | { 146 | float propellerForce = 0f; 147 | 148 | float pidController = 0f; 149 | 150 | float t = Time.fixedDeltaTime; 151 | 152 | //P 153 | pidController += Kp * error; 154 | 155 | //I 156 | errorSum += t * error; 157 | 158 | //Sometimes you should clamp the sum to limit it 159 | errorSum = Mathf.Clamp(errorSum, -maxSum, maxSum); 160 | 161 | //Or take the sum of the last updates 162 | //float averageAmount = 20f; 163 | 164 | //errorSum = errorSum + (((t * error) - errorSum) / maxSum); 165 | 166 | pidController += Ki * errorSum; 167 | 168 | //D 169 | float deltaError = (error - lastError2) / t; 170 | 171 | //Will make it more robust to noise 172 | lastError2 = lastError; 173 | 174 | lastError = error; 175 | 176 | pidController += Kd * deltaError; 177 | 178 | //print(pidController); 179 | 180 | //The motor can be adjusted so we don't have to always give it a max force 181 | //The force cant be negative 182 | //Also limit it so we dont give the propeller more than it can take 183 | propellerForce = Mathf.Min(Mathf.Max(pidController, 0f), maxPropellerForce); 184 | 185 | //Start the propeller 186 | rotatePropellerScript.shouldRotate = true; 187 | 188 | if (propellerForce <= 0f) 189 | { 190 | //Stop the propeller 191 | rotatePropellerScript.shouldRotate = false; 192 | } 193 | 194 | 195 | ////Negative if above, so no propeller force needed 196 | ////Positive if below, so propeller force needed 197 | ////Also not needed to add force when angle is > 90 because gravity will move 198 | ////the arm down in that case, or the entire arm will move round-round if not using this parameter 199 | //if (error > 0f && error < 90f) 200 | //{ 201 | // //The motor can be adjusted so we don't have to always give it a max force 202 | // //The force cant be negative 203 | // //Also limit it so we dont give the propeller more than it can take 204 | // propellerForce = Mathf.Min(Mathf.Max(pidController * maxPropellerForce, 0f), maxPropellerForce); 205 | 206 | // //Start the propeller 207 | // rotatePropellerScript.shouldRotate = true; 208 | //} 209 | //else 210 | //{ 211 | // //Stop the propeller 212 | // rotatePropellerScript.shouldRotate = false; 213 | //} 214 | 215 | return propellerForce; 216 | } 217 | } 218 | -------------------------------------------------------------------------------- /Assets/_Car Follow Path/Scripts/CarController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | //Modified basic car controller from Unity 6 | //https://docs.unity3d.com/Manual/WheelColliderTutorial.html 7 | 8 | [System.Serializable] 9 | public class AxleInfo 10 | { 11 | public WheelCollider leftWheel; 12 | public WheelCollider rightWheel; 13 | public bool motor; 14 | public bool steering; 15 | } 16 | 17 | public class CarController : MonoBehaviour 18 | { 19 | public List axleInfos; 20 | 21 | //Car data 22 | float maxMotorTorque = 3000f; 23 | float maxSteeringAngle = 40f; 24 | 25 | //To get a more realistic behavior 26 | public Vector3 centerOfMassChange; 27 | 28 | //The difference between the center of the car and the position where we steer 29 | public float centerSteerDifference; 30 | //The position where the car is steering 31 | private Vector3 steerPosition; 32 | 33 | //PID parameters 34 | public float gain_P = 0f; 35 | public float gain_I = 0f; 36 | public float gain_D = 0f; 37 | //Sometimes you have to limit the total sum of all errors used in the I 38 | //public float error_sumMax = 20f; 39 | 40 | //All waypoints 41 | public List allWaypoints; 42 | //The current index of the list with all waypoints 43 | private int currentWaypointIndex = 0; 44 | //The waypoint we are going towards and the waypoint we are going from 45 | private Vector3 currentWaypoint; 46 | private Vector3 previousWaypoint; 47 | 48 | //Average the steering angles to simulate the time it takes to turn the wheel 49 | float averageSteeringAngle = 0f; 50 | 51 | PIDController PIDControllerScript; 52 | 53 | 54 | 55 | void Start() 56 | { 57 | //Move the center of mass 58 | transform.GetComponent().centerOfMass = transform.GetComponent().centerOfMass + centerOfMassChange; 59 | 60 | //Init the waypoints 61 | currentWaypoint = allWaypoints[currentWaypointIndex].position; 62 | 63 | previousWaypoint = GetPreviousWaypoint(); 64 | 65 | PIDControllerScript = new PIDController(); 66 | } 67 | 68 | 69 | 70 | //Finds the corresponding visual wheel, correctly applies the transform 71 | void ApplyLocalPositionToVisuals(WheelCollider collider) 72 | { 73 | if (collider.transform.childCount == 0) 74 | { 75 | return; 76 | } 77 | 78 | Transform visualWheel = collider.transform.GetChild(0); 79 | 80 | Vector3 position; 81 | Quaternion rotation; 82 | collider.GetWorldPose(out position, out rotation); 83 | 84 | visualWheel.transform.position = position; 85 | visualWheel.transform.rotation = rotation; 86 | } 87 | 88 | 89 | 90 | void Update() 91 | { 92 | //So we can experiment with the position where the car is checking if it should steer left/right 93 | //doesn't have to be where the wheels are - especially if we are reversing 94 | steerPosition = transform.position + transform.forward * centerSteerDifference; 95 | 96 | //Check if we should change waypoint 97 | if (Math.HasPassedWaypoint(steerPosition, previousWaypoint, currentWaypoint)) 98 | { 99 | currentWaypointIndex += 1; 100 | 101 | if (currentWaypointIndex == allWaypoints.Count) 102 | { 103 | currentWaypointIndex = 0; 104 | } 105 | 106 | currentWaypoint = allWaypoints[currentWaypointIndex].position; 107 | 108 | previousWaypoint = GetPreviousWaypoint(); 109 | } 110 | } 111 | 112 | 113 | 114 | //Get the waypoint before the current waypoint we are driving towards 115 | Vector3 GetPreviousWaypoint() 116 | { 117 | previousWaypoint = Vector3.zero; 118 | 119 | if (currentWaypointIndex - 1 < 0) 120 | { 121 | previousWaypoint = allWaypoints[allWaypoints.Count - 1].position; 122 | } 123 | else 124 | { 125 | previousWaypoint = allWaypoints[currentWaypointIndex - 1].position; 126 | } 127 | 128 | return previousWaypoint; 129 | } 130 | 131 | 132 | 133 | void FixedUpdate() 134 | { 135 | float motor = maxMotorTorque; 136 | 137 | //Manual controls for debugging 138 | //float motor = maxMotorTorque * Input.GetAxis("Vertical"); 139 | //float steering = maxSteeringAngle * Input.GetAxis("Horizontal"); 140 | 141 | // 142 | //Calculate the steering angle 143 | // 144 | //The simple but less accurate way -> will produce drunk behavior 145 | //float steeringAngle = maxSteeringAngle * Math.SteerDirection(transform, steerPosition, currentWaypoint); 146 | 147 | //Get the cross track error, which is what we want to minimize with the pid controller 148 | float CTE = Math.GetCrossTrackError(steerPosition, previousWaypoint, currentWaypoint); 149 | 150 | //Test to minimize the angle between the car and previous wp and the previous wp and upcoming wp 151 | //float CTE = Vector3.Angle((steerPosition - previousWaypoint).normalized, (currentWaypoint - previousWaypoint).normalized); 152 | 153 | //But we still need a direction to steer 154 | CTE *= Math.SteerDirection(transform, steerPosition, currentWaypoint); 155 | 156 | //The self driving car Stanley is using an equation to determine the steering angle without a PID controller 157 | //steeringAngle = psi + arctan((k * CTE) / velocity) 158 | //psi - the angle between the car and the path 159 | //k - parameter 160 | 161 | float steeringAngle = PIDControllerScript.GetFactorFromPIDController(gain_P, gain_I, gain_D, CTE); 162 | 163 | //Limit the steering angle 164 | steeringAngle = Mathf.Clamp(steeringAngle, -maxSteeringAngle, maxSteeringAngle); 165 | 166 | 167 | //The angle between the car and previous wp and the previous wp and upcoming wp 168 | //float angle = Vector3.Angle((steerPosition - previousWaypoint).normalized, (currentWaypoint - previousWaypoint).normalized); 169 | 170 | ////If we are close to the ideal path, then we should limit the steering angle 171 | //if (angle < 10f) 172 | //{ 173 | // if (steeringAngle < 0f) 174 | // { 175 | // steeringAngle = -angle; 176 | // } 177 | // else 178 | // { 179 | // steeringAngle = angle; 180 | // } 181 | //} 182 | ////Steer as much as possible 183 | //else 184 | //{ 185 | // steeringAngle = Mathf.Clamp(steeringAngle, -maxSteeringAngle, maxSteeringAngle); 186 | //} 187 | 188 | //Average the steering angles to simulate the time it takes to turn the steering wheel 189 | float averageAmount = 10f; 190 | 191 | averageSteeringAngle = averageSteeringAngle + ((steeringAngle - averageSteeringAngle) / averageAmount); 192 | 193 | 194 | // 195 | //Apply everything to the car 196 | // 197 | foreach (AxleInfo axleInfo in axleInfos) 198 | { 199 | if (axleInfo.steering) 200 | { 201 | axleInfo.leftWheel.steerAngle = averageSteeringAngle; 202 | axleInfo.rightWheel.steerAngle = averageSteeringAngle; 203 | } 204 | if (axleInfo.motor) 205 | { 206 | axleInfo.leftWheel.motorTorque = motor; 207 | axleInfo.rightWheel.motorTorque = motor; 208 | } 209 | 210 | ApplyLocalPositionToVisuals(axleInfo.leftWheel); 211 | ApplyLocalPositionToVisuals(axleInfo.rightWheel); 212 | } 213 | } 214 | } 215 | --------------------------------------------------------------------------------