├── Assets ├── DialoguePanel.controller ├── DialoguePanel.controller.meta ├── JJIS.meta ├── JJIS │ ├── Dialogue Materials.meta │ ├── Dialogue Materials │ │ ├── DialogueBox 1.psd │ │ ├── DialogueBox 1.psd.meta │ │ ├── DialogueBox.mat │ │ ├── DialogueBox.mat.meta │ │ ├── DialogueBox.psd │ │ ├── DialogueBox.psd.meta │ │ ├── Floor.mat │ │ └── Floor.mat.meta │ ├── Editor.meta │ ├── Editor │ │ ├── InspectMenuInstancer.cs │ │ └── InspectMenuInstancer.cs.meta │ ├── Inspect_Assets.meta │ ├── Inspect_Assets │ │ ├── SampleInspectObject.asset │ │ └── SampleInspectObject.asset.meta │ ├── Scripts.meta │ ├── Scripts │ │ ├── BasicInspect.cs │ │ ├── BasicInspect.cs.meta │ │ ├── InspectObject.cs │ │ ├── InspectObject.cs.meta │ │ ├── InspectRayCast.cs │ │ └── InspectRayCast.cs.meta │ ├── Test.meta │ └── Test │ │ ├── Imports.meta │ │ ├── Imports │ │ ├── Materials.meta │ │ ├── Materials │ │ │ ├── SignPost_Bot.mat │ │ │ ├── SignPost_Bot.mat.meta │ │ │ ├── SignPost_Inner.mat │ │ │ ├── SignPost_Inner.mat.meta │ │ │ ├── SignPost_Outter.mat │ │ │ └── SignPost_Outter.mat.meta │ │ ├── Sign.fbx │ │ └── Sign.fbx.meta │ │ ├── SFX.wav │ │ ├── SFX.wav.meta │ │ ├── Signpost.prefab │ │ ├── Signpost.prefab.meta │ │ ├── TESTEVENT.cs │ │ └── TESTEVENT.cs.meta ├── Main.asset ├── Main.asset.meta ├── Main.unity ├── Main.unity.meta ├── Plugins.meta ├── Standard Assets.meta ├── Standard Assets │ ├── Cameras.meta │ ├── Characters.meta │ ├── Characters │ │ ├── FirstPersonCharacter.meta │ │ └── FirstPersonCharacter │ │ │ ├── Audio.meta │ │ │ ├── Audio │ │ │ ├── Footstep01.wav │ │ │ ├── Footstep01.wav.meta │ │ │ ├── Footstep02.wav │ │ │ ├── Footstep02.wav.meta │ │ │ ├── Footstep03.wav │ │ │ ├── Footstep03.wav.meta │ │ │ ├── Footstep04.wav │ │ │ ├── Footstep04.wav.meta │ │ │ ├── Jump.wav │ │ │ ├── Jump.wav.meta │ │ │ ├── Land.wav │ │ │ └── Land.wav.meta │ │ │ ├── FirstPersonCharacterGuidelines.txt │ │ │ ├── FirstPersonCharacterGuidelines.txt.meta │ │ │ ├── Prefabs.meta │ │ │ ├── Prefabs │ │ │ ├── FPSController.prefab │ │ │ ├── FPSController.prefab.meta │ │ │ ├── RigidBodyFPSController.prefab │ │ │ └── RigidBodyFPSController.prefab.meta │ │ │ ├── Scripts.meta │ │ │ └── Scripts │ │ │ ├── FirstPersonController.cs │ │ │ ├── FirstPersonController.cs.meta │ │ │ ├── HeadBob.cs │ │ │ ├── HeadBob.cs.meta │ │ │ ├── MouseLook.cs │ │ │ ├── MouseLook.cs.meta │ │ │ ├── RigidbodyFirstPersonController.cs │ │ │ └── RigidbodyFirstPersonController.cs.meta │ ├── CrossPlatformInput.meta │ ├── CrossPlatformInput │ │ ├── CrossPlatformInputGuidelines.txt │ │ ├── CrossPlatformInputGuidelines.txt.meta │ │ ├── Prefabs.meta │ │ ├── Prefabs │ │ │ ├── CarTiltControls.prefab │ │ │ ├── CarTiltControls.prefab.meta │ │ │ ├── DualTouchControls.prefab │ │ │ ├── DualTouchControls.prefab.meta │ │ │ ├── MobileAircraftControls.prefab │ │ │ ├── MobileAircraftControls.prefab.meta │ │ │ ├── MobileSingleStickControl.prefab │ │ │ ├── MobileSingleStickControl.prefab.meta │ │ │ ├── MobileTiltControlRig.prefab │ │ │ └── MobileTiltControlRig.prefab.meta │ │ ├── Scripts.meta │ │ ├── Scripts │ │ │ ├── AxisTouchButton.cs │ │ │ ├── AxisTouchButton.cs.meta │ │ │ ├── ButtonHandler.cs │ │ │ ├── ButtonHandler.cs.meta │ │ │ ├── CrossPlatformInputManager.cs │ │ │ ├── CrossPlatformInputManager.cs.meta │ │ │ ├── InputAxisScrollbar.cs │ │ │ ├── InputAxisScrollbar.cs.meta │ │ │ ├── Joystick.cs │ │ │ ├── Joystick.cs.meta │ │ │ ├── MobileControlRig.cs │ │ │ ├── MobileControlRig.cs.meta │ │ │ ├── PlatformSpecific.meta │ │ │ ├── PlatformSpecific │ │ │ │ ├── MobileInput.cs │ │ │ │ ├── MobileInput.cs.meta │ │ │ │ ├── StandaloneInput.cs │ │ │ │ └── StandaloneInput.cs.meta │ │ │ ├── TiltInput.cs │ │ │ ├── TiltInput.cs.meta │ │ │ ├── TouchPad.cs │ │ │ ├── TouchPad.cs.meta │ │ │ ├── VirtualInput.cs │ │ │ └── VirtualInput.cs.meta │ │ ├── Sprites.meta │ │ └── Sprites │ │ │ ├── ButtonAcceleratorOverSprite.png │ │ │ ├── ButtonAcceleratorOverSprite.png.meta │ │ │ ├── ButtonAcceleratorUpSprite.png │ │ │ ├── ButtonAcceleratorUpSprite.png.meta │ │ │ ├── ButtonArrowOverSprite.png │ │ │ ├── ButtonArrowOverSprite.png.meta │ │ │ ├── ButtonArrowUpSprite.png │ │ │ ├── ButtonArrowUpSprite.png.meta │ │ │ ├── ButtonBrakeOverSprite.png │ │ │ ├── ButtonBrakeOverSprite.png.meta │ │ │ ├── ButtonBrakeUpSprite.png │ │ │ ├── ButtonBrakeUpSprite.png.meta │ │ │ ├── ButtonCameraCycleUpSprite.png │ │ │ ├── ButtonCameraCycleUpSprite.png.meta │ │ │ ├── ButtonResetSprite.png │ │ │ ├── ButtonResetSprite.png.meta │ │ │ ├── ButtonSpacebarSprite.png │ │ │ ├── ButtonSpacebarSprite.png.meta │ │ │ ├── ButtonThumbstickOverSprite.png │ │ │ ├── ButtonThumbstickOverSprite.png.meta │ │ │ ├── ButtonThumbstickUpSprite.png │ │ │ ├── ButtonThumbstickUpSprite.png.meta │ │ │ ├── ButtonTimescaleFullUpSprite.png │ │ │ ├── ButtonTimescaleFullUpSprite.png.meta │ │ │ ├── ButtonTimescaleSlowUpSprite.png │ │ │ ├── ButtonTimescaleSlowUpSprite.png.meta │ │ │ ├── SliderBackgroundSprite.png │ │ │ ├── SliderBackgroundSprite.png.meta │ │ │ ├── SliderHandleSprite.png │ │ │ ├── SliderHandleSprite.png.meta │ │ │ ├── TouchpadSprite.png │ │ │ └── TouchpadSprite.png.meta │ ├── Editor.meta │ ├── Editor │ │ ├── CrossPlatformInput.meta │ │ └── CrossPlatformInput │ │ │ ├── CrossPlatformInputInitialize.cs │ │ │ └── CrossPlatformInputInitialize.cs.meta │ ├── Utility.meta │ ├── Utility │ │ ├── ActivateTrigger.cs │ │ ├── ActivateTrigger.cs.meta │ │ ├── AlphaButtonClickMask.cs │ │ ├── AlphaButtonClickMask.cs.meta │ │ ├── AutoMobileShaderSwitch.cs │ │ ├── AutoMobileShaderSwitch.cs.meta │ │ ├── AutoMoveAndRotate.cs │ │ ├── AutoMoveAndRotate.cs.meta │ │ ├── CameraRefocus.cs │ │ ├── CameraRefocus.cs.meta │ │ ├── CurveControlledBob.cs │ │ ├── CurveControlledBob.cs.meta │ │ ├── DragRigidbody.cs │ │ ├── DragRigidbody.cs.meta │ │ ├── DynamicShadowSettings.cs │ │ ├── DynamicShadowSettings.cs.meta │ │ ├── EventSystemChecker.cs │ │ ├── EventSystemChecker.cs.meta │ │ ├── FOVKick.cs │ │ ├── FOVKick.cs.meta │ │ ├── FPSCounter.cs │ │ ├── FPSCounter.cs.meta │ │ ├── FollowTarget.cs │ │ ├── FollowTarget.cs.meta │ │ ├── ForcedReset.cs │ │ ├── ForcedReset.cs.meta │ │ ├── LerpControlledBob.cs │ │ ├── LerpControlledBob.cs.meta │ │ ├── ObjectResetter.cs │ │ ├── ObjectResetter.cs.meta │ │ ├── ParticleSystemDestroyer.cs │ │ ├── ParticleSystemDestroyer.cs.meta │ │ ├── PlatformSpecificContent.cs │ │ ├── PlatformSpecificContent.cs.meta │ │ ├── Prefabs.meta │ │ ├── Prefabs │ │ │ ├── FramerateCounter.prefab │ │ │ └── FramerateCounter.prefab.meta │ │ ├── SimpleActivatorMenu.cs │ │ ├── SimpleActivatorMenu.cs.meta │ │ ├── SimpleMouseRotator.cs │ │ ├── SimpleMouseRotator.cs.meta │ │ ├── SmoothFollow.cs │ │ ├── SmoothFollow.cs.meta │ │ ├── TimedObjectActivator.cs │ │ ├── TimedObjectActivator.cs.meta │ │ ├── TimedObjectDestructor.cs │ │ ├── TimedObjectDestructor.cs.meta │ │ ├── WaypointCircuit.cs │ │ ├── WaypointCircuit.cs.meta │ │ ├── WaypointProgressTracker.cs │ │ └── WaypointProgressTracker.cs.meta │ └── test2.txt └── TextMesh Pro.meta ├── LICENSE ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset └── README.md /Assets/DialoguePanel.controller: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/DialoguePanel.controller -------------------------------------------------------------------------------- /Assets/DialoguePanel.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e821eb93867cfa48bc98a65af03fb94 3 | timeCreated: 1514078996 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/JJIS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eba8cc9333ca2174a9b5f7dc607b42fb 3 | folderAsset: yes 4 | timeCreated: 1513665111 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/JJIS/Dialogue Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d296aab32dc8a164a8a64bab9369e041 3 | folderAsset: yes 4 | timeCreated: 1514078941 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/JJIS/Dialogue Materials/DialogueBox 1.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/JJIS/Dialogue Materials/DialogueBox 1.psd -------------------------------------------------------------------------------- /Assets/JJIS/Dialogue Materials/DialogueBox 1.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ac2bf7dea7e9e24bac717b626cf2431 3 | timeCreated: 1493834766 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: 7 | 21300000: DialogueBox 1_0 8 | serializedVersion: 4 9 | mipmaps: 10 | mipMapMode: 0 11 | enableMipMap: 0 12 | sRGBTexture: 1 13 | linearTexture: 0 14 | fadeOut: 0 15 | borderMipMap: 0 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 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 0 27 | seamlessCubemap: 0 28 | textureFormat: 1 29 | maxTextureSize: 2048 30 | textureSettings: 31 | filterMode: -1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: -1 35 | nPOTScale: 0 36 | lightmap: 0 37 | compressionQuality: 50 38 | spriteMode: 2 39 | spriteExtrude: 1 40 | spriteMeshType: 0 41 | alignment: 0 42 | spritePivot: {x: 0.5, y: 0.5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaUsage: 1 46 | alphaIsTransparency: 0 47 | spriteTessellationDetail: -1 48 | textureType: 8 49 | textureShape: 1 50 | maxTextureSizeSet: 0 51 | compressionQualitySet: 0 52 | textureFormatSet: 0 53 | platformSettings: 54 | - buildTarget: DefaultTexturePlatform 55 | maxTextureSize: 2048 56 | textureFormat: -1 57 | textureCompression: 0 58 | compressionQuality: 50 59 | crunchedCompression: 0 60 | allowsAlphaSplitting: 0 61 | overridden: 0 62 | - buildTarget: Standalone 63 | maxTextureSize: 2048 64 | textureFormat: -1 65 | textureCompression: 0 66 | compressionQuality: 50 67 | crunchedCompression: 0 68 | allowsAlphaSplitting: 0 69 | overridden: 0 70 | - buildTarget: iPhone 71 | maxTextureSize: 2048 72 | textureFormat: -1 73 | textureCompression: 0 74 | compressionQuality: 50 75 | crunchedCompression: 0 76 | allowsAlphaSplitting: 0 77 | overridden: 0 78 | - buildTarget: Android 79 | maxTextureSize: 2048 80 | textureFormat: -1 81 | textureCompression: 0 82 | compressionQuality: 50 83 | crunchedCompression: 0 84 | allowsAlphaSplitting: 0 85 | overridden: 0 86 | spriteSheet: 87 | serializedVersion: 2 88 | sprites: 89 | - serializedVersion: 2 90 | name: DialogueBox 1_0 91 | rect: 92 | serializedVersion: 2 93 | x: 512 94 | y: 515 95 | width: 1022 96 | height: 1022 97 | alignment: 0 98 | pivot: {x: 0.5, y: 0.5} 99 | border: {x: 500, y: 1, z: 500, w: 1} 100 | outline: [] 101 | tessellationDetail: 0 102 | outline: [] 103 | spritePackingTag: 104 | userData: 105 | assetBundleName: 106 | assetBundleVariant: 107 | -------------------------------------------------------------------------------- /Assets/JJIS/Dialogue Materials/DialogueBox.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/JJIS/Dialogue Materials/DialogueBox.mat -------------------------------------------------------------------------------- /Assets/JJIS/Dialogue Materials/DialogueBox.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 766f829d722a24443ad1115766a34e73 3 | timeCreated: 1493386482 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/JJIS/Dialogue Materials/DialogueBox.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/JJIS/Dialogue Materials/DialogueBox.psd -------------------------------------------------------------------------------- /Assets/JJIS/Dialogue Materials/DialogueBox.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a244177bd86e93947b7f7008d2acdb7e 3 | timeCreated: 1493406073 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: 7 | 21300000: DialogueBox_0 8 | 21300002: DialogueBox_1 9 | serializedVersion: 4 10 | mipmaps: 11 | mipMapMode: 1 12 | enableMipMap: 0 13 | sRGBTexture: 1 14 | linearTexture: 0 15 | fadeOut: 0 16 | borderMipMap: 0 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 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: 0 33 | aniso: 16 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | compressionQuality: 50 39 | spriteMode: 2 40 | spriteExtrude: 1 41 | spriteMeshType: 0 42 | alignment: 0 43 | spritePivot: {x: 0.5, y: 0.5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 100 46 | alphaUsage: 1 47 | alphaIsTransparency: 0 48 | spriteTessellationDetail: -1 49 | textureType: 8 50 | textureShape: 1 51 | maxTextureSizeSet: 0 52 | compressionQualitySet: 0 53 | textureFormatSet: 0 54 | platformSettings: 55 | - buildTarget: DefaultTexturePlatform 56 | maxTextureSize: 2048 57 | textureFormat: -1 58 | textureCompression: 0 59 | compressionQuality: 50 60 | crunchedCompression: 0 61 | allowsAlphaSplitting: 0 62 | overridden: 0 63 | - buildTarget: Standalone 64 | maxTextureSize: 2048 65 | textureFormat: -1 66 | textureCompression: 0 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | - buildTarget: iPhone 72 | maxTextureSize: 2048 73 | textureFormat: -1 74 | textureCompression: 0 75 | compressionQuality: 50 76 | crunchedCompression: 0 77 | allowsAlphaSplitting: 0 78 | overridden: 0 79 | - buildTarget: Android 80 | maxTextureSize: 2048 81 | textureFormat: -1 82 | textureCompression: 0 83 | compressionQuality: 50 84 | crunchedCompression: 0 85 | allowsAlphaSplitting: 0 86 | overridden: 0 87 | spriteSheet: 88 | serializedVersion: 2 89 | sprites: 90 | - serializedVersion: 2 91 | name: DialogueBox_0 92 | rect: 93 | serializedVersion: 2 94 | x: 298 95 | y: 1032 96 | width: 601 97 | height: 75 98 | alignment: 0 99 | pivot: {x: 0, y: 0} 100 | border: {x: 45, y: 0, z: 40, w: 0} 101 | outline: [] 102 | tessellationDetail: 0 103 | - serializedVersion: 2 104 | name: DialogueBox_1 105 | rect: 106 | serializedVersion: 2 107 | x: 300 108 | y: 306 109 | width: 594 110 | height: 594 111 | alignment: 0 112 | pivot: {x: 0, y: 0} 113 | border: {x: 267, y: 2, z: 270, w: 2} 114 | outline: [] 115 | tessellationDetail: 0 116 | outline: [] 117 | spritePackingTag: 118 | userData: 119 | assetBundleName: 120 | assetBundleVariant: 121 | -------------------------------------------------------------------------------- /Assets/JJIS/Dialogue Materials/Floor.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/JJIS/Dialogue Materials/Floor.mat -------------------------------------------------------------------------------- /Assets/JJIS/Dialogue Materials/Floor.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48bb7527602208b4cad507b1ba0ee52b 3 | timeCreated: 1493373335 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/JJIS/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1ca9ff13fdfad041a452db5d933d392 3 | folderAsset: yes 4 | timeCreated: 1513794355 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/JJIS/Editor/InspectMenuInstancer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace JJIS { 7 | public class InspectMenuInstancer : MonoBehaviour { 8 | 9 | [MenuItem("JJ_Systems/JJIS/New Inspect Script Asset")] 10 | public static void CreateMyAsset_Simple() { 11 | InspectObject asset = ScriptableObject.CreateInstance(); 12 | 13 | AssetDatabase.CreateAsset(asset, "Assets/JJIS/Inspect_Assets/NewInspectObject.asset"); 14 | AssetDatabase.SaveAssets(); 15 | AssetDatabase.Refresh(); 16 | EditorUtility.FocusProjectWindow(); 17 | Selection.activeObject = asset; 18 | } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/JJIS/Editor/InspectMenuInstancer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5d21235ed5cc064994187523ea7252b 3 | timeCreated: 1513794376 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/JJIS/Inspect_Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 078fe5c775ed6474eb525a591016b144 3 | folderAsset: yes 4 | timeCreated: 1513796763 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/JJIS/Inspect_Assets/SampleInspectObject.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/JJIS/Inspect_Assets/SampleInspectObject.asset -------------------------------------------------------------------------------- /Assets/JJIS/Inspect_Assets/SampleInspectObject.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f875a91fd2141f43ab734a14f0dfb98 3 | timeCreated: 1514442708 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 11400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/JJIS/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 719a8b033931a824980a7fd6434bcc4d 3 | folderAsset: yes 4 | timeCreated: 1513665122 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/JJIS/Scripts/BasicInspect.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Events; 5 | using TMPro; 6 | using UnityStandardAssets.Characters.FirstPerson; 7 | 8 | namespace JJIS { 9 | public class BasicInspect : MonoBehaviour { 10 | 11 | [Header("Main References")] 12 | public InspectObject inspectScript; 13 | public GameObject player; 14 | 15 | [Header("UI References")] 16 | public TMP_Text scriptTitle; 17 | public TMP_Text scriptText; 18 | public TMP_Text scriptSubText; 19 | 20 | [Header("Animation References")] 21 | public Animator anim; 22 | public AudioSource sfx_src; 23 | public AudioClip sfxClip; 24 | public GameObject dialoguePanel; 25 | 26 | [Header("SFX Pitch Modulation")] 27 | [Range(0.9f, 1.0f)] 28 | public float minPitchMod; 29 | [Range(1.0f, 1.1f)] 30 | public float maxPitchMod; 31 | 32 | [Header("Inspection Properties")] 33 | // Determines if an object can be inspected multiple times. 34 | [Tooltip("Determines if an object can be reinspected.")] 35 | public bool canReinspect; 36 | 37 | // This event will execute at the end of the inspection dialogue if used. 38 | [Tooltip("Event to execute at the end of dialogue.")] 39 | public UnityEvent inspectEvent; 40 | 41 | private bool firstTimeInspection = true; 42 | private bool scriptIsActive; 43 | private bool lineIsComplete; 44 | private int scriptCapacity; 45 | private int scriptCurrent; 46 | 47 | //Starts the inspection process. 48 | public void StartInspection () { 49 | Debug.Log("Starting Inspection..."); 50 | player.GetComponent().enabled = false; 51 | 52 | firstTimeInspection = false; 53 | 54 | dialoguePanel.SetActive(true); 55 | scriptCurrent = 0; 56 | scriptIsActive = true; 57 | scriptTitle.text = inspectScript.ScriptOwner; 58 | scriptCapacity = inspectScript.allScriptData.Length; 59 | scriptSubText.text = "<...>"; 60 | anim.SetTrigger("FadeIn"); 61 | RunDialogue(); 62 | } 63 | 64 | //Handles user input 65 | private void Update() { 66 | //If you left click while the text is scrolling, it will skip and display the full text. 67 | if(Input.GetMouseButtonDown(0) && scriptIsActive) { 68 | if(scriptCurrent < scriptCapacity) { 69 | RunDialogue(); 70 | } 71 | else { 72 | KillInspection(); 73 | } 74 | } 75 | } 76 | 77 | //Checks for first time inspection. 78 | public bool isFirstTime() { 79 | return firstTimeInspection; 80 | } 81 | //Checks for reinspectable objects. 82 | public bool isReinspectable() { 83 | return canReinspect; 84 | } 85 | 86 | //Runs the dialogue based on the completion of the line of text. 87 | private void RunDialogue() { 88 | StopAllCoroutines(); 89 | if(lineIsComplete) { 90 | StartCoroutine(NextDialogue(scriptCurrent)); 91 | } 92 | else { 93 | StartCoroutine(CurrentDialogue(scriptCurrent)); 94 | } 95 | } 96 | 97 | //Kills any active dialogue. 98 | private void KillInspection() { 99 | StopAllCoroutines(); 100 | anim.SetTrigger("FadeOut"); 101 | scriptCurrent = 0; 102 | lineIsComplete = false; 103 | dialoguePanel.SetActive(false); 104 | 105 | player.GetComponent().enabled = true; 106 | scriptIsActive = false; 107 | 108 | if(inspectEvent != null) 109 | inspectEvent.Invoke(); 110 | 111 | 112 | } 113 | 114 | //This method skips the scrolling and displays the full dialogue line. 115 | IEnumerator CurrentDialogue(int currentIndex) { 116 | string fullString; 117 | fullString = inspectScript.allScriptData[currentIndex]; 118 | scriptText.text = fullString; 119 | sfx_src.pitch = 1; 120 | sfx_src.PlayOneShot(sfxClip); 121 | lineIsComplete = true; 122 | scriptCurrent++; 123 | scriptSubText.text = "<...>"; 124 | yield return 0f; 125 | } 126 | 127 | // Handles time between scrolling letters. 128 | private float timeBetweenLetters = 0.03f; 129 | 130 | //This method scrolls through the dialogue line and displays letter-by-letter. 131 | IEnumerator NextDialogue(int currentIndex) { 132 | string fullString = ""; 133 | bool markup = false; 134 | lineIsComplete = false; 135 | 136 | while(!lineIsComplete) { 137 | for(int i = 0; i < inspectScript.allScriptData[currentIndex].Length; i++) { 138 | if(inspectScript.allScriptData[currentIndex][i] == '<') { 139 | markup = true; 140 | } 141 | if(markup) { 142 | fullString += inspectScript.allScriptData[currentIndex][i]; 143 | if(inspectScript.allScriptData[currentIndex][i] == '>') { 144 | markup = false; 145 | } 146 | } 147 | else { 148 | fullString += inspectScript.allScriptData[currentIndex][i]; 149 | scriptText.text = fullString; 150 | sfx_src.PlayOneShot(sfxClip); 151 | sfx_src.pitch = Random.Range(minPitchMod,maxPitchMod); 152 | yield return new WaitForSeconds(timeBetweenLetters); 153 | } 154 | } 155 | if(scriptCurrent < scriptCapacity-1) { 156 | scriptSubText.text = "<...>"; 157 | } 158 | else { 159 | scriptSubText.text = ""; 160 | } 161 | lineIsComplete = true; 162 | } 163 | scriptCurrent++; 164 | yield return 0f; 165 | } 166 | 167 | 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /Assets/JJIS/Scripts/BasicInspect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f7d31e7948b634428fee47ee69b3f71 3 | timeCreated: 1514442132 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/JJIS/Scripts/InspectObject.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace JJIS { 6 | [System.Serializable] 7 | public class InspectObject : ScriptableObject { 8 | 9 | 10 | [SerializeField] 11 | private string scriptOwner; 12 | public string ScriptOwner { 13 | get {return scriptOwner;} 14 | set {scriptOwner = value;} 15 | } 16 | 17 | [Multiline] 18 | public string[] allScriptData; 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/JJIS/Scripts/InspectObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5195bc4cebd17a34f83062c835c61fe8 3 | timeCreated: 1514442132 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/JJIS/Scripts/InspectRayCast.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace JJIS { 6 | public class InspectRayCast : MonoBehaviour { 7 | 8 | public Camera mainCam; 9 | 10 | [SerializeField] 11 | private float rayDist = 3.0f; 12 | 13 | private void Start() { 14 | if(!mainCam) { 15 | mainCam = Camera.main; 16 | } 17 | } 18 | 19 | // Update is called once per frame 20 | private void Update () { 21 | if(Input.GetKeyDown(KeyCode.E)) { 22 | InspectRay(); 23 | } 24 | } 25 | 26 | private void InspectRay() { 27 | RaycastHit hit; 28 | Ray ray = mainCam.ScreenPointToRay(Input.mousePosition); 29 | if(Physics.Raycast(ray, out hit, rayDist)) { 30 | if(hit.collider.CompareTag("InspectSignPost")) { 31 | BasicInspect inspectSignScript = hit.collider.GetComponent(); 32 | 33 | if(inspectSignScript.isReinspectable()) 34 | inspectSignScript.StartInspection(); 35 | else if(inspectSignScript.isFirstTime()) 36 | inspectSignScript.StartInspection(); 37 | else 38 | return; 39 | } 40 | } 41 | } 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Assets/JJIS/Scripts/InspectRayCast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 133735074d329514485bd98297afeb16 3 | timeCreated: 1514442132 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/JJIS/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9c9f0b134813604b83afc82db55fa97 3 | folderAsset: yes 4 | timeCreated: 1513665119 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/JJIS/Test/Imports.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2a0628f4f44a4041b05922c1a71dadd 3 | folderAsset: yes 4 | timeCreated: 1514062917 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/JJIS/Test/Imports/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 045de8ea1f9100e4e8397352e2973c31 3 | folderAsset: yes 4 | timeCreated: 1514062924 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/JJIS/Test/Imports/Materials/SignPost_Bot.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/JJIS/Test/Imports/Materials/SignPost_Bot.mat -------------------------------------------------------------------------------- /Assets/JJIS/Test/Imports/Materials/SignPost_Bot.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5822f89401e739e44b53ce528e7d1cdf 3 | timeCreated: 1514056499 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 2100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/JJIS/Test/Imports/Materials/SignPost_Inner.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/JJIS/Test/Imports/Materials/SignPost_Inner.mat -------------------------------------------------------------------------------- /Assets/JJIS/Test/Imports/Materials/SignPost_Inner.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 915371d914a5b4c4bb5053ede58e3e34 3 | timeCreated: 1514056499 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 2100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/JJIS/Test/Imports/Materials/SignPost_Outter.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/JJIS/Test/Imports/Materials/SignPost_Outter.mat -------------------------------------------------------------------------------- /Assets/JJIS/Test/Imports/Materials/SignPost_Outter.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3e3f2609ca7558489a0f8eb35bf00b6 3 | timeCreated: 1514056499 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 2100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/JJIS/Test/Imports/Sign.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/JJIS/Test/Imports/Sign.fbx -------------------------------------------------------------------------------- /Assets/JJIS/Test/Imports/Sign.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d28638b0d302b5409669f91df668a13 3 | timeCreated: 1513901876 4 | licenseType: Free 5 | ModelImporter: 6 | serializedVersion: 22 7 | fileIDToRecycleName: 8 | 100000: Camera 9 | 100002: Cube 10 | 100004: Cube.001 11 | 100006: Lamp 12 | 100008: //RootNode 13 | 400000: Camera 14 | 400002: Cube 15 | 400004: Cube.001 16 | 400006: Lamp 17 | 400008: //RootNode 18 | 2000000: Camera 19 | 2100000: SignOuter 20 | 2100002: SignInner 21 | 2100004: SignPost 22 | 2300000: Cube 23 | 2300002: Cube.001 24 | 3300000: Cube 25 | 3300002: Cube.001 26 | 4300000: Cube.001 27 | 4300002: Cube 28 | 10800000: Lamp 29 | externalObjects: 30 | - first: 31 | type: UnityEngine:Material 32 | assembly: UnityEngine.CoreModule 33 | name: SignInner 34 | second: {fileID: 2100000, guid: 915371d914a5b4c4bb5053ede58e3e34, type: 2} 35 | - first: 36 | type: UnityEngine:Material 37 | assembly: UnityEngine.CoreModule 38 | name: SignOuter 39 | second: {fileID: 2100000, guid: e3e3f2609ca7558489a0f8eb35bf00b6, type: 2} 40 | - first: 41 | type: UnityEngine:Material 42 | assembly: UnityEngine.CoreModule 43 | name: SignPost 44 | second: {fileID: 2100000, guid: 5822f89401e739e44b53ce528e7d1cdf, type: 2} 45 | materials: 46 | importMaterials: 0 47 | materialName: 0 48 | materialSearch: 1 49 | materialLocation: 1 50 | animations: 51 | legacyGenerateAnimations: 4 52 | bakeSimulation: 0 53 | resampleCurves: 1 54 | optimizeGameObjects: 0 55 | motionNodeName: 56 | rigImportErrors: 57 | rigImportWarnings: 58 | animationImportErrors: 59 | animationImportWarnings: 60 | animationRetargetingWarnings: 61 | animationDoRetargetingWarnings: 0 62 | importAnimatedCustomProperties: 0 63 | animationCompression: 1 64 | animationRotationError: 0.5 65 | animationPositionError: 0.5 66 | animationScaleError: 0.5 67 | animationWrapMode: 0 68 | extraExposedTransformPaths: [] 69 | extraUserProperties: [] 70 | clipAnimations: [] 71 | isReadable: 1 72 | meshes: 73 | lODScreenPercentages: [] 74 | globalScale: 1 75 | meshCompression: 0 76 | addColliders: 0 77 | importVisibility: 1 78 | importBlendShapes: 1 79 | importCameras: 1 80 | importLights: 1 81 | swapUVChannels: 0 82 | generateSecondaryUV: 0 83 | useFileUnits: 1 84 | optimizeMeshForGPU: 1 85 | keepQuads: 0 86 | weldVertices: 1 87 | preserveHierarchy: 0 88 | indexFormat: 0 89 | secondaryUVAngleDistortion: 8 90 | secondaryUVAreaDistortion: 15.000001 91 | secondaryUVHardAngle: 88 92 | secondaryUVPackMargin: 4 93 | useFileScale: 1 94 | tangentSpace: 95 | normalSmoothAngle: 60 96 | normalImportMode: 0 97 | tangentImportMode: 3 98 | normalCalculationMode: 4 99 | importAnimation: 1 100 | copyAvatar: 0 101 | humanDescription: 102 | serializedVersion: 2 103 | human: [] 104 | skeleton: [] 105 | armTwist: 0.5 106 | foreArmTwist: 0.5 107 | upperLegTwist: 0.5 108 | legTwist: 0.5 109 | armStretch: 0.05 110 | legStretch: 0.05 111 | feetSpacing: 0 112 | rootMotionBoneName: 113 | rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} 114 | hasTranslationDoF: 0 115 | hasExtraRoot: 0 116 | skeletonHasParents: 1 117 | lastHumanDescriptionAvatarSource: {instanceID: 0} 118 | animationType: 0 119 | humanoidOversampling: 1 120 | additionalBone: 0 121 | userData: 122 | assetBundleName: 123 | assetBundleVariant: 124 | -------------------------------------------------------------------------------- /Assets/JJIS/Test/SFX.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/JJIS/Test/SFX.wav -------------------------------------------------------------------------------- /Assets/JJIS/Test/SFX.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e0900f036cff6f4f84dc574c04a8193 3 | timeCreated: 1514077983 4 | licenseType: Free 5 | AudioImporter: 6 | externalObjects: {} 7 | serializedVersion: 6 8 | defaultSettings: 9 | loadType: 0 10 | sampleRateSetting: 0 11 | sampleRateOverride: 44100 12 | compressionFormat: 1 13 | quality: 1 14 | conversionMode: 0 15 | platformSettingOverrides: {} 16 | forceToMono: 0 17 | normalize: 1 18 | preloadAudioData: 1 19 | loadInBackground: 0 20 | ambisonic: 0 21 | 3D: 1 22 | userData: 23 | assetBundleName: 24 | assetBundleVariant: 25 | -------------------------------------------------------------------------------- /Assets/JJIS/Test/Signpost.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/JJIS/Test/Signpost.prefab -------------------------------------------------------------------------------- /Assets/JJIS/Test/Signpost.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed11c6090521088408864c86b7350338 3 | timeCreated: 1514062906 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/JJIS/Test/TESTEVENT.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace JJIS { 6 | public class TESTEVENT : MonoBehaviour { 7 | 8 | public void TestEvent() { 9 | Debug.Log("THIS IS A TEST EVENT FROM THE INSPECTION SYSTEM"); 10 | } 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Assets/JJIS/Test/TESTEVENT.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 437942f42c02c1840bc33f14362dd672 3 | timeCreated: 1514442528 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Main.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Main.asset -------------------------------------------------------------------------------- /Assets/Main.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d0eb6839ec284d4fbe31f39f68f98e7 3 | timeCreated: 1493833584 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 11400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Main.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Main.unity -------------------------------------------------------------------------------- /Assets/Main.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72eceab40dd46d343b7568e0a4d9f7b8 3 | timeCreated: 1493373408 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8dcd969c841269947b63631b3297546e 3 | folderAsset: yes 4 | timeCreated: 1514079451 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Standard Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7e3f4fa1904d224db26804e981e58d6 3 | folderAsset: yes 4 | timeCreated: 1493861144 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Cameras.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 604bd9e7358cf48c0969f5b515a8c51c 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c32f58513a41ef4dab9cb7704c5fb92 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 943e057eaae705e43b9e9b2e53d6adb0 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2dac79461900e0f4c93561031c2e6902 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep01.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep01.wav -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep01.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42e65e088b3f4374e851b8dbd38f3df9 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep02.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep02.wav -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep02.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bc94ec6ed537e743b481638bdcd503d 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep03.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep03.wav -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep03.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a9383dda6cabc047b7a297602e93eb4 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep04.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep04.wav -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep04.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9714160ce34f2b4ab63ff8c27bd68e1 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Jump.wav -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Jump.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5897aeed9b676024fbb8c694b421a861 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Land.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Land.wav -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Land.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b09d59f4499d45428baa7a21e954296 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/FirstPersonCharacterGuidelines.txt: -------------------------------------------------------------------------------- 1 | The first-person character is a single prefab which is designed to be used as-is. There's usually no need to create your own from the separate scripts provided. Just drop the prefab into your scene and you're good to go. 2 | 3 | 4 | The simplest way to get started with the First Person Character is to follow these steps: 5 | 6 | 1) Start with a suitable scene. There ought to be enough flat ground to walk around on. 7 | 8 | 2) Place the "FirstPersonCharacter" prefab in the scene. 9 | 10 | 3) If present, delete the "Main Camera" that exists in new scenes by default. The First Person Character prefab contains its own camera, so you don't need the default camera, or any of the camera rigs to use it. 11 | 12 | The first-person character is made up of a few components acting together. The FirstPersonCharacter script provides the functionality of moving, strafing and jumping. The SimpleMouseRotator provides the functionality of turning the body of the character left and right, and another copy of the same script on the "FirstPersonCamera" controls the looking-up-and-down effect. 13 | 14 | There is also an optional "Head Bob" script which provides a head bobbing effect and optionally also plays footstep sounds in sync with the head bobbing. This script can be disabled or removed if required. 15 | 16 | There are a number of simple adjustable settings on each component allowing you to change the movement speed, jump power, head bob style, and more. For more detail about each setting, see the comments in each script. 17 | 18 | The Character script also requires references to "zero friction" and "max friction" physics materials. These are provided already set-up for you. 19 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/FirstPersonCharacterGuidelines.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc9b000e9b8028247bd816e159382646 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0bfb2599080d5d24e84362b4ae314ae7 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/FPSController.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e9e851c0e142814dac026a256ba2ac0 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/RigidBodyFPSController.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100004 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 | - 20: {fileID: 2000000} 12 | - 81: {fileID: 8100000} 13 | - 114: {fileID: 11400006} 14 | - 124: {fileID: 12410568} 15 | m_Layer: 0 16 | m_Name: MainCamera 17 | m_TagString: MainCamera 18 | m_Icon: {fileID: 0} 19 | m_NavMeshLayer: 0 20 | m_StaticEditorFlags: 0 21 | m_IsActive: 1 22 | --- !u!1 &100006 23 | GameObject: 24 | m_ObjectHideFlags: 0 25 | m_PrefabParentObject: {fileID: 0} 26 | m_PrefabInternal: {fileID: 100100000} 27 | serializedVersion: 4 28 | m_Component: 29 | - 4: {fileID: 400002} 30 | - 54: {fileID: 5400000} 31 | - 136: {fileID: 13600000} 32 | - 114: {fileID: 11400004} 33 | m_Layer: 0 34 | m_Name: RigidBodyFPSController 35 | m_TagString: Untagged 36 | m_Icon: {fileID: 0} 37 | m_NavMeshLayer: 0 38 | m_StaticEditorFlags: 0 39 | m_IsActive: 1 40 | --- !u!4 &400000 41 | Transform: 42 | m_ObjectHideFlags: 1 43 | m_PrefabParentObject: {fileID: 0} 44 | m_PrefabInternal: {fileID: 100100000} 45 | m_GameObject: {fileID: 100004} 46 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 47 | m_LocalPosition: {x: 0, y: 0.6, z: 0} 48 | m_LocalScale: {x: 1, y: 1, z: 1} 49 | m_Children: [] 50 | m_Father: {fileID: 400002} 51 | m_RootOrder: 0 52 | --- !u!4 &400002 53 | Transform: 54 | m_ObjectHideFlags: 1 55 | m_PrefabParentObject: {fileID: 0} 56 | m_PrefabInternal: {fileID: 100100000} 57 | m_GameObject: {fileID: 100006} 58 | m_LocalRotation: {x: 0, y: 1, z: 0, w: -0.00000016292068} 59 | m_LocalPosition: {x: 0, y: 0, z: 0} 60 | m_LocalScale: {x: 1, y: 1, z: 1} 61 | m_Children: 62 | - {fileID: 400000} 63 | m_Father: {fileID: 0} 64 | m_RootOrder: 0 65 | --- !u!20 &2000000 66 | Camera: 67 | m_ObjectHideFlags: 1 68 | m_PrefabParentObject: {fileID: 0} 69 | m_PrefabInternal: {fileID: 100100000} 70 | m_GameObject: {fileID: 100004} 71 | m_Enabled: 1 72 | serializedVersion: 2 73 | m_ClearFlags: 1 74 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} 75 | m_NormalizedViewPortRect: 76 | serializedVersion: 2 77 | x: 0 78 | y: 0 79 | width: 1 80 | height: 1 81 | near clip plane: 0.3 82 | far clip plane: 1000 83 | field of view: 60 84 | orthographic: 0 85 | orthographic size: 5 86 | m_Depth: 0 87 | m_CullingMask: 88 | serializedVersion: 2 89 | m_Bits: 4294967295 90 | m_RenderingPath: -1 91 | m_TargetTexture: {fileID: 0} 92 | m_TargetDisplay: 0 93 | m_TargetEye: 3 94 | m_HDR: 0 95 | m_OcclusionCulling: 1 96 | m_StereoConvergence: 10 97 | m_StereoSeparation: 0.022 98 | m_StereoMirrorMode: 0 99 | --- !u!54 &5400000 100 | Rigidbody: 101 | m_ObjectHideFlags: 1 102 | m_PrefabParentObject: {fileID: 0} 103 | m_PrefabInternal: {fileID: 100100000} 104 | m_GameObject: {fileID: 100006} 105 | serializedVersion: 2 106 | m_Mass: 10 107 | m_Drag: 0 108 | m_AngularDrag: 0.05 109 | m_UseGravity: 1 110 | m_IsKinematic: 0 111 | m_Interpolate: 0 112 | m_Constraints: 112 113 | m_CollisionDetection: 0 114 | --- !u!81 &8100000 115 | AudioListener: 116 | m_ObjectHideFlags: 1 117 | m_PrefabParentObject: {fileID: 0} 118 | m_PrefabInternal: {fileID: 100100000} 119 | m_GameObject: {fileID: 100004} 120 | m_Enabled: 1 121 | --- !u!114 &11400004 122 | MonoBehaviour: 123 | m_ObjectHideFlags: 1 124 | m_PrefabParentObject: {fileID: 0} 125 | m_PrefabInternal: {fileID: 100100000} 126 | m_GameObject: {fileID: 100006} 127 | m_Enabled: 1 128 | m_EditorHideFlags: 0 129 | m_Script: {fileID: 11500000, guid: 81c9795a96c094f4cbde4d65546aa9b2, type: 3} 130 | m_Name: 131 | m_EditorClassIdentifier: 132 | cam: {fileID: 2000000} 133 | movementSettings: 134 | ForwardSpeed: 8 135 | BackwardSpeed: 4 136 | StrafeSpeed: 4 137 | RunMultiplier: 2 138 | RunKey: 304 139 | JumpForce: 50 140 | SlopeCurveModifier: 141 | serializedVersion: 2 142 | m_Curve: 143 | - time: -90 144 | value: 1 145 | inSlope: 0 146 | outSlope: 0 147 | tangentMode: 0 148 | - time: 0 149 | value: 1 150 | inSlope: 0 151 | outSlope: 0 152 | tangentMode: 0 153 | - time: 90 154 | value: 0 155 | inSlope: 0 156 | outSlope: 0 157 | tangentMode: 0 158 | m_PreInfinity: 2 159 | m_PostInfinity: 2 160 | m_RotationOrder: 4 161 | CurrentTargetSpeed: 8 162 | mouseLook: 163 | XSensitivity: 2 164 | YSensitivity: 2 165 | clampVerticalRotation: 1 166 | MinimumX: -45 167 | MaximumX: 90 168 | smooth: 1 169 | smoothTime: 18 170 | lockCursor: 1 171 | advancedSettings: 172 | groundCheckDistance: 0.1 173 | stickToGroundHelperDistance: 0.6 174 | slowDownRate: 20 175 | airControl: 0 176 | shellOffset: 0 177 | --- !u!114 &11400006 178 | MonoBehaviour: 179 | m_ObjectHideFlags: 1 180 | m_PrefabParentObject: {fileID: 0} 181 | m_PrefabInternal: {fileID: 100100000} 182 | m_GameObject: {fileID: 100004} 183 | m_Enabled: 1 184 | m_EditorHideFlags: 0 185 | m_Script: {fileID: 11500000, guid: 83c81407209f85e4c87c0cda8b32868e, type: 3} 186 | m_Name: 187 | m_EditorClassIdentifier: 188 | Camera: {fileID: 2000000} 189 | motionBob: 190 | HorizontalBobRange: 0.1 191 | VerticalBobRange: 0.05 192 | Bobcurve: 193 | serializedVersion: 2 194 | m_Curve: 195 | - time: 0 196 | value: 0 197 | inSlope: 0 198 | outSlope: 0 199 | tangentMode: 0 200 | - time: 0.5 201 | value: 1 202 | inSlope: 0 203 | outSlope: 0 204 | tangentMode: 0 205 | - time: 1 206 | value: 0 207 | inSlope: 0 208 | outSlope: 0 209 | tangentMode: 0 210 | - time: 1.5 211 | value: -1 212 | inSlope: 0 213 | outSlope: 0 214 | tangentMode: 0 215 | - time: 2 216 | value: 0 217 | inSlope: 0 218 | outSlope: 0 219 | tangentMode: 0 220 | m_PreInfinity: 2 221 | m_PostInfinity: 2 222 | m_RotationOrder: 4 223 | VerticaltoHorizontalRatio: 2 224 | jumpAndLandingBob: 225 | BobDuration: 0.15 226 | BobAmount: 0.2 227 | rigidbodyFirstPersonController: {fileID: 11400004} 228 | StrideInterval: 4 229 | RunningStrideLengthen: 0.722 230 | --- !u!124 &12410568 231 | Behaviour: 232 | m_ObjectHideFlags: 1 233 | m_PrefabParentObject: {fileID: 0} 234 | m_PrefabInternal: {fileID: 100100000} 235 | m_GameObject: {fileID: 100004} 236 | m_Enabled: 1 237 | --- !u!136 &13600000 238 | CapsuleCollider: 239 | m_ObjectHideFlags: 1 240 | m_PrefabParentObject: {fileID: 0} 241 | m_PrefabInternal: {fileID: 100100000} 242 | m_GameObject: {fileID: 100006} 243 | m_Material: {fileID: 13400000, guid: c2815a7ab32e42c4bb42f59caacb8ec1, type: 2} 244 | m_IsTrigger: 0 245 | m_Enabled: 1 246 | m_Radius: 0.5 247 | m_Height: 1.6 248 | m_Direction: 1 249 | m_Center: {x: 0, y: 0, z: 0} 250 | --- !u!1001 &100100000 251 | Prefab: 252 | m_ObjectHideFlags: 1 253 | serializedVersion: 2 254 | m_Modification: 255 | m_TransformParent: {fileID: 0} 256 | m_Modifications: [] 257 | m_RemovedComponents: [] 258 | m_ParentPrefab: {fileID: 0} 259 | m_RootGameObject: {fileID: 100006} 260 | m_IsPrefabParent: 1 261 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/RigidBodyFPSController.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6453f8e1f814744d8b94e5a6d1f9942 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 314f49b24dc9d5d40956a7b28c67b237 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/FirstPersonController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05ec5cf00ca181d45a42ba1870e148c3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/HeadBob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityStandardAssets.Utility; 4 | 5 | namespace UnityStandardAssets.Characters.FirstPerson 6 | { 7 | public class HeadBob : MonoBehaviour 8 | { 9 | public Camera Camera; 10 | public CurveControlledBob motionBob = new CurveControlledBob(); 11 | public LerpControlledBob jumpAndLandingBob = new LerpControlledBob(); 12 | public RigidbodyFirstPersonController rigidbodyFirstPersonController; 13 | public float StrideInterval; 14 | [Range(0f, 1f)] public float RunningStrideLengthen; 15 | 16 | // private CameraRefocus m_CameraRefocus; 17 | private bool m_PreviouslyGrounded; 18 | private Vector3 m_OriginalCameraPosition; 19 | 20 | 21 | private void Start() 22 | { 23 | motionBob.Setup(Camera, StrideInterval); 24 | m_OriginalCameraPosition = Camera.transform.localPosition; 25 | // m_CameraRefocus = new CameraRefocus(Camera, transform.root.transform, Camera.transform.localPosition); 26 | } 27 | 28 | 29 | private void Update() 30 | { 31 | // m_CameraRefocus.GetFocusPoint(); 32 | Vector3 newCameraPosition; 33 | if (rigidbodyFirstPersonController.Velocity.magnitude > 0 && rigidbodyFirstPersonController.Grounded) 34 | { 35 | Camera.transform.localPosition = motionBob.DoHeadBob(rigidbodyFirstPersonController.Velocity.magnitude*(rigidbodyFirstPersonController.Running ? RunningStrideLengthen : 1f)); 36 | newCameraPosition = Camera.transform.localPosition; 37 | newCameraPosition.y = Camera.transform.localPosition.y - jumpAndLandingBob.Offset(); 38 | } 39 | else 40 | { 41 | newCameraPosition = Camera.transform.localPosition; 42 | newCameraPosition.y = m_OriginalCameraPosition.y - jumpAndLandingBob.Offset(); 43 | } 44 | Camera.transform.localPosition = newCameraPosition; 45 | 46 | if (!m_PreviouslyGrounded && rigidbodyFirstPersonController.Grounded) 47 | { 48 | StartCoroutine(jumpAndLandingBob.DoBobCycle()); 49 | } 50 | 51 | m_PreviouslyGrounded = rigidbodyFirstPersonController.Grounded; 52 | // m_CameraRefocus.SetFocusPoint(); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/HeadBob.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83c81407209f85e4c87c0cda8b32868e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/MouseLook.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityStandardAssets.CrossPlatformInput; 4 | 5 | namespace UnityStandardAssets.Characters.FirstPerson 6 | { 7 | [Serializable] 8 | public class MouseLook 9 | { 10 | public float XSensitivity = 2f; 11 | public float YSensitivity = 2f; 12 | public bool clampVerticalRotation = true; 13 | public float MinimumX = -90F; 14 | public float MaximumX = 90F; 15 | public bool smooth; 16 | public float smoothTime = 5f; 17 | public bool lockCursor = true; 18 | 19 | 20 | private Quaternion m_CharacterTargetRot; 21 | private Quaternion m_CameraTargetRot; 22 | private bool m_cursorIsLocked = true; 23 | 24 | public void Init(Transform character, Transform camera) 25 | { 26 | m_CharacterTargetRot = character.localRotation; 27 | m_CameraTargetRot = camera.localRotation; 28 | } 29 | 30 | 31 | public void LookRotation(Transform character, Transform camera) 32 | { 33 | float yRot = CrossPlatformInputManager.GetAxis("Mouse X") * XSensitivity; 34 | float xRot = CrossPlatformInputManager.GetAxis("Mouse Y") * YSensitivity; 35 | 36 | m_CharacterTargetRot *= Quaternion.Euler (0f, yRot, 0f); 37 | m_CameraTargetRot *= Quaternion.Euler (-xRot, 0f, 0f); 38 | 39 | if(clampVerticalRotation) 40 | m_CameraTargetRot = ClampRotationAroundXAxis (m_CameraTargetRot); 41 | 42 | if(smooth) 43 | { 44 | character.localRotation = Quaternion.Slerp (character.localRotation, m_CharacterTargetRot, 45 | smoothTime * Time.deltaTime); 46 | camera.localRotation = Quaternion.Slerp (camera.localRotation, m_CameraTargetRot, 47 | smoothTime * Time.deltaTime); 48 | } 49 | else 50 | { 51 | character.localRotation = m_CharacterTargetRot; 52 | camera.localRotation = m_CameraTargetRot; 53 | } 54 | 55 | UpdateCursorLock(); 56 | } 57 | 58 | public void SetCursorLock(bool value) 59 | { 60 | lockCursor = value; 61 | if(!lockCursor) 62 | {//we force unlock the cursor if the user disable the cursor locking helper 63 | Cursor.lockState = CursorLockMode.None; 64 | Cursor.visible = true; 65 | } 66 | } 67 | 68 | public void UpdateCursorLock() 69 | { 70 | //if the user set "lockCursor" we check & properly lock the cursos 71 | if (lockCursor) 72 | InternalLockUpdate(); 73 | } 74 | 75 | private void InternalLockUpdate() 76 | { 77 | if(Input.GetKeyUp(KeyCode.Escape)) 78 | { 79 | m_cursorIsLocked = false; 80 | } 81 | else if(Input.GetMouseButtonUp(0)) 82 | { 83 | m_cursorIsLocked = true; 84 | } 85 | 86 | if (m_cursorIsLocked) 87 | { 88 | Cursor.lockState = CursorLockMode.Locked; 89 | Cursor.visible = false; 90 | } 91 | else if (!m_cursorIsLocked) 92 | { 93 | Cursor.lockState = CursorLockMode.None; 94 | Cursor.visible = true; 95 | } 96 | } 97 | 98 | Quaternion ClampRotationAroundXAxis(Quaternion q) 99 | { 100 | q.x /= q.w; 101 | q.y /= q.w; 102 | q.z /= q.w; 103 | q.w = 1.0f; 104 | 105 | float angleX = 2.0f * Mathf.Rad2Deg * Mathf.Atan (q.x); 106 | 107 | angleX = Mathf.Clamp (angleX, MinimumX, MaximumX); 108 | 109 | q.x = Mathf.Tan (0.5f * Mathf.Deg2Rad * angleX); 110 | 111 | return q; 112 | } 113 | 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/MouseLook.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37e60a97f2c87ae41b6cdc1055d78cb9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/RigidbodyFirstPersonController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81c9795a96c094f4cbde4d65546aa9b2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 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/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/CrossPlatformInputGuidelines.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3b997593a4f12c4c991490593f3b513 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /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/Prefabs/CarTiltControls.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 174090ae7f9eff84abe76f0ff062efac 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /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/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/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/Standard Assets/CrossPlatformInput/Prefabs/MobileTiltControlRig.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 999388b68bb99b44099461bfbed94358 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /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/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/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: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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/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/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/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 | #if UNITY_EDITOR 13 | , UnityEditor.Build.IActiveBuildTargetChanged 14 | #endif 15 | { 16 | // this script enables or disables the child objects of a control rig 17 | // depending on whether the USE_MOBILE_INPUT define is declared. 18 | 19 | // This define is set or unset by a menu item that is included with 20 | // the Cross Platform Input package. 21 | 22 | 23 | #if !UNITY_EDITOR 24 | void OnEnable() 25 | { 26 | CheckEnableControlRig(); 27 | } 28 | #else 29 | public int callbackOrder 30 | { 31 | get 32 | { 33 | return 1; 34 | } 35 | } 36 | #endif 37 | 38 | private void Start() 39 | { 40 | #if UNITY_EDITOR 41 | if (Application.isPlaying) //if in the editor, need to check if we are playing, as start is also called just after exiting play 42 | #endif 43 | { 44 | UnityEngine.EventSystems.EventSystem system = GameObject.FindObjectOfType(); 45 | 46 | if (system == null) 47 | {//the scene have no event system, spawn one 48 | GameObject o = new GameObject("EventSystem"); 49 | 50 | o.AddComponent(); 51 | o.AddComponent(); 52 | } 53 | } 54 | } 55 | 56 | #if UNITY_EDITOR 57 | 58 | private void OnEnable() 59 | { 60 | EditorApplication.update += Update; 61 | } 62 | 63 | 64 | private void OnDisable() 65 | { 66 | EditorApplication.update -= Update; 67 | } 68 | 69 | 70 | private void Update() 71 | { 72 | CheckEnableControlRig(); 73 | } 74 | #endif 75 | 76 | 77 | private void CheckEnableControlRig() 78 | { 79 | #if MOBILE_INPUT 80 | EnableControlRig(true); 81 | #else 82 | EnableControlRig(false); 83 | #endif 84 | } 85 | 86 | 87 | private void EnableControlRig(bool enabled) 88 | { 89 | foreach (Transform t in transform) 90 | { 91 | t.gameObject.SetActive(enabled); 92 | } 93 | } 94 | 95 | #if UNITY_EDITOR 96 | public void OnActiveBuildTargetChanged(BuildTarget previousTarget, BuildTarget newTarget) 97 | { 98 | CheckEnableControlRig(); 99 | } 100 | #endif 101 | } 102 | } -------------------------------------------------------------------------------- /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/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/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/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: -------------------------------------------------------------------------------- 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/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/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/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/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/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/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/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/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/Sprites/ButtonAcceleratorOverSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorOverSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb5f6e2757c821940b69cf1456f7865a 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorUpSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f588d850485d0ae479d73cf3bd0b7b00 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowOverSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowOverSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49b611e658efbf443b686a4036f74fe3 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowUpSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4db017495c69e8140a56a0e2b669e3f8 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeOverSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeOverSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b1a64ea234fb2343b8d0686c51280de 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeUpSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 827c9cd4a3943534f909ac6473e17288 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonCameraCycleUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonCameraCycleUpSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonCameraCycleUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3983c59ebf804b4abba687bd7c9e92f 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonResetSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonResetSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonResetSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a94c9a7eb94ceec4a8d67a1890e22e51 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: ResetButton 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 256 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonSpacebarSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonSpacebarSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonSpacebarSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d8675433a508ec47b8f895201eacf20 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: JumpButton 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 1024 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 40, y: 40, z: 40, w: 40} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickOverSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickOverSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5485e2f56028a3c4cb54f5caa167377e 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickUpSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9866a92691696b346901281f2b329034 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleFullUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleFullUpSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleFullUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c6271a290ef75b4c97d58746c86c5b8 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleSlowUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleSlowUpSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleSlowUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d7c6e4896067aa4fa512a00f692ac1c 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/SliderBackgroundSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/SliderBackgroundSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/SliderBackgroundSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea5873cfd9158664f89459f0c9e1d853 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: SliderBackground 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 256 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 31, y: 15, z: 31, w: 15} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/SliderHandleSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/SliderHandleSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/SliderHandleSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0626b924325d1c34cafa6b22297f4e4f 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/TouchpadSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/Assets/Standard Assets/CrossPlatformInput/Sprites/TouchpadSprite.png -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/TouchpadSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4f1fee3de32377429fd1348fae62b10 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: JumpButton 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 1024 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 65, y: 65, z: 65, w: 65} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9c1f30d59412aa4c9412306d8c4bfbe 3 | folderAsset: yes 4 | timeCreated: 1514077290 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Standard 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/Standard 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 | }; 90 | 91 | private static BuildTargetGroup[] mobileBuildTargetGroups = new BuildTargetGroup[] 92 | { 93 | BuildTargetGroup.Android, 94 | BuildTargetGroup.iOS, 95 | BuildTargetGroup.PSM, 96 | BuildTargetGroup.SamsungTV, 97 | BuildTargetGroup.Tizen, 98 | BuildTargetGroup.WSA 99 | }; 100 | 101 | 102 | private static void SetEnabled(string defineName, bool enable, bool mobile) 103 | { 104 | //Debug.Log("setting "+defineName+" to "+enable); 105 | foreach (var group in mobile ? mobileBuildTargetGroups : buildTargetGroups) 106 | { 107 | var defines = GetDefinesList(group); 108 | if (enable) 109 | { 110 | if (defines.Contains(defineName)) 111 | { 112 | return; 113 | } 114 | defines.Add(defineName); 115 | } 116 | else 117 | { 118 | if (!defines.Contains(defineName)) 119 | { 120 | return; 121 | } 122 | while (defines.Contains(defineName)) 123 | { 124 | defines.Remove(defineName); 125 | } 126 | } 127 | string definesString = string.Join(";", defines.ToArray()); 128 | PlayerSettings.SetScriptingDefineSymbolsForGroup(group, definesString); 129 | } 130 | } 131 | 132 | 133 | private static List GetDefinesList(BuildTargetGroup group) 134 | { 135 | return new List(PlayerSettings.GetScriptingDefineSymbolsForGroup(group).Split(';')); 136 | } 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /Assets/Standard 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/Utility.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4539eb30e895bbb41b5eae6df2dde978 3 | folderAsset: yes 4 | timeCreated: 1436977288 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ActivateTrigger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using Object = UnityEngine.Object; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class ActivateTrigger : MonoBehaviour 8 | { 9 | // A multi-purpose script which causes an action to occur when 10 | // a trigger collider is entered. 11 | public enum Mode 12 | { 13 | Trigger = 0, // Just broadcast the action on to the target 14 | Replace = 1, // replace target with source 15 | Activate = 2, // Activate the target GameObject 16 | Enable = 3, // Enable a component 17 | Animate = 4, // Start animation on target 18 | Deactivate = 5 // Decativate target GameObject 19 | } 20 | 21 | public Mode action = Mode.Activate; // The action to accomplish 22 | public Object target; // The game object to affect. If none, the trigger work on this game object 23 | public GameObject source; 24 | public int triggerCount = 1; 25 | public bool repeatTrigger = false; 26 | 27 | 28 | private void DoActivateTrigger() 29 | { 30 | triggerCount--; 31 | 32 | if (triggerCount == 0 || repeatTrigger) 33 | { 34 | Object currentTarget = target ?? gameObject; 35 | Behaviour targetBehaviour = currentTarget as Behaviour; 36 | GameObject targetGameObject = currentTarget as GameObject; 37 | if (targetBehaviour != null) 38 | { 39 | targetGameObject = targetBehaviour.gameObject; 40 | } 41 | 42 | switch (action) 43 | { 44 | case Mode.Trigger: 45 | if (targetGameObject != null) 46 | { 47 | targetGameObject.BroadcastMessage("DoActivateTrigger"); 48 | } 49 | break; 50 | case Mode.Replace: 51 | if (source != null) 52 | { 53 | if (targetGameObject != null) 54 | { 55 | Instantiate(source, targetGameObject.transform.position, 56 | targetGameObject.transform.rotation); 57 | DestroyObject(targetGameObject); 58 | } 59 | } 60 | break; 61 | case Mode.Activate: 62 | if (targetGameObject != null) 63 | { 64 | targetGameObject.SetActive(true); 65 | } 66 | break; 67 | case Mode.Enable: 68 | if (targetBehaviour != null) 69 | { 70 | targetBehaviour.enabled = true; 71 | } 72 | break; 73 | case Mode.Animate: 74 | if (targetGameObject != null) 75 | { 76 | targetGameObject.GetComponent().Play(); 77 | } 78 | break; 79 | case Mode.Deactivate: 80 | if (targetGameObject != null) 81 | { 82 | targetGameObject.SetActive(false); 83 | } 84 | break; 85 | } 86 | } 87 | } 88 | 89 | 90 | private void OnTriggerEnter(Collider other) 91 | { 92 | DoActivateTrigger(); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ActivateTrigger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8634e062924929664361c08745211fb 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/AlphaButtonClickMask.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | 5 | public class AlphaButtonClickMask : MonoBehaviour, ICanvasRaycastFilter 6 | { 7 | protected Image _image; 8 | 9 | public void Start() 10 | { 11 | _image = GetComponent(); 12 | 13 | Texture2D tex = _image.sprite.texture as Texture2D; 14 | 15 | bool isInvalid = false; 16 | if (tex != null) 17 | { 18 | try 19 | { 20 | tex.GetPixels32(); 21 | } 22 | catch (UnityException e) 23 | { 24 | Debug.LogError(e.Message); 25 | isInvalid = true; 26 | } 27 | } 28 | else 29 | { 30 | isInvalid = true; 31 | } 32 | 33 | if (isInvalid) 34 | { 35 | Debug.LogError("This script need an Image with a readbale Texture2D to work."); 36 | } 37 | } 38 | 39 | public bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera) 40 | { 41 | Vector2 localPoint; 42 | RectTransformUtility.ScreenPointToLocalPointInRectangle(_image.rectTransform, sp, eventCamera, out localPoint); 43 | 44 | Vector2 pivot = _image.rectTransform.pivot; 45 | Vector2 normalizedLocal = new Vector2(pivot.x + localPoint.x / _image.rectTransform.rect.width, pivot.y + localPoint.y / _image.rectTransform.rect.height); 46 | Vector2 uv = new Vector2( 47 | _image.sprite.rect.x + normalizedLocal.x * _image.sprite.rect.width, 48 | _image.sprite.rect.y + normalizedLocal.y * _image.sprite.rect.height ); 49 | 50 | uv.x /= _image.sprite.texture.width; 51 | uv.y /= _image.sprite.texture.height; 52 | 53 | //uv are inversed, as 0,0 or the rect transform seem to be upper right, then going negativ toward lower left... 54 | Color c = _image.sprite.texture.GetPixelBilinear(uv.x, uv.y); 55 | 56 | return c.a> 0.1f; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/AlphaButtonClickMask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 971f44ba24a74294294daed00507d80e 3 | timeCreated: 1436868016 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/AutoMobileShaderSwitch.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c4978ff6447f9040b84acc89b0bbdc8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/AutoMoveAndRotate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class AutoMoveAndRotate : MonoBehaviour 7 | { 8 | public Vector3andSpace moveUnitsPerSecond; 9 | public Vector3andSpace rotateDegreesPerSecond; 10 | public bool ignoreTimescale; 11 | private float m_LastRealTime; 12 | 13 | 14 | private void Start() 15 | { 16 | m_LastRealTime = Time.realtimeSinceStartup; 17 | } 18 | 19 | 20 | // Update is called once per frame 21 | private void Update() 22 | { 23 | float deltaTime = Time.deltaTime; 24 | if (ignoreTimescale) 25 | { 26 | deltaTime = (Time.realtimeSinceStartup - m_LastRealTime); 27 | m_LastRealTime = Time.realtimeSinceStartup; 28 | } 29 | transform.Translate(moveUnitsPerSecond.value*deltaTime, moveUnitsPerSecond.space); 30 | transform.Rotate(rotateDegreesPerSecond.value*deltaTime, moveUnitsPerSecond.space); 31 | } 32 | 33 | 34 | [Serializable] 35 | public class Vector3andSpace 36 | { 37 | public Vector3 value; 38 | public Space space = Space.Self; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/AutoMoveAndRotate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1347817507220a4384f3ff6f7c24546 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/CameraRefocus.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class CameraRefocus 7 | { 8 | public Camera Camera; 9 | public Vector3 Lookatpoint; 10 | public Transform Parent; 11 | 12 | private Vector3 m_OrigCameraPos; 13 | private bool m_Refocus; 14 | 15 | 16 | public CameraRefocus(Camera camera, Transform parent, Vector3 origCameraPos) 17 | { 18 | m_OrigCameraPos = origCameraPos; 19 | Camera = camera; 20 | Parent = parent; 21 | } 22 | 23 | 24 | public void ChangeCamera(Camera camera) 25 | { 26 | Camera = camera; 27 | } 28 | 29 | 30 | public void ChangeParent(Transform parent) 31 | { 32 | Parent = parent; 33 | } 34 | 35 | 36 | public void GetFocusPoint() 37 | { 38 | RaycastHit hitInfo; 39 | if (Physics.Raycast(Parent.transform.position + m_OrigCameraPos, Parent.transform.forward, out hitInfo, 40 | 100f)) 41 | { 42 | Lookatpoint = hitInfo.point; 43 | m_Refocus = true; 44 | return; 45 | } 46 | m_Refocus = false; 47 | } 48 | 49 | 50 | public void SetFocusPoint() 51 | { 52 | if (m_Refocus) 53 | { 54 | Camera.transform.LookAt(Lookatpoint); 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/CameraRefocus.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1e2e7a54dcc8694ab1eca46d072f264 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/CurveControlledBob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | [Serializable] 8 | public class CurveControlledBob 9 | { 10 | public float HorizontalBobRange = 0.33f; 11 | public float VerticalBobRange = 0.33f; 12 | public AnimationCurve Bobcurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.5f, 1f), 13 | new Keyframe(1f, 0f), new Keyframe(1.5f, -1f), 14 | new Keyframe(2f, 0f)); // sin curve for head bob 15 | public float VerticaltoHorizontalRatio = 1f; 16 | 17 | private float m_CyclePositionX; 18 | private float m_CyclePositionY; 19 | private float m_BobBaseInterval; 20 | private Vector3 m_OriginalCameraPosition; 21 | private float m_Time; 22 | 23 | 24 | public void Setup(Camera camera, float bobBaseInterval) 25 | { 26 | m_BobBaseInterval = bobBaseInterval; 27 | m_OriginalCameraPosition = camera.transform.localPosition; 28 | 29 | // get the length of the curve in time 30 | m_Time = Bobcurve[Bobcurve.length - 1].time; 31 | } 32 | 33 | 34 | public Vector3 DoHeadBob(float speed) 35 | { 36 | float xPos = m_OriginalCameraPosition.x + (Bobcurve.Evaluate(m_CyclePositionX)*HorizontalBobRange); 37 | float yPos = m_OriginalCameraPosition.y + (Bobcurve.Evaluate(m_CyclePositionY)*VerticalBobRange); 38 | 39 | m_CyclePositionX += (speed*Time.deltaTime)/m_BobBaseInterval; 40 | m_CyclePositionY += ((speed*Time.deltaTime)/m_BobBaseInterval)*VerticaltoHorizontalRatio; 41 | 42 | if (m_CyclePositionX > m_Time) 43 | { 44 | m_CyclePositionX = m_CyclePositionX - m_Time; 45 | } 46 | if (m_CyclePositionY > m_Time) 47 | { 48 | m_CyclePositionY = m_CyclePositionY - m_Time; 49 | } 50 | 51 | return new Vector3(xPos, yPos, 0f); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/CurveControlledBob.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 492f54f4accf00440828ffcb9e4fcc19 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/DragRigidbody.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class DragRigidbody : MonoBehaviour 8 | { 9 | const float k_Spring = 50.0f; 10 | const float k_Damper = 5.0f; 11 | const float k_Drag = 10.0f; 12 | const float k_AngularDrag = 5.0f; 13 | const float k_Distance = 0.2f; 14 | const bool k_AttachToCenterOfMass = false; 15 | 16 | private SpringJoint m_SpringJoint; 17 | 18 | 19 | private void Update() 20 | { 21 | // Make sure the user pressed the mouse down 22 | if (!Input.GetMouseButtonDown(0)) 23 | { 24 | return; 25 | } 26 | 27 | var mainCamera = FindCamera(); 28 | 29 | // We need to actually hit an object 30 | RaycastHit hit = new RaycastHit(); 31 | if ( 32 | !Physics.Raycast(mainCamera.ScreenPointToRay(Input.mousePosition).origin, 33 | mainCamera.ScreenPointToRay(Input.mousePosition).direction, out hit, 100, 34 | Physics.DefaultRaycastLayers)) 35 | { 36 | return; 37 | } 38 | // We need to hit a rigidbody that is not kinematic 39 | if (!hit.rigidbody || hit.rigidbody.isKinematic) 40 | { 41 | return; 42 | } 43 | 44 | if (!m_SpringJoint) 45 | { 46 | var go = new GameObject("Rigidbody dragger"); 47 | Rigidbody body = go.AddComponent(); 48 | m_SpringJoint = go.AddComponent(); 49 | body.isKinematic = true; 50 | } 51 | 52 | m_SpringJoint.transform.position = hit.point; 53 | m_SpringJoint.anchor = Vector3.zero; 54 | 55 | m_SpringJoint.spring = k_Spring; 56 | m_SpringJoint.damper = k_Damper; 57 | m_SpringJoint.maxDistance = k_Distance; 58 | m_SpringJoint.connectedBody = hit.rigidbody; 59 | 60 | StartCoroutine("DragObject", hit.distance); 61 | } 62 | 63 | 64 | private IEnumerator DragObject(float distance) 65 | { 66 | var oldDrag = m_SpringJoint.connectedBody.drag; 67 | var oldAngularDrag = m_SpringJoint.connectedBody.angularDrag; 68 | m_SpringJoint.connectedBody.drag = k_Drag; 69 | m_SpringJoint.connectedBody.angularDrag = k_AngularDrag; 70 | var mainCamera = FindCamera(); 71 | while (Input.GetMouseButton(0)) 72 | { 73 | var ray = mainCamera.ScreenPointToRay(Input.mousePosition); 74 | m_SpringJoint.transform.position = ray.GetPoint(distance); 75 | yield return null; 76 | } 77 | if (m_SpringJoint.connectedBody) 78 | { 79 | m_SpringJoint.connectedBody.drag = oldDrag; 80 | m_SpringJoint.connectedBody.angularDrag = oldAngularDrag; 81 | m_SpringJoint.connectedBody = null; 82 | } 83 | } 84 | 85 | 86 | private Camera FindCamera() 87 | { 88 | if (GetComponent()) 89 | { 90 | return GetComponent(); 91 | } 92 | 93 | return Camera.main; 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/DragRigidbody.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58650e15a2607e44daa0f150e0061d89 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/DynamicShadowSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class DynamicShadowSettings : MonoBehaviour 7 | { 8 | public Light sunLight; 9 | public float minHeight = 10; 10 | public float minShadowDistance = 80; 11 | public float minShadowBias = 1; 12 | public float maxHeight = 1000; 13 | public float maxShadowDistance = 10000; 14 | public float maxShadowBias = 0.1f; 15 | public float adaptTime = 1; 16 | 17 | private float m_SmoothHeight; 18 | private float m_ChangeSpeed; 19 | private float m_OriginalStrength = 1; 20 | 21 | 22 | private void Start() 23 | { 24 | m_OriginalStrength = sunLight.shadowStrength; 25 | } 26 | 27 | 28 | // Update is called once per frame 29 | private void Update() 30 | { 31 | Ray ray = new Ray(Camera.main.transform.position, -Vector3.up); 32 | RaycastHit hit; 33 | float height = transform.position.y; 34 | if (Physics.Raycast(ray, out hit)) 35 | { 36 | height = hit.distance; 37 | } 38 | 39 | if (Mathf.Abs(height - m_SmoothHeight) > 1) 40 | { 41 | m_SmoothHeight = Mathf.SmoothDamp(m_SmoothHeight, height, ref m_ChangeSpeed, adaptTime); 42 | } 43 | 44 | float i = Mathf.InverseLerp(minHeight, maxHeight, m_SmoothHeight); 45 | 46 | QualitySettings.shadowDistance = Mathf.Lerp(minShadowDistance, maxShadowDistance, i); 47 | sunLight.shadowBias = Mathf.Lerp(minShadowBias, maxShadowBias, 1 - ((1 - i)*(1 - i))); 48 | sunLight.shadowStrength = Mathf.Lerp(m_OriginalStrength, 0, i); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/DynamicShadowSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8566902b50d5bfb4fb7f8b89f9cdbe8b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/EventSystemChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | using UnityEngine.EventSystems; 5 | 6 | public class EventSystemChecker : MonoBehaviour 7 | { 8 | //public GameObject eventSystem; 9 | 10 | // Use this for initialization 11 | void Awake () 12 | { 13 | if(!FindObjectOfType()) 14 | { 15 | //Instantiate(eventSystem); 16 | GameObject obj = new GameObject("EventSystem"); 17 | obj.AddComponent(); 18 | obj.AddComponent().forceModuleActive = true; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/EventSystemChecker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c0578910bbe00d43919a92c7b9893fe 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FOVKick.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | [Serializable] 8 | public class FOVKick 9 | { 10 | public Camera Camera; // optional camera setup, if null the main camera will be used 11 | [HideInInspector] public float originalFov; // the original fov 12 | public float FOVIncrease = 3f; // the amount the field of view increases when going into a run 13 | public float TimeToIncrease = 1f; // the amount of time the field of view will increase over 14 | public float TimeToDecrease = 1f; // the amount of time the field of view will take to return to its original size 15 | public AnimationCurve IncreaseCurve; 16 | 17 | 18 | public void Setup(Camera camera) 19 | { 20 | CheckStatus(camera); 21 | 22 | Camera = camera; 23 | originalFov = camera.fieldOfView; 24 | } 25 | 26 | 27 | private void CheckStatus(Camera camera) 28 | { 29 | if (camera == null) 30 | { 31 | throw new Exception("FOVKick camera is null, please supply the camera to the constructor"); 32 | } 33 | 34 | if (IncreaseCurve == null) 35 | { 36 | throw new Exception( 37 | "FOVKick Increase curve is null, please define the curve for the field of view kicks"); 38 | } 39 | } 40 | 41 | 42 | public void ChangeCamera(Camera camera) 43 | { 44 | Camera = camera; 45 | } 46 | 47 | 48 | public IEnumerator FOVKickUp() 49 | { 50 | float t = Mathf.Abs((Camera.fieldOfView - originalFov)/FOVIncrease); 51 | while (t < TimeToIncrease) 52 | { 53 | Camera.fieldOfView = originalFov + (IncreaseCurve.Evaluate(t/TimeToIncrease)*FOVIncrease); 54 | t += Time.deltaTime; 55 | yield return new WaitForEndOfFrame(); 56 | } 57 | } 58 | 59 | 60 | public IEnumerator FOVKickDown() 61 | { 62 | float t = Mathf.Abs((Camera.fieldOfView - originalFov)/FOVIncrease); 63 | while (t > 0) 64 | { 65 | Camera.fieldOfView = originalFov + (IncreaseCurve.Evaluate(t/TimeToDecrease)*FOVIncrease); 66 | t -= Time.deltaTime; 67 | yield return new WaitForEndOfFrame(); 68 | } 69 | //make sure that fov returns to the original size 70 | Camera.fieldOfView = originalFov; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FOVKick.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6045a93fb05b9c74884821030da2c46c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FPSCounter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | [RequireComponent(typeof (Text))] 8 | public class FPSCounter : MonoBehaviour 9 | { 10 | const float fpsMeasurePeriod = 0.5f; 11 | private int m_FpsAccumulator = 0; 12 | private float m_FpsNextPeriod = 0; 13 | private int m_CurrentFps; 14 | const string display = "{0} FPS"; 15 | private Text m_Text; 16 | 17 | 18 | private void Start() 19 | { 20 | m_FpsNextPeriod = Time.realtimeSinceStartup + fpsMeasurePeriod; 21 | m_Text = GetComponent(); 22 | } 23 | 24 | 25 | private void Update() 26 | { 27 | // measure average frames per second 28 | m_FpsAccumulator++; 29 | if (Time.realtimeSinceStartup > m_FpsNextPeriod) 30 | { 31 | m_CurrentFps = (int) (m_FpsAccumulator/fpsMeasurePeriod); 32 | m_FpsAccumulator = 0; 33 | m_FpsNextPeriod += fpsMeasurePeriod; 34 | m_Text.text = string.Format(display, m_CurrentFps); 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FPSCounter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22bbf57ec543cee42a5aa0ec2dd9e457 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FollowTarget.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class FollowTarget : MonoBehaviour 8 | { 9 | public Transform target; 10 | public Vector3 offset = new Vector3(0f, 7.5f, 0f); 11 | 12 | 13 | private void LateUpdate() 14 | { 15 | transform.position = target.position + offset; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FollowTarget.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 246cc59c7a84ea44f87f6b70acfe30c5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ForcedReset.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.SceneManagement; 4 | using UnityStandardAssets.CrossPlatformInput; 5 | 6 | [RequireComponent(typeof (GUITexture))] 7 | public class ForcedReset : MonoBehaviour 8 | { 9 | private void Update() 10 | { 11 | // if we have forced a reset ... 12 | if (CrossPlatformInputManager.GetButtonDown("ResetObject")) 13 | { 14 | //... reload the scene 15 | SceneManager.LoadScene(SceneManager.GetSceneAt(0).name); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ForcedReset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b886447cba80f74e820adb3c9e70c76 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/LerpControlledBob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | [Serializable] 8 | public class LerpControlledBob 9 | { 10 | public float BobDuration; 11 | public float BobAmount; 12 | 13 | private float m_Offset = 0f; 14 | 15 | 16 | // provides the offset that can be used 17 | public float Offset() 18 | { 19 | return m_Offset; 20 | } 21 | 22 | 23 | public IEnumerator DoBobCycle() 24 | { 25 | // make the camera move down slightly 26 | float t = 0f; 27 | while (t < BobDuration) 28 | { 29 | m_Offset = Mathf.Lerp(0f, BobAmount, t/BobDuration); 30 | t += Time.deltaTime; 31 | yield return new WaitForFixedUpdate(); 32 | } 33 | 34 | // make it move back to neutral 35 | t = 0f; 36 | while (t < BobDuration) 37 | { 38 | m_Offset = Mathf.Lerp(BobAmount, 0f, t/BobDuration); 39 | t += Time.deltaTime; 40 | yield return new WaitForFixedUpdate(); 41 | } 42 | m_Offset = 0f; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/LerpControlledBob.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1bbfafbde15c854681023b9e01e12dd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ObjectResetter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace UnityStandardAssets.Utility 7 | { 8 | public class ObjectResetter : MonoBehaviour 9 | { 10 | private Vector3 originalPosition; 11 | private Quaternion originalRotation; 12 | private List originalStructure; 13 | 14 | private Rigidbody Rigidbody; 15 | 16 | // Use this for initialization 17 | private void Start() 18 | { 19 | originalStructure = new List(GetComponentsInChildren()); 20 | originalPosition = transform.position; 21 | originalRotation = transform.rotation; 22 | 23 | Rigidbody = GetComponent(); 24 | } 25 | 26 | 27 | public void DelayedReset(float delay) 28 | { 29 | StartCoroutine(ResetCoroutine(delay)); 30 | } 31 | 32 | 33 | public IEnumerator ResetCoroutine(float delay) 34 | { 35 | yield return new WaitForSeconds(delay); 36 | 37 | // remove any gameobjects added (fire, skid trails, etc) 38 | foreach (var t in GetComponentsInChildren()) 39 | { 40 | if (!originalStructure.Contains(t)) 41 | { 42 | t.parent = null; 43 | } 44 | } 45 | 46 | transform.position = originalPosition; 47 | transform.rotation = originalRotation; 48 | if (Rigidbody) 49 | { 50 | Rigidbody.velocity = Vector3.zero; 51 | Rigidbody.angularVelocity = Vector3.zero; 52 | } 53 | 54 | SendMessage("Reset"); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ObjectResetter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 643c971818f68d3439e84b5d8bdafe07 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ParticleSystemDestroyer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | using Random = UnityEngine.Random; 5 | 6 | namespace UnityStandardAssets.Utility 7 | { 8 | public class ParticleSystemDestroyer : MonoBehaviour 9 | { 10 | // allows a particle system to exist for a specified duration, 11 | // then shuts off emission, and waits for all particles to expire 12 | // before destroying the gameObject 13 | 14 | public float minDuration = 8; 15 | public float maxDuration = 10; 16 | 17 | private float m_MaxLifetime; 18 | private bool m_EarlyStop; 19 | 20 | 21 | private IEnumerator Start() 22 | { 23 | var systems = GetComponentsInChildren(); 24 | 25 | // find out the maximum lifetime of any particles in this effect 26 | foreach (var system in systems) 27 | { 28 | m_MaxLifetime = Mathf.Max(system.main.startLifetime.constant, m_MaxLifetime); 29 | } 30 | 31 | // wait for random duration 32 | 33 | float stopTime = Time.time + Random.Range(minDuration, maxDuration); 34 | 35 | while (Time.time < stopTime && !m_EarlyStop) 36 | { 37 | yield return null; 38 | } 39 | Debug.Log("stopping " + name); 40 | 41 | // turn off emission 42 | foreach (var system in systems) 43 | { 44 | var emission = system.emission; 45 | emission.enabled = false; 46 | } 47 | BroadcastMessage("Extinguish", SendMessageOptions.DontRequireReceiver); 48 | 49 | // wait for any remaining particles to expire 50 | yield return new WaitForSeconds(m_MaxLifetime); 51 | 52 | Destroy(gameObject); 53 | } 54 | 55 | 56 | public void Stop() 57 | { 58 | // stops the particle system early 59 | m_EarlyStop = true; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ParticleSystemDestroyer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29014cd42b6d273408e0ceefd336c0b3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/PlatformSpecificContent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | #if UNITY_EDITOR 4 | using UnityEditor; 5 | #endif 6 | 7 | namespace UnityStandardAssets.Utility 8 | { 9 | #if UNITY_EDITOR 10 | 11 | [ExecuteInEditMode] 12 | #endif 13 | public class PlatformSpecificContent : MonoBehaviour 14 | #if UNITY_EDITOR 15 | , UnityEditor.Build.IActiveBuildTargetChanged 16 | #endif 17 | { 18 | private enum BuildTargetGroup 19 | { 20 | Standalone, 21 | Mobile 22 | } 23 | 24 | [SerializeField] 25 | private BuildTargetGroup m_BuildTargetGroup; 26 | [SerializeField] 27 | private GameObject[] m_Content = new GameObject[0]; 28 | [SerializeField] 29 | private MonoBehaviour[] m_MonoBehaviours = new MonoBehaviour[0]; 30 | [SerializeField] 31 | private bool m_ChildrenOfThisObject; 32 | 33 | #if !UNITY_EDITOR 34 | void OnEnable() 35 | { 36 | CheckEnableContent(); 37 | } 38 | #else 39 | public int callbackOrder 40 | { 41 | get 42 | { 43 | return 1; 44 | } 45 | } 46 | #endif 47 | 48 | #if UNITY_EDITOR 49 | 50 | private void OnEnable() 51 | { 52 | EditorApplication.update += Update; 53 | } 54 | 55 | 56 | private void OnDisable() 57 | { 58 | EditorApplication.update -= Update; 59 | } 60 | 61 | public void OnActiveBuildTargetChanged(BuildTarget previousTarget, BuildTarget newTarget) 62 | { 63 | CheckEnableContent(); 64 | } 65 | 66 | private void Update() 67 | { 68 | CheckEnableContent(); 69 | } 70 | #endif 71 | 72 | 73 | private void CheckEnableContent() 74 | { 75 | #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_TIZEN || UNITY_STV ) 76 | if (m_BuildTargetGroup == BuildTargetGroup.Mobile) 77 | { 78 | EnableContent(true); 79 | } else { 80 | EnableContent(false); 81 | } 82 | #endif 83 | 84 | #if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_TIZEN || UNITY_STV ) 85 | if (m_BuildTargetGroup == BuildTargetGroup.Mobile) 86 | { 87 | EnableContent(false); 88 | } 89 | else 90 | { 91 | EnableContent(true); 92 | } 93 | #endif 94 | } 95 | 96 | 97 | private void EnableContent(bool enabled) 98 | { 99 | if (m_Content.Length > 0) 100 | { 101 | foreach (var g in m_Content) 102 | { 103 | if (g != null) 104 | { 105 | g.SetActive(enabled); 106 | } 107 | } 108 | } 109 | if (m_ChildrenOfThisObject) 110 | { 111 | foreach (Transform t in transform) 112 | { 113 | t.gameObject.SetActive(enabled); 114 | } 115 | } 116 | if (m_MonoBehaviours.Length > 0) 117 | { 118 | foreach (var monoBehaviour in m_MonoBehaviours) 119 | { 120 | monoBehaviour.enabled = enabled; 121 | } 122 | } 123 | } 124 | } 125 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/PlatformSpecificContent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b27507c5d0efbbd47ac8c1de9a1a0a35 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b43a4ef15621158419a2b639f7a98245 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/Prefabs/FramerateCounter.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 | - 224: {fileID: 22409990} 11 | - 223: {fileID: 22323452} 12 | - 114: {fileID: 11403178} 13 | - 114: {fileID: 11448042} 14 | m_Layer: 5 15 | m_Name: FramerateCounter 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!1 &167734 22 | GameObject: 23 | m_ObjectHideFlags: 0 24 | m_PrefabParentObject: {fileID: 0} 25 | m_PrefabInternal: {fileID: 100100000} 26 | serializedVersion: 4 27 | m_Component: 28 | - 224: {fileID: 22488988} 29 | - 222: {fileID: 22250932} 30 | - 114: {fileID: 11410038} 31 | - 114: {fileID: 11400482} 32 | m_Layer: 5 33 | m_Name: Text 34 | m_TagString: Untagged 35 | m_Icon: {fileID: 0} 36 | m_NavMeshLayer: 0 37 | m_StaticEditorFlags: 0 38 | m_IsActive: 1 39 | --- !u!114 &11400482 40 | MonoBehaviour: 41 | m_ObjectHideFlags: 1 42 | m_PrefabParentObject: {fileID: 0} 43 | m_PrefabInternal: {fileID: 100100000} 44 | m_GameObject: {fileID: 167734} 45 | m_Enabled: 1 46 | m_EditorHideFlags: 0 47 | m_Script: {fileID: 11500000, guid: 22bbf57ec543cee42a5aa0ec2dd9e457, type: 3} 48 | m_Name: 49 | m_EditorClassIdentifier: 50 | --- !u!114 &11403178 51 | MonoBehaviour: 52 | m_ObjectHideFlags: 1 53 | m_PrefabParentObject: {fileID: 0} 54 | m_PrefabInternal: {fileID: 100100000} 55 | m_GameObject: {fileID: 100000} 56 | m_Enabled: 1 57 | m_EditorHideFlags: 0 58 | m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 59 | m_Name: 60 | m_EditorClassIdentifier: 61 | m_UiScaleMode: 0 62 | m_ReferencePixelsPerUnit: 100 63 | m_ScaleFactor: 1 64 | m_ReferenceResolution: {x: 800, y: 600} 65 | m_ScreenMatchMode: 0 66 | m_MatchWidthOrHeight: 0 67 | m_PhysicalUnit: 3 68 | m_FallbackScreenDPI: 96 69 | m_DefaultSpriteDPI: 96 70 | m_DynamicPixelsPerUnit: 1 71 | --- !u!114 &11410038 72 | MonoBehaviour: 73 | m_ObjectHideFlags: 1 74 | m_PrefabParentObject: {fileID: 0} 75 | m_PrefabInternal: {fileID: 100100000} 76 | m_GameObject: {fileID: 167734} 77 | m_Enabled: 1 78 | m_EditorHideFlags: 0 79 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 80 | m_Name: 81 | m_EditorClassIdentifier: 82 | m_Material: {fileID: 0} 83 | m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1} 84 | m_FontData: 85 | m_Font: {fileID: 12800000, guid: b51a3e520f9164da198dc59c8acfccd6, type: 3} 86 | m_FontSize: 18 87 | m_FontStyle: 0 88 | m_BestFit: 0 89 | m_MinSize: 10 90 | m_MaxSize: 40 91 | m_Alignment: 4 92 | m_RichText: 0 93 | m_HorizontalOverflow: 0 94 | m_VerticalOverflow: 0 95 | m_LineSpacing: 1 96 | m_Text: 'FPS 97 | 98 | ' 99 | --- !u!114 &11448042 100 | MonoBehaviour: 101 | m_ObjectHideFlags: 1 102 | m_PrefabParentObject: {fileID: 0} 103 | m_PrefabInternal: {fileID: 100100000} 104 | m_GameObject: {fileID: 100000} 105 | m_Enabled: 1 106 | m_EditorHideFlags: 0 107 | m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 108 | m_Name: 109 | m_EditorClassIdentifier: 110 | m_IgnoreReversedGraphics: 1 111 | m_BlockingObjects: 0 112 | m_BlockingMask: 113 | serializedVersion: 2 114 | m_Bits: 4294967295 115 | --- !u!222 &22250932 116 | CanvasRenderer: 117 | m_ObjectHideFlags: 1 118 | m_PrefabParentObject: {fileID: 0} 119 | m_PrefabInternal: {fileID: 100100000} 120 | m_GameObject: {fileID: 167734} 121 | --- !u!223 &22323452 122 | Canvas: 123 | m_ObjectHideFlags: 1 124 | m_PrefabParentObject: {fileID: 0} 125 | m_PrefabInternal: {fileID: 100100000} 126 | m_GameObject: {fileID: 100000} 127 | m_Enabled: 1 128 | serializedVersion: 2 129 | m_RenderMode: 0 130 | m_Camera: {fileID: 0} 131 | m_PlaneDistance: 100 132 | m_PixelPerfect: 0 133 | m_ReceivesEvents: 1 134 | m_OverrideSorting: 0 135 | m_OverridePixelPerfect: 0 136 | m_SortingLayerID: 0 137 | m_SortingOrder: 0 138 | --- !u!224 &22409990 139 | RectTransform: 140 | m_ObjectHideFlags: 1 141 | m_PrefabParentObject: {fileID: 0} 142 | m_PrefabInternal: {fileID: 100100000} 143 | m_GameObject: {fileID: 100000} 144 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 145 | m_LocalPosition: {x: 0, y: 0, z: 0} 146 | m_LocalScale: {x: 0, y: 0, z: 0} 147 | m_Children: 148 | - {fileID: 22488988} 149 | m_Father: {fileID: 0} 150 | m_RootOrder: 0 151 | m_AnchorMin: {x: 0, y: 0} 152 | m_AnchorMax: {x: 0, y: 0} 153 | m_AnchoredPosition: {x: 0, y: 0} 154 | m_SizeDelta: {x: 0, y: 0} 155 | m_Pivot: {x: 0, y: 0} 156 | --- !u!224 &22488988 157 | RectTransform: 158 | m_ObjectHideFlags: 1 159 | m_PrefabParentObject: {fileID: 0} 160 | m_PrefabInternal: {fileID: 100100000} 161 | m_GameObject: {fileID: 167734} 162 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 163 | m_LocalPosition: {x: 0, y: 0, z: 0} 164 | m_LocalScale: {x: 1, y: 1, z: 1} 165 | m_Children: [] 166 | m_Father: {fileID: 22409990} 167 | m_RootOrder: 0 168 | m_AnchorMin: {x: .5, y: 1} 169 | m_AnchorMax: {x: .5, y: 1} 170 | m_AnchoredPosition: {x: 0, y: 0} 171 | m_SizeDelta: {x: 160, y: 30} 172 | m_Pivot: {x: .5, y: 1} 173 | --- !u!1001 &100100000 174 | Prefab: 175 | m_ObjectHideFlags: 1 176 | serializedVersion: 2 177 | m_Modification: 178 | m_TransformParent: {fileID: 0} 179 | m_Modifications: [] 180 | m_RemovedComponents: [] 181 | m_ParentPrefab: {fileID: 0} 182 | m_RootGameObject: {fileID: 100000} 183 | m_IsPrefabParent: 1 184 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/Prefabs/FramerateCounter.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81154777d5417884981849c5243f6c01 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SimpleActivatorMenu.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class SimpleActivatorMenu : MonoBehaviour 7 | { 8 | // An incredibly simple menu which, when given references 9 | // to gameobjects in the scene 10 | public GUIText camSwitchButton; 11 | public GameObject[] objects; 12 | 13 | 14 | private int m_CurrentActiveObject; 15 | 16 | 17 | private void OnEnable() 18 | { 19 | // active object starts from first in array 20 | m_CurrentActiveObject = 0; 21 | camSwitchButton.text = objects[m_CurrentActiveObject].name; 22 | } 23 | 24 | 25 | public void NextCamera() 26 | { 27 | int nextactiveobject = m_CurrentActiveObject + 1 >= objects.Length ? 0 : m_CurrentActiveObject + 1; 28 | 29 | for (int i = 0; i < objects.Length; i++) 30 | { 31 | objects[i].SetActive(i == nextactiveobject); 32 | } 33 | 34 | m_CurrentActiveObject = nextactiveobject; 35 | camSwitchButton.text = objects[m_CurrentActiveObject].name; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SimpleActivatorMenu.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69b69a5b0e0a85b4aa97a7edc40c37d1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SimpleMouseRotator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityStandardAssets.CrossPlatformInput; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class SimpleMouseRotator : MonoBehaviour 8 | { 9 | // A mouselook behaviour with constraints which operate relative to 10 | // this gameobject's initial rotation. 11 | // Only rotates around local X and Y. 12 | // Works in local coordinates, so if this object is parented 13 | // to another moving gameobject, its local constraints will 14 | // operate correctly 15 | // (Think: looking out the side window of a car, or a gun turret 16 | // on a moving spaceship with a limited angular range) 17 | // to have no constraints on an axis, set the rotationRange to 360 or greater. 18 | public Vector2 rotationRange = new Vector3(70, 70); 19 | public float rotationSpeed = 10; 20 | public float dampingTime = 0.2f; 21 | public bool autoZeroVerticalOnMobile = true; 22 | public bool autoZeroHorizontalOnMobile = false; 23 | public bool relative = true; 24 | 25 | 26 | private Vector3 m_TargetAngles; 27 | private Vector3 m_FollowAngles; 28 | private Vector3 m_FollowVelocity; 29 | private Quaternion m_OriginalRotation; 30 | 31 | 32 | private void Start() 33 | { 34 | m_OriginalRotation = transform.localRotation; 35 | } 36 | 37 | 38 | private void Update() 39 | { 40 | // we make initial calculations from the original local rotation 41 | transform.localRotation = m_OriginalRotation; 42 | 43 | // read input from mouse or mobile controls 44 | float inputH; 45 | float inputV; 46 | if (relative) 47 | { 48 | inputH = CrossPlatformInputManager.GetAxis("Mouse X"); 49 | inputV = CrossPlatformInputManager.GetAxis("Mouse Y"); 50 | 51 | // wrap values to avoid springing quickly the wrong way from positive to negative 52 | if (m_TargetAngles.y > 180) 53 | { 54 | m_TargetAngles.y -= 360; 55 | m_FollowAngles.y -= 360; 56 | } 57 | if (m_TargetAngles.x > 180) 58 | { 59 | m_TargetAngles.x -= 360; 60 | m_FollowAngles.x -= 360; 61 | } 62 | if (m_TargetAngles.y < -180) 63 | { 64 | m_TargetAngles.y += 360; 65 | m_FollowAngles.y += 360; 66 | } 67 | if (m_TargetAngles.x < -180) 68 | { 69 | m_TargetAngles.x += 360; 70 | m_FollowAngles.x += 360; 71 | } 72 | 73 | #if MOBILE_INPUT 74 | // on mobile, sometimes we want input mapped directly to tilt value, 75 | // so it springs back automatically when the look input is released. 76 | if (autoZeroHorizontalOnMobile) { 77 | m_TargetAngles.y = Mathf.Lerp (-rotationRange.y * 0.5f, rotationRange.y * 0.5f, inputH * .5f + .5f); 78 | } else { 79 | m_TargetAngles.y += inputH * rotationSpeed; 80 | } 81 | if (autoZeroVerticalOnMobile) { 82 | m_TargetAngles.x = Mathf.Lerp (-rotationRange.x * 0.5f, rotationRange.x * 0.5f, inputV * .5f + .5f); 83 | } else { 84 | m_TargetAngles.x += inputV * rotationSpeed; 85 | } 86 | #else 87 | // with mouse input, we have direct control with no springback required. 88 | m_TargetAngles.y += inputH*rotationSpeed; 89 | m_TargetAngles.x += inputV*rotationSpeed; 90 | #endif 91 | 92 | // clamp values to allowed range 93 | m_TargetAngles.y = Mathf.Clamp(m_TargetAngles.y, -rotationRange.y*0.5f, rotationRange.y*0.5f); 94 | m_TargetAngles.x = Mathf.Clamp(m_TargetAngles.x, -rotationRange.x*0.5f, rotationRange.x*0.5f); 95 | } 96 | else 97 | { 98 | inputH = Input.mousePosition.x; 99 | inputV = Input.mousePosition.y; 100 | 101 | // set values to allowed range 102 | m_TargetAngles.y = Mathf.Lerp(-rotationRange.y*0.5f, rotationRange.y*0.5f, inputH/Screen.width); 103 | m_TargetAngles.x = Mathf.Lerp(-rotationRange.x*0.5f, rotationRange.x*0.5f, inputV/Screen.height); 104 | } 105 | 106 | // smoothly interpolate current values to target angles 107 | m_FollowAngles = Vector3.SmoothDamp(m_FollowAngles, m_TargetAngles, ref m_FollowVelocity, dampingTime); 108 | 109 | // update the actual gameobject's rotation 110 | transform.localRotation = m_OriginalRotation*Quaternion.Euler(-m_FollowAngles.x, m_FollowAngles.y, 0); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SimpleMouseRotator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cadd54e4832aeef4b9359f44cbe335cd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SmoothFollow.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace UnityStandardAssets.Utility 4 | { 5 | public class SmoothFollow : MonoBehaviour 6 | { 7 | 8 | // The target we are following 9 | [SerializeField] 10 | private Transform target; 11 | // The distance in the x-z plane to the target 12 | [SerializeField] 13 | private float distance = 10.0f; 14 | // the height we want the camera to be above the target 15 | [SerializeField] 16 | private float height = 5.0f; 17 | 18 | [SerializeField] 19 | private float rotationDamping; 20 | [SerializeField] 21 | private float heightDamping; 22 | 23 | // Use this for initialization 24 | void Start() { } 25 | 26 | // Update is called once per frame 27 | void LateUpdate() 28 | { 29 | // Early out if we don't have a target 30 | if (!target) 31 | return; 32 | 33 | // Calculate the current rotation angles 34 | var wantedRotationAngle = target.eulerAngles.y; 35 | var wantedHeight = target.position.y + height; 36 | 37 | var currentRotationAngle = transform.eulerAngles.y; 38 | var currentHeight = transform.position.y; 39 | 40 | // Damp the rotation around the y-axis 41 | currentRotationAngle = Mathf.LerpAngle(currentRotationAngle, wantedRotationAngle, rotationDamping * Time.deltaTime); 42 | 43 | // Damp the height 44 | currentHeight = Mathf.Lerp(currentHeight, wantedHeight, heightDamping * Time.deltaTime); 45 | 46 | // Convert the angle into a rotation 47 | var currentRotation = Quaternion.Euler(0, currentRotationAngle, 0); 48 | 49 | // Set the position of the camera on the x-z plane to: 50 | // distance meters behind the target 51 | transform.position = target.position; 52 | transform.position -= currentRotation * Vector3.forward * distance; 53 | 54 | // Set the height of the camera 55 | transform.position = new Vector3(transform.position.x ,currentHeight , transform.position.z); 56 | 57 | // Always look at the target 58 | transform.LookAt(target); 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SmoothFollow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f76806479d916a64aa03f8e3eba7912f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/TimedObjectActivator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a7cedf246fca744f90cbdc9dbe41166 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/TimedObjectDestructor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class TimedObjectDestructor : MonoBehaviour 7 | { 8 | [SerializeField] private float m_TimeOut = 1.0f; 9 | [SerializeField] private bool m_DetachChildren = false; 10 | 11 | 12 | private void Awake() 13 | { 14 | Invoke("DestroyNow", m_TimeOut); 15 | } 16 | 17 | 18 | private void DestroyNow() 19 | { 20 | if (m_DetachChildren) 21 | { 22 | transform.DetachChildren(); 23 | } 24 | DestroyObject(gameObject); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/TimedObjectDestructor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37fac21d1f093d344816942d1abce94e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/WaypointCircuit.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70852dc981465ea48bb527b9e33a87fd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/WaypointProgressTracker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class WaypointProgressTracker : MonoBehaviour 7 | { 8 | // This script can be used with any object that is supposed to follow a 9 | // route marked out by waypoints. 10 | 11 | // This script manages the amount to look ahead along the route, 12 | // and keeps track of progress and laps. 13 | 14 | [SerializeField] private WaypointCircuit circuit; // A reference to the waypoint-based route we should follow 15 | 16 | [SerializeField] private float lookAheadForTargetOffset = 5; 17 | // The offset ahead along the route that the we will aim for 18 | 19 | [SerializeField] private float lookAheadForTargetFactor = .1f; 20 | // A multiplier adding distance ahead along the route to aim for, based on current speed 21 | 22 | [SerializeField] private float lookAheadForSpeedOffset = 10; 23 | // The offset ahead only the route for speed adjustments (applied as the rotation of the waypoint target transform) 24 | 25 | [SerializeField] private float lookAheadForSpeedFactor = .2f; 26 | // A multiplier adding distance ahead along the route for speed adjustments 27 | 28 | [SerializeField] private ProgressStyle progressStyle = ProgressStyle.SmoothAlongRoute; 29 | // whether to update the position smoothly along the route (good for curved paths) or just when we reach each waypoint. 30 | 31 | [SerializeField] private float pointToPointThreshold = 4; 32 | // proximity to waypoint which must be reached to switch target to next waypoint : only used in PointToPoint mode. 33 | 34 | public enum ProgressStyle 35 | { 36 | SmoothAlongRoute, 37 | PointToPoint, 38 | } 39 | 40 | // these are public, readable by other objects - i.e. for an AI to know where to head! 41 | public WaypointCircuit.RoutePoint targetPoint { get; private set; } 42 | public WaypointCircuit.RoutePoint speedPoint { get; private set; } 43 | public WaypointCircuit.RoutePoint progressPoint { get; private set; } 44 | 45 | public Transform target; 46 | 47 | private float progressDistance; // The progress round the route, used in smooth mode. 48 | private int progressNum; // the current waypoint number, used in point-to-point mode. 49 | private Vector3 lastPosition; // Used to calculate current speed (since we may not have a rigidbody component) 50 | private float speed; // current speed of this object (calculated from delta since last frame) 51 | 52 | // setup script properties 53 | private void Start() 54 | { 55 | // we use a transform to represent the point to aim for, and the point which 56 | // is considered for upcoming changes-of-speed. This allows this component 57 | // to communicate this information to the AI without requiring further dependencies. 58 | 59 | // You can manually create a transform and assign it to this component *and* the AI, 60 | // then this component will update it, and the AI can read it. 61 | if (target == null) 62 | { 63 | target = new GameObject(name + " Waypoint Target").transform; 64 | } 65 | 66 | Reset(); 67 | } 68 | 69 | 70 | // reset the object to sensible values 71 | public void Reset() 72 | { 73 | progressDistance = 0; 74 | progressNum = 0; 75 | if (progressStyle == ProgressStyle.PointToPoint) 76 | { 77 | target.position = circuit.Waypoints[progressNum].position; 78 | target.rotation = circuit.Waypoints[progressNum].rotation; 79 | } 80 | } 81 | 82 | 83 | private void Update() 84 | { 85 | if (progressStyle == ProgressStyle.SmoothAlongRoute) 86 | { 87 | // determine the position we should currently be aiming for 88 | // (this is different to the current progress position, it is a a certain amount ahead along the route) 89 | // we use lerp as a simple way of smoothing out the speed over time. 90 | if (Time.deltaTime > 0) 91 | { 92 | speed = Mathf.Lerp(speed, (lastPosition - transform.position).magnitude/Time.deltaTime, 93 | Time.deltaTime); 94 | } 95 | target.position = 96 | circuit.GetRoutePoint(progressDistance + lookAheadForTargetOffset + lookAheadForTargetFactor*speed) 97 | .position; 98 | target.rotation = 99 | Quaternion.LookRotation( 100 | circuit.GetRoutePoint(progressDistance + lookAheadForSpeedOffset + lookAheadForSpeedFactor*speed) 101 | .direction); 102 | 103 | 104 | // get our current progress along the route 105 | progressPoint = circuit.GetRoutePoint(progressDistance); 106 | Vector3 progressDelta = progressPoint.position - transform.position; 107 | if (Vector3.Dot(progressDelta, progressPoint.direction) < 0) 108 | { 109 | progressDistance += progressDelta.magnitude*0.5f; 110 | } 111 | 112 | lastPosition = transform.position; 113 | } 114 | else 115 | { 116 | // point to point mode. Just increase the waypoint if we're close enough: 117 | 118 | Vector3 targetDelta = target.position - transform.position; 119 | if (targetDelta.magnitude < pointToPointThreshold) 120 | { 121 | progressNum = (progressNum + 1)%circuit.Waypoints.Length; 122 | } 123 | 124 | 125 | target.position = circuit.Waypoints[progressNum].position; 126 | target.rotation = circuit.Waypoints[progressNum].rotation; 127 | 128 | // get our current progress along the route 129 | progressPoint = circuit.GetRoutePoint(progressDistance); 130 | Vector3 progressDelta = progressPoint.position - transform.position; 131 | if (Vector3.Dot(progressDelta, progressPoint.direction) < 0) 132 | { 133 | progressDistance += progressDelta.magnitude; 134 | } 135 | lastPosition = transform.position; 136 | } 137 | } 138 | 139 | 140 | private void OnDrawGizmos() 141 | { 142 | if (Application.isPlaying) 143 | { 144 | Gizmos.color = Color.green; 145 | Gizmos.DrawLine(transform.position, target.position); 146 | Gizmos.DrawWireSphere(circuit.GetRoutePosition(progressDistance), 1); 147 | Gizmos.color = Color.yellow; 148 | Gizmos.DrawLine(target.position, target.position + target.forward); 149 | } 150 | } 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/WaypointProgressTracker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5cb22d331ef7d64796f917c6a455a32 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/test2.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af5295c394faf604bb2258a4a9d41122 3 | folderAsset: yes 4 | timeCreated: 1493385032 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Jason 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 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2017.3.0f3 2 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DuckBoss/InspectSystem-Unity/815e1a8c1597e60149f6630fe3ef523abb971692/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # InspectSystem-Unity 2 | An inspection/examination system to read in-game signs, walls, etc. 3 | Tested on Unity 2017/2018. 4 | 5 | [![GitHub release](https://img.shields.io/badge/Build-1.03-brightgreen.svg)](https://github.com/DuckBoss/InspectSystem-Unity/releases/latest) 6 | [![Packagist](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/DuckBoss/InspectSystem-Unity/blob/master/LICENSE) 7 | 8 | ## Dependencies 9 | 1) Text Mesh Pro (Available for Free on the Unity Asset Store, used for the in-game UI, can be replaced with default Unity UI elements by messing with the code very easily) 10 | Note: Text Mesh Pro is now a built-in package with Unity 2018+ 11 | 12 | 2) Unity Standard Assets (For the demo project, this isn't required for implementing into your own games) 13 | 14 | ## Demo Scene 15 | - Press 'E' while looking at the sign and standing next to it. 16 | 17 | ## Features 18 | - Supports markup language in text dialogues 19 | - Supports pitch modulated sfx for text dialogues 20 | - Configuration for reinspectable or non-reinspectable objects. (can/cannot inspect items more than once) 21 | - Implemented unityevents that can be executed at the end of inspection dialogues 22 | - Tooltips to help explain inspector variables 23 | 24 | ## Current Issues/Notifications 25 | - Please use the updated release builds for maximum compatibility! 26 | --------------------------------------------------------------------------------