Commit e5fe8e08 authored by Soraphis's avatar Soraphis

smaller fixes

touch input
cleanups
parent 0dbdf554
fileFormatVersion: 2
guid: 4c8d1db166a43564e94df8a347a022ac
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 6
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 2dbcc8b35f6c1ec40a7bd01978d9076e
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
...@@ -26,7 +26,7 @@ MonoBehaviour: ...@@ -26,7 +26,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 40b924e2dad56384a8df2a1e111bb675, type: 3} m_Script: {fileID: 11500000, guid: 40b924e2dad56384a8df2a1e111bb675, type: 3}
m_Name: Vignette m_Name: Vignette
m_EditorClassIdentifier: m_EditorClassIdentifier:
active: 1 active: 0
enabled: enabled:
overrideState: 1 overrideState: 1
value: 1 value: 1
...@@ -69,7 +69,7 @@ MonoBehaviour: ...@@ -69,7 +69,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 48a79b01ea5641d4aa6daa2e23605641, type: 3} m_Script: {fileID: 11500000, guid: 48a79b01ea5641d4aa6daa2e23605641, type: 3}
m_Name: Bloom m_Name: Bloom
m_EditorClassIdentifier: m_EditorClassIdentifier:
active: 1 active: 0
enabled: enabled:
overrideState: 1 overrideState: 1
value: 1 value: 1
......
...@@ -9,7 +9,7 @@ MonoBehaviour: ...@@ -9,7 +9,7 @@ MonoBehaviour:
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8c2fa31169218b543acfac6ff6ce0c2b, type: 3} m_Script: {fileID: 11500000, guid: 8c2fa31169218b543acfac6ff6ce0c2b, type: 3}
m_Name: Player m_Name: KeyCodeInput
m_EditorClassIdentifier: m_EditorClassIdentifier:
jump: 32 jump: 32
peek: 304 peek: 304
......
...@@ -4636,7 +4636,8 @@ MonoBehaviour: ...@@ -4636,7 +4636,8 @@ MonoBehaviour:
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_text: "Programming:\n\tMarkus Schl\xF6sser\n\tJan Meissner\n\tMarcel K\xFChn\n\nLevel m_text: "Programming:\n\tMarkus Schl\xF6sser\n\tJan Meissner\n\tMarcel K\xFChn\n\nLevel
Design:\n\tChristopher Benes\n\nArt:\n\tSvenja Pitzius" Design:\n\tChristopher Benes\n\nArt:\n\tSvenja Pitzius\n\nORGA:\n\tManuel Bu\xDF,
Oliver Biwer"
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 2f03fe920acbab545b9bf0ab1e298973, type: 2} m_fontAsset: {fileID: 11400000, guid: 2f03fe920acbab545b9bf0ab1e298973, type: 2}
m_sharedMaterial: {fileID: 21897336073169014, guid: 2f03fe920acbab545b9bf0ab1e298973, m_sharedMaterial: {fileID: 21897336073169014, guid: 2f03fe920acbab545b9bf0ab1e298973,
...@@ -4679,7 +4680,7 @@ MonoBehaviour: ...@@ -4679,7 +4680,7 @@ MonoBehaviour:
m_lineSpacingMax: 0 m_lineSpacingMax: 0
m_paragraphSpacing: 0 m_paragraphSpacing: 0
m_charWidthMaxAdj: 0 m_charWidthMaxAdj: 0
m_enableWordWrapping: 1 m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4 m_wordWrappingRatios: 0.4
m_overflowMode: 0 m_overflowMode: 0
m_firstOverflowCharacterIndex: -1 m_firstOverflowCharacterIndex: -1
...@@ -4705,12 +4706,12 @@ MonoBehaviour: ...@@ -4705,12 +4706,12 @@ MonoBehaviour:
m_margin: {x: 0, y: 0, z: 0, w: 0} m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo: m_textInfo:
textComponent: {fileID: 2103006732} textComponent: {fileID: 2103006732}
characterCount: 113 characterCount: 146
spriteCount: 0 spriteCount: 0
spaceCount: 20 spaceCount: 27
wordCount: 14 wordCount: 19
linkCount: 0 linkCount: 0
lineCount: 10 lineCount: 13
pageCount: 1 pageCount: 1
materialCount: 2 materialCount: 2
m_havePropertiesChanged: 0 m_havePropertiesChanged: 0
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 83cc98bba1964f969be186525c976885, type: 3}
m_Name: MouseInput
m_EditorClassIdentifier:
fileFormatVersion: 2 fileFormatVersion: 2
guid: b889fc3a95f4efc438d35503ac30a564 guid: f874d95b43de92b40b150e1136fac517
DefaultImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 11400000
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9709528fa3bb4a14a5a35b7955d54a5e, type: 3}
m_Name: TouchInput
m_EditorClassIdentifier:
fileFormatVersion: 2
guid: cf3cd70fe6ad96444a2806dadb1d23d2
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
...@@ -6,4 +6,4 @@ public abstract class InputProvider : ScriptableObject { ...@@ -6,4 +6,4 @@ public abstract class InputProvider : ScriptableObject {
public abstract bool JumpPressed { get; } public abstract bool JumpPressed { get; }
public abstract bool PeekingPressed { get; } public abstract bool PeekingPressed { get; }
public abstract bool InteractionPressed { get; } public abstract bool InteractionPressed { get; }
} }
\ No newline at end of file
using UnityEngine;
[CreateAssetMenu]
class MouseInputProvider : InputProvider {
private PlayerActor player;
public override Vector2 MoveDirection {
get {
var vp = (Vector2) Camera.main.ScreenToViewportPoint(Input.mousePosition);
vp = (vp - Vector2.one * 0.5f) * 2;
if (player == null) player = GameObject.FindObjectOfType<PlayerActor>();
if (player.Orientation == Orientation.Down || player.Orientation == Orientation.Up)
vp.y = 0;
else {
vp.x = vp.y;
vp.y = 0;
}
if (player.Orientation == Orientation.Down) vp.x *= -1;
if (player.Orientation == Orientation.Right) vp.x *= -1;
if(vp.magnitude < 0.3f) return Vector2.zero;
return vp;
}
}
public override bool JumpPressed {
get { return Input.GetMouseButtonDown(0); }
}
public override bool PeekingPressed => false;
public override bool InteractionPressed {
get {
var vp = (Vector2) Camera.main.ScreenToViewportPoint(Input.mousePosition);
vp = (vp - Vector2.one * 0.5f) * 2;
return Input.GetMouseButtonDown(0) && vp.magnitude < 0.3f;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 83cc98bba1964f969be186525c976885
timeCreated: 1538309755
\ No newline at end of file
...@@ -419,6 +419,11 @@ public class PlayerActor : MonoBehaviour, IResetable { ...@@ -419,6 +419,11 @@ public class PlayerActor : MonoBehaviour, IResetable {
} }
} }
public void OnGUI() {
GUI.color = Color.red;
GUI.Label(new Rect(10, 10, 100, 30), inputProvider.MoveDirection.ToString());
}
public void LevelEnd() { public void LevelEnd() {
animator.Play("LevelEnd"); animator.Play("LevelEnd");
enabled = false; enabled = false;
......
using UnityEngine;
[CreateAssetMenu]
class TouchInputProvider : InputProvider {
private PlayerActor player;
public override Vector2 MoveDirection {
get {
if (Input.touchCount < 1) return Vector2.zero;
var vp = (Vector2) Camera.main.ScreenToViewportPoint(Input.GetTouch(0).position);
vp = (vp - Vector2.one * 0.5f) * 2;
if (player == null) player = GameObject.FindObjectOfType<PlayerActor>();
if (player.Orientation == Orientation.Down || player.Orientation == Orientation.Up)
vp.y = 0;
else {
vp.x = vp.y;
vp.y = 0;
}
if (player.Orientation == Orientation.Down) vp.x *= -1;
if (player.Orientation == Orientation.Right) vp.x *= -1;
if(vp.magnitude < 0.3f) return Vector2.zero;
return vp;
}
}
public override bool JumpPressed {
get {
return Input.touchCount > 1;
}
}
public override bool PeekingPressed => false;
public override bool InteractionPressed {
get {
if (Input.touchCount < 1) return false;
var vp = (Vector2) Camera.main.ScreenToViewportPoint(Input.GetTouch(0).position);
vp = (vp - Vector2.one * 0.5f) * 2;
return vp.magnitude < 0.3f;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 9709528fa3bb4a14a5a35b7955d54a5e
timeCreated: 1538303217
\ No newline at end of file
This diff is collapsed.
...@@ -32,40 +32,40 @@ EditorBuildSettings: ...@@ -32,40 +32,40 @@ EditorBuildSettings:
- enabled: 1 - enabled: 1
path: Assets/_Game/Scenes/Levels/Level08.unity path: Assets/_Game/Scenes/Levels/Level08.unity
guid: 7efe599e3ba0e3847a1a72ba64d52964 guid: 7efe599e3ba0e3847a1a72ba64d52964
- enabled: 1 - enabled: 0
path: Assets/_Game/Scenes/Levels/Level09.unity path: Assets/_Game/Scenes/Levels/Level09.unity
guid: 54a2da4869f066146ac7e96c1d928268 guid: 54a2da4869f066146ac7e96c1d928268
- enabled: 1 - enabled: 0
path: Assets/_Game/Scenes/Levels/Level10.unity path: Assets/_Game/Scenes/Levels/Level10.unity
guid: ae1f42e26f8e8284cbd29de81db8c512 guid: ae1f42e26f8e8284cbd29de81db8c512
- enabled: 1 - enabled: 0
path: Assets/_Game/Scenes/Levels/Level11.unity path: Assets/_Game/Scenes/Levels/Level11.unity
guid: d8b67caee1215a74eb82cfb0df143577 guid: d8b67caee1215a74eb82cfb0df143577
- enabled: 1 - enabled: 0
path: Assets/_Game/Scenes/Levels/Level12.unity path: Assets/_Game/Scenes/Levels/Level12.unity
guid: 654f9df6a8a66144e887e501198aa8ff guid: 654f9df6a8a66144e887e501198aa8ff
- enabled: 1 - enabled: 0
path: Assets/_Game/Scenes/Levels/Level13.unity path: Assets/_Game/Scenes/Levels/Level13.unity
guid: 2713412f4cbbd3e4bb6b5f521d834c70 guid: 2713412f4cbbd3e4bb6b5f521d834c70
- enabled: 1 - enabled: 0
path: Assets/_Game/Scenes/Levels/Level14.unity path: Assets/_Game/Scenes/Levels/Level14.unity
guid: 363a002c4d08c25409341d2a7fed4de1 guid: 363a002c4d08c25409341d2a7fed4de1
- enabled: 1 - enabled: 0
path: Assets/_Game/Scenes/Levels/Level15.unity path: Assets/_Game/Scenes/Levels/Level15.unity
guid: 9371fda64737d4442b4097fec4a95911 guid: 9371fda64737d4442b4097fec4a95911
- enabled: 1 - enabled: 0
path: Assets/_Game/Scenes/Levels/Level16.unity path: Assets/_Game/Scenes/Levels/Level16.unity
guid: df3d924b524ca944aa4f8fe3514771dc guid: df3d924b524ca944aa4f8fe3514771dc
- enabled: 1 - enabled: 0
path: Assets/_Game/Scenes/Levels/Level17.unity path: Assets/_Game/Scenes/Levels/Level17.unity
guid: b2af79685c49a3748b2bb639938870af guid: b2af79685c49a3748b2bb639938870af
- enabled: 1 - enabled: 0
path: Assets/_Game/Scenes/Levels/Level18.unity path: Assets/_Game/Scenes/Levels/Level18.unity
guid: 3c7a56ee5bd943a42b9c70590232895f guid: 3c7a56ee5bd943a42b9c70590232895f
- enabled: 1 - enabled: 0
path: Assets/_Game/Scenes/Levels/Level19.unity path: Assets/_Game/Scenes/Levels/Level19.unity
guid: e64b69dc749e479428ab0b1579c6547a guid: e64b69dc749e479428ab0b1579c6547a
- enabled: 1 - enabled: 0
path: Assets/_Game/Scenes/Levels/Level20.unity path: Assets/_Game/Scenes/Levels/Level20.unity
guid: 081c189e0d3e45548ab3cf652e10f027 guid: 081c189e0d3e45548ab3cf652e10f027
m_configObjects: {} m_configObjects: {}
...@@ -7,7 +7,7 @@ EditorSettings: ...@@ -7,7 +7,7 @@ EditorSettings:
m_ExternalVersionControlSupport: Visible Meta Files m_ExternalVersionControlSupport: Visible Meta Files
m_SerializationMode: 2 m_SerializationMode: 2
m_LineEndingsForNewScripts: 2 m_LineEndingsForNewScripts: 2
m_DefaultBehaviorMode: 0 m_DefaultBehaviorMode: 1
m_SpritePackerMode: 0 m_SpritePackerMode: 0
m_SpritePackerPaddingPower: 1 m_SpritePackerPaddingPower: 1
m_EtcTextureCompressorBehavior: 1 m_EtcTextureCompressorBehavior: 1
......
...@@ -37,6 +37,7 @@ GraphicsSettings: ...@@ -37,6 +37,7 @@ GraphicsSettings:
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: [] m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0} type: 0}
......
...@@ -12,8 +12,8 @@ PlayerSettings: ...@@ -12,8 +12,8 @@ PlayerSettings:
targetDevice: 2 targetDevice: 2
useOnDemandResources: 0 useOnDemandResources: 0
accelerometerFrequency: 60 accelerometerFrequency: 60
companyName: DefaultCompany companyName: FHTrierGDW
productName: Unity-Base-Project-2018.2 productName: tothesurface
defaultCursor: {fileID: 0} defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0} cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
...@@ -125,7 +125,6 @@ PlayerSettings: ...@@ -125,7 +125,6 @@ PlayerSettings:
m_HolographicPauseOnTrackingLoss: 1 m_HolographicPauseOnTrackingLoss: 1
xboxOneDisableKinectGpuReservation: 0 xboxOneDisableKinectGpuReservation: 0
xboxOneEnable7thCore: 0 xboxOneEnable7thCore: 0
isWsaHolographicRemotingEnabled: 0
vrSettings: vrSettings:
cardboard: cardboard:
depthFormat: 0 depthFormat: 0
...@@ -151,10 +150,11 @@ PlayerSettings: ...@@ -151,10 +150,11 @@ PlayerSettings:
resolutionScalingMode: 0 resolutionScalingMode: 0
androidSupportedAspectRatio: 1 androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1 androidMaxAspectRatio: 2.1
applicationIdentifier: {} applicationIdentifier:
Android: de.fhtrier.gdw
buildNumber: {} buildNumber: {}
AndroidBundleVersionCode: 1 AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 16 AndroidMinSdkVersion: 23
AndroidTargetSdkVersion: 0 AndroidTargetSdkVersion: 0
AndroidPreferredInstallLocation: 1 AndroidPreferredInstallLocation: 1
aotOptions: aotOptions:
...@@ -256,8 +256,77 @@ PlayerSettings: ...@@ -256,8 +256,77 @@ PlayerSettings:
banner: {fileID: 0} banner: {fileID: 0}
androidGamepadSupportLevel: 0 androidGamepadSupportLevel: 0
resolutionDialogBanner: {fileID: 0} resolutionDialogBanner: {fileID: 0}
m_BuildTargetIcons: [] m_BuildTargetIcons:
m_BuildTargetPlatformIcons: [] - m_BuildTarget:
m_Icons:
- serializedVersion: 2
m_Icon: {fileID: 2800000, guid: 4c8d1db166a43564e94df8a347a022ac, type: 3}
m_Width: 128
m_Height: 128
m_Kind: 0
m_BuildTargetPlatformIcons:
- m_BuildTarget: Android
m_Icons:
- m_Textures: []
m_Width: 432
m_Height: 432
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 324
m_Height: 324
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 216
m_Height: 216
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 162
m_Height: 162
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 108
m_Height: 108
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 81
m_Height: 81
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 192
m_Height: 192
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 144
m_Height: 144
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 96
m_Height: 96
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 72
m_Height: 72
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 48
m_Height: 48
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 36
m_Height: 36
m_Kind: 1
m_SubKind:
m_BuildTargetBatching: m_BuildTargetBatching:
- m_BuildTarget: Standalone - m_BuildTarget: Standalone
m_StaticBatching: 1