Merge branch 'master' of github.com:ETSConjure/PixelSphinx

This commit is contained in:
Jean-Sébastien Gervais 2016-04-08 08:07:04 -04:00
commit 85295aaece
118 changed files with 6058 additions and 18 deletions

BIN
Assets/Art/T_Char_01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

View File

@ -0,0 +1,57 @@
fileFormatVersion: 2
guid: b428255ba3ffb5642adbc9c28d91864d
timeCreated: 1460094721
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Art/T_Char_02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

View File

@ -0,0 +1,57 @@
fileFormatVersion: 2
guid: 028cce0260747214d81db557ec6f37c4
timeCreated: 1460100052
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -0,0 +1,57 @@
fileFormatVersion: 2
guid: 1638a85de9c1a524ab602d8d8370dd8d
timeCreated: 1460094721
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View File

@ -0,0 +1,57 @@
fileFormatVersion: 2
guid: 877352de2811c3e46b8b58e2475e07b3
timeCreated: 1460100053
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,57 @@
fileFormatVersion: 2
guid: 545c8c8845e75b44087e8546737ac074
timeCreated: 1460102042
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -0,0 +1,57 @@
fileFormatVersion: 2
guid: adc5fe6c93bdded4bb5dc5e25191dbfc
timeCreated: 1460100053
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,36 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 539aad81a9327404e8e67bb53c540d91, type: 3}
m_Name: ControllerMapper
m_EditorClassIdentifier:
Contexts:
- name: Gameplay
ButtonActions:
- name: Jump
XboxButtons: 00000000
KeyboardKeys: 20000000
AxisRanges:
- name: Dash
Axis: 09000000
KeyboardKeys:
- name: MoveLeft
Axis: 00000000
KeyboardKeys:
- name: MoveRight
Axis: 01000000
KeyboardKeys:
- name: MoveUp
Axis: 02000000
KeyboardKeys:
- name: MoveDown
Axis: 03000000
KeyboardKeys:
ButtonStates: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ba52e0f13249c9e46bb162622e61904f
timeCreated: 1460092146
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/Editor.meta Normal file
View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 2ca10ed205191f6469b088b753449e2e
folderAsset: yes
timeCreated: 1436647855
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 7f51e978f4624ae4794201e436ec39e5
folderAsset: yes
timeCreated: 1435023323
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
using UnityEngine;
using System.Collections;
using UnityEditor;
namespace InputHandler
{
public class CreateControllerMapperAsset
{
[MenuItem("InputHandler/Create/ControllerMapper")]
public static void CreateInputAsset()
{
ControllerMapperAsset asset = ControllerMapperAsset.CreateInstance<ControllerMapperAsset>();
AssetDatabase.CreateAsset(asset, "Assets/ControllerMapper.asset");
AssetDatabase.SaveAssets();
EditorUtility.FocusProjectWindow();
Selection.activeObject = asset;
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 37a276da6a074c149a173094095c1e94
timeCreated: 1434958498
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

9
Assets/Fonts.meta Normal file
View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 20134f50d6e763b41835848a2d42d00b
folderAsset: yes
timeCreated: 1460089798
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 80a249040a3563a43a7393513351b66c
folderAsset: yes
timeCreated: 1434250925
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 7ad9c0075fe8016418f05173debbc8ec
timeCreated: 1434250925
licenseType: Free
TrueTypeFontImporter:
serializedVersion: 2
fontSize: 16
forceTextureCase: -2
characterSpacing: 1
characterPadding: 0
includeFontData: 1
use2xBehaviour: 0
fontNames: []
customCharacters:
fontRenderingMode: 0
userData:
assetBundleName:
assetBundleVariant:

9
Assets/Plugins.meta Normal file
View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b7bbc4d80023984499ce688e0c85bd4b
folderAsset: yes
timeCreated: 1460089798
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/Plugins/x86.meta Normal file
View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: d5a17b4fbbb9c794fb163e397e963e00
folderAsset: yes
timeCreated: 1434857820
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: c4e96c35cd46f534592ecc07b608e110
PluginImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
platformData:
Any:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,6 @@
fileFormatVersion: 2
guid: bbceb1b00a2e35849a7020d601589c40
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 19f56f3d79f95da47ae4895f7588c43b
folderAsset: yes
timeCreated: 1434857820
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: b9f05caccaeb48146ae995df3ed431ab
PluginImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
platformData:
Any:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,6 @@
fileFormatVersion: 2
guid: ea895df4f09804d47ac0a43ce22418cb
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,216 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &130732
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 418246}
- 212: {fileID: 21220066}
m_Layer: 0
m_Name: Sprite_Walk
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &154602
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 494126}
m_Layer: 0
m_Name: Astronaut
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &157058
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 406446}
- 212: {fileID: 21257324}
m_Layer: 0
m_Name: Sprite_Dash
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &170392
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 403646}
- 114: {fileID: 11494368}
- 114: {fileID: 11434752}
m_Layer: 0
m_Name: Character
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &403646
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 170392}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 4.18, z: 0}
m_LocalScale: {x: 0.2, y: 0.2, z: 0.2}
m_Children:
- {fileID: 418246}
- {fileID: 406446}
m_Father: {fileID: 494126}
m_RootOrder: 0
--- !u!4 &406446
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 157058}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.14, y: 0.27, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 403646}
m_RootOrder: 1
--- !u!4 &418246
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 130732}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 403646}
m_RootOrder: 0
--- !u!4 &494126
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 154602}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 403646}
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!114 &11434752
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 170392}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ab270b0cb2475114ab8eb45661af0df1, type: 3}
m_Name:
m_EditorClassIdentifier:
PlayerNumber: 0
--- !u!114 &11494368
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 170392}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8c32c40e0b8e5eb47bb7a91068af09ca, type: 3}
m_Name:
m_EditorClassIdentifier:
Rotator: {fileID: 154602}
SpriteWalk: {fileID: 130732}
SpriteDash: {fileID: 157058}
StepTime: 0
JumpSpeed: 0
--- !u!212 &21220066
SpriteRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 130732}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_ReflectionProbeUsage: 0
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 028cce0260747214d81db557ec6f37c4, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
--- !u!212 &21257324
SpriteRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 157058}
m_Enabled: 0
m_CastShadows: 0
m_ReceiveShadows: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_ReflectionProbeUsage: 0
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 877352de2811c3e46b8b58e2475e07b3, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 154602}
m_IsPrefabParent: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: acd71c7b2f995984d9033c9dc4e257dc
timeCreated: 1460102262
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,54 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &127118
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 498212}
- 114: {fileID: 11450178}
m_Layer: 0
m_Name: InputManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &498212
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 127118}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -.669233799, y: 1.78620481, z: -.0453276634}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!114 &11450178
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 127118}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6e33ba5066fe01747b2722e6f089a2ba, type: 3}
m_Name:
m_EditorClassIdentifier:
MAX_PLAYER_COUNT: 4
InputMapperAsset: {fileID: 11400000, guid: f4e69a787b1338846b2293e50d7cc92e, type: 2}
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 127118}
m_IsPrefabParent: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 158e745881137e04ca2086294f44d74c
timeCreated: 1440215386
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 0baf798af518d8c43aaa48513682a8eb
folderAsset: yes
timeCreated: 1434247891
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,670 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100636
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22444946}
- 222: {fileID: 22288126}
- 114: {fileID: 11458902}
m_Layer: 5
m_Name: Overlay
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &152940
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22485006}
- 222: {fileID: 22277124}
- 114: {fileID: 11463784}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &160360
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22460360}
- 222: {fileID: 22260360}
- 114: {fileID: 11460360}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &160366
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22460366}
- 222: {fileID: 22260366}
- 114: {fileID: 11460368}
- 114: {fileID: 11460394}
m_Layer: 5
m_Name: ButtonRestart
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &160380
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 460360}
- 114: {fileID: 11431370}
- 114: {fileID: 11412680}
- 114: {fileID: 11469064}
m_Layer: 0
m_Name: MomWinsMenu
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &160382
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22460380}
- 223: {fileID: 22360360}
- 114: {fileID: 11460398}
- 114: {fileID: 11460400}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &160384
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22460382}
- 222: {fileID: 22260376}
- 114: {fileID: 11460402}
- 114: {fileID: 11454254}
m_Layer: 5
m_Name: ButtonExit
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &160386
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22460384}
- 222: {fileID: 22260378}
- 114: {fileID: 11460404}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &460360
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160380}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 22460380}
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!114 &11412680
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160380}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 38c11234779339d4f8412f72ddd8889b, type: 3}
m_Name:
m_EditorClassIdentifier:
Delay: .200000003
DeadZone: .5
BackButtonEvent:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
--- !u!114 &11431370
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160380}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 160366}
m_sendNavigationEvents: 1
m_DragThreshold: 5
--- !u!114 &11454254
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160384}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: .929411829, g: .101960793, b: .274509817, a: 1}
m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1}
m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
m_ColorMultiplier: 1
m_FadeDuration: .100000001
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 11460402}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11469064}
m_MethodName: OnExitClick
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &11458902
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100636}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: .303000003}
m_Sprite: {fileID: 21300000, guid: d90a8faf6fb9540b084ef2825cc3a5dc, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &11460360
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160360}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1}
m_FontData:
m_Font: {fileID: 12800000, guid: 7ad9c0075fe8016418f05173debbc8ec, type: 3}
m_FontSize: 30
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Restart
--- !u!114 &11460368
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160366}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Sprite: {fileID: 21300000, guid: bb6a5d6e11b51d5449dd5b0f5230903c, type: 3}
m_Type: 1
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &11460394
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160366}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: .929411829, g: .101960793, b: .274509817, a: 1}
m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1}
m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
m_ColorMultiplier: 1
m_FadeDuration: .100000001
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 11460368}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11469064}
m_MethodName: OnRestartClick
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &11460398
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160382}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!114 &11460400
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160382}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &11460402
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160384}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Sprite: {fileID: 21300000, guid: bb6a5d6e11b51d5449dd5b0f5230903c, type: 3}
m_Type: 1
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &11460404
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160386}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1}
m_FontData:
m_Font: {fileID: 12800000, guid: 7ad9c0075fe8016418f05173debbc8ec, type: 3}
m_FontSize: 30
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Exit
--- !u!114 &11463784
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 152940}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FontData:
m_Font: {fileID: 12800000, guid: 7ad9c0075fe8016418f05173debbc8ec, type: 3}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 0
m_MaxSize: 40
m_Alignment: 4
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Mom Wins!
--- !u!114 &11469064
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160380}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e1b367055e661c84d965e27bf591f3f7, type: 3}
m_Name:
m_EditorClassIdentifier:
Message: {fileID: 0}
--- !u!222 &22260360
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160360}
--- !u!222 &22260366
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160366}
--- !u!222 &22260376
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160384}
--- !u!222 &22260378
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160386}
--- !u!222 &22277124
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 152940}
--- !u!222 &22288126
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100636}
--- !u!223 &22360360
Canvas:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160382}
m_Enabled: 1
serializedVersion: 2
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 1
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!224 &22444946
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100636}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 22460380}
m_RootOrder: 0
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: .5, y: .5}
--- !u!224 &22460360
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160360}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 22460366}
m_RootOrder: 0
m_AnchorMin: {x: 0, y: .122000009}
m_AnchorMax: {x: 1, y: .769512236}
m_AnchoredPosition: {x: -.5, y: 0}
m_SizeDelta: {x: -1, y: 0}
m_Pivot: {x: .5, y: .5}
--- !u!224 &22460366
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160366}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 22460360}
m_Father: {fileID: 22460380}
m_RootOrder: 2
m_AnchorMin: {x: .349999994, y: .400000006}
m_AnchorMax: {x: .649999976, y: .5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: .5, y: .5}
--- !u!224 &22460380
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160382}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 22444946}
- {fileID: 22485006}
- {fileID: 22460366}
- {fileID: 22460382}
m_Father: {fileID: 460360}
m_RootOrder: 0
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!224 &22460382
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160384}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 22460384}
m_Father: {fileID: 22460380}
m_RootOrder: 3
m_AnchorMin: {x: .349999994, y: .200392365}
m_AnchorMax: {x: .649999976, y: .300392389}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: .5, y: .5}
--- !u!224 &22460384
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160386}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 22460382}
m_RootOrder: 0
m_AnchorMin: {x: 0, y: .122000001}
m_AnchorMax: {x: 1, y: .769512177}
m_AnchoredPosition: {x: -.5, y: 0}
m_SizeDelta: {x: -1, y: 0}
m_Pivot: {x: .5, y: .5}
--- !u!224 &22485006
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 152940}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 22460380}
m_RootOrder: 1
m_AnchorMin: {x: .0500000007, y: .684177101}
m_AnchorMax: {x: .949999988, y: .866000056}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: .5, y: .5}
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 160380}
m_IsPrefabParent: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6a495bf58d4ebd442b25dfc40a98e481
timeCreated: 1440270348
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,670 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100636
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22444946}
- 222: {fileID: 22288126}
- 114: {fileID: 11458902}
m_Layer: 5
m_Name: Overlay
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &152940
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22485006}
- 222: {fileID: 22277124}
- 114: {fileID: 11463784}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &160360
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22460360}
- 222: {fileID: 22260360}
- 114: {fileID: 11460360}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &160366
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22460366}
- 222: {fileID: 22260366}
- 114: {fileID: 11460368}
- 114: {fileID: 11460394}
m_Layer: 5
m_Name: ButtonRestart
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &160380
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 460360}
- 114: {fileID: 11431370}
- 114: {fileID: 11412680}
- 114: {fileID: 11469064}
m_Layer: 0
m_Name: PlayerWinsMenu
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &160382
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22460380}
- 223: {fileID: 22360360}
- 114: {fileID: 11460398}
- 114: {fileID: 11460400}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &160384
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22460382}
- 222: {fileID: 22260376}
- 114: {fileID: 11460402}
- 114: {fileID: 11454254}
m_Layer: 5
m_Name: ButtonExit
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &160386
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22460384}
- 222: {fileID: 22260378}
- 114: {fileID: 11460404}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &460360
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160380}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 22460380}
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!114 &11412680
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160380}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 38c11234779339d4f8412f72ddd8889b, type: 3}
m_Name:
m_EditorClassIdentifier:
Delay: .200000003
DeadZone: .5
BackButtonEvent:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
--- !u!114 &11431370
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160380}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 160366}
m_sendNavigationEvents: 1
m_DragThreshold: 5
--- !u!114 &11454254
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160384}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: .929411829, g: .101960793, b: .274509817, a: 1}
m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1}
m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
m_ColorMultiplier: 1
m_FadeDuration: .100000001
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 11460402}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11469064}
m_MethodName: OnExitClick
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &11458902
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100636}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: .303000003}
m_Sprite: {fileID: 21300000, guid: d90a8faf6fb9540b084ef2825cc3a5dc, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &11460360
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160360}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1}
m_FontData:
m_Font: {fileID: 12800000, guid: 7ad9c0075fe8016418f05173debbc8ec, type: 3}
m_FontSize: 30
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Restart
--- !u!114 &11460368
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160366}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Sprite: {fileID: 21300000, guid: bb6a5d6e11b51d5449dd5b0f5230903c, type: 3}
m_Type: 1
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &11460394
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160366}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: .929411829, g: .101960793, b: .274509817, a: 1}
m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1}
m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
m_ColorMultiplier: 1
m_FadeDuration: .100000001
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 11460368}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11469064}
m_MethodName: OnRestartClick
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &11460398
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160382}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!114 &11460400
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160382}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &11460402
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160384}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Sprite: {fileID: 21300000, guid: bb6a5d6e11b51d5449dd5b0f5230903c, type: 3}
m_Type: 1
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &11460404
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160386}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1}
m_FontData:
m_Font: {fileID: 12800000, guid: 7ad9c0075fe8016418f05173debbc8ec, type: 3}
m_FontSize: 30
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Exit
--- !u!114 &11463784
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 152940}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FontData:
m_Font: {fileID: 12800000, guid: 7ad9c0075fe8016418f05173debbc8ec, type: 3}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 0
m_MaxSize: 40
m_Alignment: 4
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Player 1 Wins!
--- !u!114 &11469064
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160380}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e1b367055e661c84d965e27bf591f3f7, type: 3}
m_Name:
m_EditorClassIdentifier:
Message: {fileID: 11463784}
--- !u!222 &22260360
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160360}
--- !u!222 &22260366
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160366}
--- !u!222 &22260376
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160384}
--- !u!222 &22260378
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160386}
--- !u!222 &22277124
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 152940}
--- !u!222 &22288126
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100636}
--- !u!223 &22360360
Canvas:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160382}
m_Enabled: 1
serializedVersion: 2
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 1
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!224 &22444946
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100636}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 22460380}
m_RootOrder: 0
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: .5, y: .5}
--- !u!224 &22460360
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160360}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 22460366}
m_RootOrder: 0
m_AnchorMin: {x: 0, y: .122000009}
m_AnchorMax: {x: 1, y: .769512236}
m_AnchoredPosition: {x: -.5, y: 0}
m_SizeDelta: {x: -1, y: 0}
m_Pivot: {x: .5, y: .5}
--- !u!224 &22460366
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160366}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 22460360}
m_Father: {fileID: 22460380}
m_RootOrder: 2
m_AnchorMin: {x: .349999994, y: .400000006}
m_AnchorMax: {x: .649999976, y: .5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: .5, y: .5}
--- !u!224 &22460380
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160382}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 22444946}
- {fileID: 22485006}
- {fileID: 22460366}
- {fileID: 22460382}
m_Father: {fileID: 460360}
m_RootOrder: 0
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!224 &22460382
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160384}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 22460384}
m_Father: {fileID: 22460380}
m_RootOrder: 3
m_AnchorMin: {x: .349999994, y: .200392365}
m_AnchorMax: {x: .649999976, y: .300392389}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: .5, y: .5}
--- !u!224 &22460384
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160386}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 22460382}
m_RootOrder: 0
m_AnchorMin: {x: 0, y: .122000001}
m_AnchorMax: {x: 1, y: .769512177}
m_AnchoredPosition: {x: -.5, y: 0}
m_SizeDelta: {x: -1, y: 0}
m_Pivot: {x: .5, y: .5}
--- !u!224 &22485006
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 152940}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 22460380}
m_RootOrder: 1
m_AnchorMin: {x: .0500000007, y: .684177101}
m_AnchorMax: {x: .949999988, y: .866000056}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: .5, y: .5}
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 160380}
m_IsPrefabParent: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cf712c8a251107d4db1ded768a7e8d98
timeCreated: 1440278006
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: d400fbe6e79cd3f41ac51081aa196e08
folderAsset: yes
timeCreated: 1434247496
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,55 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &183988
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 483988}
- 114: {fileID: 11483988}
m_Layer: 0
m_Name: MenusManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &483988
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 183988}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2.11251187, y: 2.53501511, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!114 &11483988
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 183988}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b40c9a6b8e14bc84a8e8d472d4e124ea, type: 3}
m_Name:
m_EditorClassIdentifier:
Menus:
- {fileID: 11469064, guid: 6a495bf58d4ebd442b25dfc40a98e481, type: 2}
- {fileID: 11469064, guid: cf712c8a251107d4db1ded768a7e8d98, type: 2}
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 183988}
m_IsPrefabParent: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 38eb021af0911154aab92f72bc4f341a
timeCreated: 1432957259
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -1 +0,0 @@
tst

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: afc3ba2bd5b70194e9fb05d80712eecb
timeCreated: 1460091048
licenseType: Pro
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

150
Assets/Scripts/Astronaut.cs Normal file
View File

@ -0,0 +1,150 @@
using UnityEngine;
using System.Collections;
public class Astronaut : MonoBehaviour {
private enum AstronautState
{
Idle, Walking, Jumping, Dashing, Ejecting, Dead
}
public GameObject Rotator;
public GameObject SpriteWalk;
public GameObject SpriteDash;
public float StepTime;
public float JumpSpeed;
private AstronautState _state;
private AstronautState State
{
get
{
return _state;
}
set
{
AstronautState oldState = _state;
_state = value;
if (oldState == _state) return;
if (oldState == AstronautState.Dashing)
{
SpriteWalk.SetActive(false);
SpriteDash.SetActive(true);
}
else
{
SpriteWalk.SetActive(true);
SpriteDash.SetActive(false);
}
/*if (_state == AstronautState.Walking)
{
StartCoroutine(WalkingStance());
}*/
}
}
private float vSpeed = 0;
private float height = 0;
private float angle = 0;
private float walkTime = 0;
private int nextStep = 1;
// Use this for initialization
void Start () {
State = AstronautState.Idle;
}
// Update is called once per frame
void Update () {
/*if (State == AstronautState.Walking)
{
walkTime += Time.deltaTime / StepTime;
Vector3 rotation = transform.rotation.eulerAngles;
rotation.z = Mathf.Sin(walkTime * Mathf.PI)*50;
transform.rotation = Quaternion.Euler(rotation);
Debug.Log(rotation.z);
}*/
/*
switch (State)
{
case AstronautState.Dashing:
break;
case AstronautState.Ejecting:
break;
case AstronautState.Idle:
break;
case AstronautState.Jumping:
break;
case AstronautState.Walking:
break;
}
*/
}
public void Move(float x, float y)
{
if (State >= AstronautState.Ejecting )
return;
if (State < AstronautState.Jumping)
{
if (Mathf.Approximately(x, 0))
{
State = AstronautState.Idle;
}
else
{
State = AstronautState.Walking;
walkTime = 0f;
}
}
}
public void Jump()
{
if (_state >= AstronautState.Ejecting)
return;
}
public void Dash()
{
if (_state >= AstronautState.Ejecting)
return;
}
public void OnGUI()
{
if (GUI.Button(new Rect(10, 10, 150, 50), State.ToString()))
Debug.Log("Clicked the button with an image");
}
/*IEnumerator WalkingStance()
{
Debug.Log("walking stance");
walkTime += Time.deltaTime / StepTime;
while (State <= AstronautState.Walking && walkTime <= 1f)
{
Vector3 rotation = transform.rotation.eulerAngles;
rotation.z = Mathf.Sin(walkTime*Mathf.PI);
transform.rotation = Quaternion.Euler(rotation);
yield return null;
}
walkTime = 0f;
if(State == AstronautState.Walking)
{
StartCoroutine("WalkingStance");
}
}*/
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8c32c40e0b8e5eb47bb7a91068af09ca
timeCreated: 1460098199
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,69 @@
using UnityEngine;
using System.Collections;
using InputHandler;
[RequireComponent(typeof(Astronaut))]
public class AstronautController : MonoBehaviour {
private Astronaut _astronaut;
public int PlayerNumber;
// Use this for initialization
void Start()
{
InputManager.Instance.PushActiveContext("Gameplay", PlayerNumber);
InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerAxis);
InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerButtons);
_astronaut = GetComponent<Astronaut>();
}
private void HandlePlayerAxis(MappedInput input)
{
if (this == null) return;
// movement
float xValue = 0f;
if (input.Ranges.ContainsKey("MoveLeft"))
{
xValue = -input.Ranges["MoveLeft"];
}
else if (input.Ranges.ContainsKey("MoveRight"))
{
xValue = input.Ranges["MoveRight"];
}
float yValue = 0f;
if (input.Ranges.ContainsKey("MoveUp"))
{
yValue = input.Ranges["MoveUp"];
}
else if (input.Ranges.ContainsKey("MoveDown"))
{
yValue = -input.Ranges["MoveDown"];
}
_astronaut.Move(xValue, yValue);
if (input.Ranges.ContainsKey("Dash"))
{
if(input.Ranges["Dash"] > 0.8f)
_astronaut.Dash();
}
}
private void HandlePlayerButtons(MappedInput input)
{
if (this == null) return;
if (input.Actions.Contains("Jump"))
{
_astronaut.Jump();
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ab270b0cb2475114ab8eb45661af0df1
timeCreated: 1460097909
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,77 @@
using UnityEngine;
using System.Collections;
using InputHandler;
using MenusHandler;
public class GameManager : MonoBehaviour
{
public int PlayerCount = 4;
private static GameManager _instance;
public static GameManager Instance
{
get { return _instance; }
}
void Awake()
{
_instance = this;
/*
if (_instance != null)
{
Destroy(gameObject);
}
else
{
_instance = this;
DontDestroyOnLoad(gameObject);
}*/
}
void Start()
{
for (int i = 0; i < PlayerCount; i++)
{
InputManager.Instance.AddCallback(i, HandleMenuInput);
}
// play gameplay music
//MusicManager.Instance.PlayGameplayMusic();
}
public void PushMenuContext()
{
for (int i = 0; i < PlayerCount; i++)
{
InputManager.Instance.PushActiveContext("Menu", i);
}
}
public void PopMenuContext()
{
for (int i = 0; i < PlayerCount; i++)
{
InputManager.Instance.PopActiveContext(i);
}
}
private void HandleMenuInput(MappedInput input)
{
float yAxis = 0f;
if (input.Ranges.ContainsKey("SelectOptionUp"))
{
yAxis = input.Ranges["SelectOptionUp"];
}
else if (input.Ranges.ContainsKey("SelectOptionDown"))
{
yAxis = -input.Ranges["SelectOptionDown"];
}
bool accept = input.Actions.Contains("Accept");
MenusManager.Instance.SetInputValues(accept, false, 0f, yAxis);
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 1825cbcd751ef524bbccc0b274d69d7a
timeCreated: 1440271895
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: d6e2ccb4aa280a04297ff5048cde5ee1
folderAsset: yes
timeCreated: 1434183356
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,196 @@
using UnityEngine;
using System.Collections;
using XInputDotNetPure;
using System.Collections.Generic;
namespace InputHandler
{
public class ControllerManager : InputManager
{
private bool[] _initialSetupDone;
private PlayerIndex[] _playerIndexes;
private GamePadState[] _gamePadPreviousStates;
private GamePadState[] _gamePadStates;
protected override void InitialSetup()
{
_initialSetupDone = new bool[MAX_PLAYER_COUNT];
_playerIndexes = new PlayerIndex[MAX_PLAYER_COUNT];
_gamePadPreviousStates = new GamePadState[MAX_PLAYER_COUNT];
_gamePadStates = new GamePadState[MAX_PLAYER_COUNT];
for (int i = 0; i < MAX_PLAYER_COUNT; i++)
{
_gamePadStates[i] = GamePad.GetState(_playerIndexes[i]);
}
}
protected override void MapInputs()
{
for (int i = 0; i < MAX_PLAYER_COUNT; i++)
{
_gamePadPreviousStates[i] = _gamePadStates[i];
_gamePadStates[i] = GamePad.GetState(_playerIndexes[i]);
if (!_gamePadPreviousStates[i].IsConnected || !_initialSetupDone[i])
{
_initialSetupDone[i] = true;
if (_gamePadStates[i].IsConnected)
{
_playerIndexes[i] = (PlayerIndex)i;
Debug.Log(string.Format("GamePad {0} is ready", _playerIndexes[i]));
}
}
MapPlayerInput(_inputMappers[i], _gamePadStates[i], _gamePadPreviousStates[i]);
}
}
// TODO: Maybe reduce it to only the inputs actually used in the game?
private void MapPlayerInput(InputMapper inputMapper, GamePadState state, GamePadState previousState)
{
foreach (int axisInt in InputMapperAsset.GetMappedXboxAxis())
{
MapXboxAxis(axisInt, inputMapper, state);
}
foreach (int buttonInt in InputMapperAsset.GetMappedXboxButtons())
{
MapXboxButton(buttonInt, inputMapper, state, previousState);
}
// TODO: Put the following code into another class, so we can have 2 distinct XboxManager and KeyboardManager classes
// We map only the keyboard keys that are going to be used in the game
foreach (int key in InputMapperAsset.GetMappedKeyboardKeys())
{
inputMapper.SetRawButtonState(100 + key, Input.GetKey((KeyCode)key), Input.GetKey((KeyCode)key) && !Input.GetKeyDown((KeyCode)key));
}
foreach (int key in InputMapperAsset.GetMappedKeyboardKeysAxis())
{
float value = Input.GetKey((KeyCode)key) ? 1f : 0f;
inputMapper.SetRawAxisValue(100 + key, value);
}
}
private void MapXboxButton(int buttonInt, InputMapper inputMapper, GamePadState state, GamePadState previousState)
{
XboxInputConstants.Buttons button = (XboxInputConstants.Buttons)buttonInt;
bool pressed = false;
bool previouslyPressed = false;
switch (button)
{
case XboxInputConstants.Buttons.A:
pressed = state.Buttons.A == ButtonState.Pressed;
previouslyPressed = previousState.Buttons.A == ButtonState.Pressed;
break;
case XboxInputConstants.Buttons.B:
pressed = state.Buttons.B == ButtonState.Pressed;
previouslyPressed = previousState.Buttons.B == ButtonState.Pressed;
break;
case XboxInputConstants.Buttons.X:
pressed = state.Buttons.X == ButtonState.Pressed;
previouslyPressed = previousState.Buttons.X == ButtonState.Pressed;
break;
case XboxInputConstants.Buttons.Y:
pressed = state.Buttons.Y == ButtonState.Pressed;
previouslyPressed = previousState.Buttons.Y == ButtonState.Pressed;
break;
case XboxInputConstants.Buttons.LeftShoulder:
pressed = state.Buttons.LeftShoulder == ButtonState.Pressed;
previouslyPressed = previousState.Buttons.LeftShoulder == ButtonState.Pressed;
break;
case XboxInputConstants.Buttons.RightShoulder:
pressed = state.Buttons.RightShoulder == ButtonState.Pressed;
previouslyPressed = previousState.Buttons.RightShoulder == ButtonState.Pressed;
break;
case XboxInputConstants.Buttons.Back:
pressed = state.Buttons.Back == ButtonState.Pressed;
previouslyPressed = previousState.Buttons.Back == ButtonState.Pressed;
break;
case XboxInputConstants.Buttons.Start:
pressed = state.Buttons.Start == ButtonState.Pressed;
previouslyPressed = previousState.Buttons.Start == ButtonState.Pressed;
break;
case XboxInputConstants.Buttons.LeftStick:
pressed = state.Buttons.LeftStick == ButtonState.Pressed;
previouslyPressed = previousState.Buttons.LeftStick == ButtonState.Pressed;
break;
case XboxInputConstants.Buttons.RightStick:
pressed = state.Buttons.RightStick == ButtonState.Pressed;
previouslyPressed = previousState.Buttons.RightStick == ButtonState.Pressed;
break;
case XboxInputConstants.Buttons.DPadLeft:
pressed = state.DPad.Left == ButtonState.Pressed;
previouslyPressed = previousState.DPad.Left == ButtonState.Pressed;
break;
case XboxInputConstants.Buttons.DPadRight:
pressed = state.DPad.Right == ButtonState.Pressed;
previouslyPressed = previousState.DPad.Right == ButtonState.Pressed;
break;
case XboxInputConstants.Buttons.DPadUp:
pressed = state.DPad.Up == ButtonState.Pressed;
previouslyPressed = previousState.DPad.Up == ButtonState.Pressed;
break;
case XboxInputConstants.Buttons.DPadDown:
pressed = state.DPad.Down == ButtonState.Pressed;
previouslyPressed = previousState.DPad.Down == ButtonState.Pressed;
break;
}
inputMapper.SetRawButtonState(buttonInt, pressed, previouslyPressed);
}
private void MapXboxAxis(int axisInt, InputMapper inputMapper, GamePadState state)
{
XboxInputConstants.Axis axis = (XboxInputConstants.Axis)axisInt;
float value = 0f;
switch (axis)
{
case XboxInputConstants.Axis.LeftStickLeft:
// If the left stick X value is negative, we keep it and take its absolute value
value = state.ThumbSticks.Left.X < 0f ? -state.ThumbSticks.Left.X : 0f;
break;
case XboxInputConstants.Axis.LeftStickRight:
// If the left stick X value is positive, we keep it
value = state.ThumbSticks.Left.X > 0f ? state.ThumbSticks.Left.X : 0f;
break;
case XboxInputConstants.Axis.LeftStickDown:
value = state.ThumbSticks.Left.Y < 0f ? -state.ThumbSticks.Left.Y : 0f;
break;
case XboxInputConstants.Axis.LeftStickUp:
value = state.ThumbSticks.Left.Y > 0f ? state.ThumbSticks.Left.Y : 0f;
break;
case XboxInputConstants.Axis.RightStickLeft:
value = state.ThumbSticks.Right.X < 0f ? -state.ThumbSticks.Right.X : 0f;
break;
case XboxInputConstants.Axis.RightStickRight:
value = state.ThumbSticks.Right.X > 0f ? state.ThumbSticks.Right.X : 0f;
break;
case XboxInputConstants.Axis.RightStickDown:
value = state.ThumbSticks.Right.Y < 0f ? -state.ThumbSticks.Right.Y : 0f;
break;
case XboxInputConstants.Axis.RightStickUp:
value = state.ThumbSticks.Right.Y > 0f ? state.ThumbSticks.Right.Y : 0f;
break;
case XboxInputConstants.Axis.TriggerLeft:
value = state.Triggers.Left;
break;
case XboxInputConstants.Axis.TriggerRight:
value = state.Triggers.Right;
break;
}
inputMapper.SetRawAxisValue(axisInt, value);
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 6e33ba5066fe01747b2722e6f089a2ba
timeCreated: 1436627825
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: -50
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,197 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
namespace InputHandler
{
// TODO: REFACTOR THE WHOLE CLASS, IT STINKS
[SerializeField]
public class ControllerMapperAsset : InputMapperAsset
{
[Serializable]
public class XboxContext
{
public string name;
public XboxAction[] ButtonActions;
public XboxRange[] AxisRanges;
public XboxState[] ButtonStates;
}
[Serializable]
public class XboxAction
{
public string name;
public XboxInputConstants.Buttons[] XboxButtons;
public KeyCode[] KeyboardKeys;
}
[Serializable]
public class XboxRange
{
public string name;
public XboxInputConstants.Axis[] Axis;
public KeyCode[] KeyboardKeys;
}
[Serializable]
public class XboxState
{
public string name;
public XboxInputConstants.Buttons[] XboxButtons;
public KeyCode[] KeyboardKeys;
}
public XboxContext[] Contexts;
// TODO: Temporary
private List<int> _mappedKeyboardKeysAxis;
private List<int> _mappedKeyboardKeys;
private List<int> _mappedXboxAxis;
private List<int> _mappedXboxButtons;
// Context -> InputMap
public override Dictionary<string, InputContext> GetMappedContexts()
{
_mappedKeyboardKeys = new List<int>();
_mappedKeyboardKeysAxis = new List<int>();
_mappedXboxButtons = new List<int>();
_mappedXboxAxis = new List<int>();
Dictionary<string, InputContext> mappedContexts = new Dictionary<string, InputContext>();
foreach (XboxContext xboxContext in Contexts)
{
InputMap inputMap = new InputMap();
inputMap.ButtonsToActionsMap = new List<InputToActionMap>[xboxContext.ButtonActions.Length];
inputMap.ButtonsToStatesMap = new List<InputToActionMap>[xboxContext.ButtonStates.Length];
inputMap.AxisToRangesMap = new List<InputToActionMap>[xboxContext.AxisRanges.Length];
for (int i = 0; i < xboxContext.ButtonActions.Length; i++)
{
XboxAction buttonAction = xboxContext.ButtonActions[i];
inputMap.ButtonsToActionsMap[i] = new List<InputToActionMap>();
foreach (XboxInputConstants.Buttons xboxButton in buttonAction.XboxButtons)
{
// TODO: We need to manage this in the InputMapper side
inputMap.ButtonsToActionsMap[i].Add(new InputToActionMap { action = buttonAction.name, input = (int)xboxButton });
if (!_mappedXboxButtons.Contains((int)xboxButton))
{
_mappedXboxButtons.Add((int)xboxButton);
}
}
// Keyboard part
foreach (KeyCode key in buttonAction.KeyboardKeys)
{
// TODO: Find a way to not add 100 to the code (for now, it's necessary since there are overlaps with the xbox enum)
inputMap.ButtonsToActionsMap[i].Add(new InputToActionMap { action = buttonAction.name, input = 100 + (int)key });
// TODO: Temporary
if (!_mappedKeyboardKeys.Contains((int)key))
{
_mappedKeyboardKeys.Add((int)key);
}
}
}
for (int i = 0; i < xboxContext.ButtonStates.Length; i++)
{
XboxState buttonState = xboxContext.ButtonStates[i];
inputMap.ButtonsToStatesMap[i] = new List<InputToActionMap>();
foreach (XboxInputConstants.Buttons xboxButton in buttonState.XboxButtons)
{
// TODO: We need to manage this in the InputMapper side
inputMap.ButtonsToStatesMap[i].Add(new InputToActionMap() { action = buttonState.name, input = (int)xboxButton });
if (!_mappedXboxButtons.Contains((int)xboxButton))
{
_mappedXboxButtons.Add((int)xboxButton);
}
}
// Keyboard part
foreach (KeyCode key in buttonState.KeyboardKeys)
{
// TODO: Find a way to not add 100 to the code (for now, it's necessary since there are overlaps with the xbox enum)
inputMap.ButtonsToStatesMap[i].Add(new InputToActionMap { action = buttonState.name, input = 100 + (int)key });
// TODO: Temporary
if (!_mappedKeyboardKeys.Contains((int)key))
{
_mappedKeyboardKeys.Add((int)key);
}
}
}
for (int i = 0; i < xboxContext.AxisRanges.Length; i++)
{
XboxRange axisRange = xboxContext.AxisRanges[i];
inputMap.AxisToRangesMap[i] = new List<InputToActionMap>();
foreach (XboxInputConstants.Axis xboxAxis in axisRange.Axis)
{
// TODO: We need to manage this in the InputMapper side
inputMap.AxisToRangesMap[i].Add(new InputToActionMap() { action = axisRange.name, input = (int)xboxAxis });
if (!_mappedXboxAxis.Contains((int)xboxAxis))
{
_mappedXboxAxis.Add((int)xboxAxis);
}
}
// Keyboard part
foreach (KeyCode key in axisRange.KeyboardKeys)
{
// TODO: Find a way to not add 100 to the code (for now, it's necessary since there are overlaps with the xbox enum)
inputMap.AxisToRangesMap[i].Add(new InputToActionMap { action = axisRange.name, input = 100 + (int)key });
// TODO: Temporary
if (!_mappedKeyboardKeysAxis.Contains((int)key))
{
_mappedKeyboardKeysAxis.Add((int)key);
}
}
}
InputContext context = new InputContext(xboxContext.name, inputMap);
mappedContexts.Add(xboxContext.name, context);
}
return mappedContexts;
}
// TODO: Probably temporary, until we find a better way and all the classes are refactored
// Utility method to be used by the ControllerManager class
public override List<int> GetMappedKeyboardKeysAxis()
{
return _mappedKeyboardKeysAxis;
}
// Utility method to be used by the ControllerManager class
public override List<int> GetMappedKeyboardKeys()
{
return _mappedKeyboardKeys;
}
public override List<int> GetMappedXboxAxis()
{
return _mappedXboxAxis;
}
public override List<int> GetMappedXboxButtons()
{
return _mappedXboxButtons;
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 539aad81a9327404e8e67bb53c540d91
timeCreated: 1436387267
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,19 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace InputHandler
{
public struct InputMap
{
public List<InputToActionMap>[] ButtonsToActionsMap;
public List<InputToActionMap>[] ButtonsToStatesMap;
public List<InputToActionMap>[] AxisToRangesMap;
}
public struct InputToActionMap
{
public int input;
public string action;
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: baa0e457a4ff21a4a8eb7d57efeef697
timeCreated: 1434996179
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,70 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
namespace InputHandler
{
public class InputContext
{
private Dictionary<int, string> _mappedButtons;
private Dictionary<int, string> _mappedStates;
private Dictionary<int, string> _mappedAxis;
private string _name;
public string Name
{
get { return _name; }
}
public InputContext(string contextName, InputMap inputMap)
{
_name = contextName;
_mappedButtons = new Dictionary<int, string>();
_mappedStates = new Dictionary<int, string>();
_mappedAxis = new Dictionary<int, string>();
foreach (List<InputToActionMap> buttonsToActionsMap in inputMap.ButtonsToActionsMap)
{
foreach (InputToActionMap buttonToActionMap in buttonsToActionsMap)
{
_mappedButtons.Add(buttonToActionMap.input, buttonToActionMap.action);
}
}
foreach (List<InputToActionMap> buttonsToStatesMap in inputMap.ButtonsToStatesMap)
{
foreach (InputToActionMap buttonToStateMap in buttonsToStatesMap)
{
_mappedStates.Add(buttonToStateMap.input, buttonToStateMap.action);
}
}
foreach (List<InputToActionMap> axisToRangesMap in inputMap.AxisToRangesMap)
{
foreach (InputToActionMap axisToRangeMap in axisToRangesMap)
{
_mappedAxis.Add(axisToRangeMap.input, axisToRangeMap.action);
}
}
}
public string GetActionForButton(int button)
{
return _mappedButtons.ContainsKey(button) ? _mappedButtons[button] : null;
}
public string GetStateForButton(int button)
{
return _mappedStates.ContainsKey(button) ? _mappedStates[button] : null;
}
public string GetRangeForAxis(int axis)
{
return _mappedAxis.ContainsKey(axis) ? _mappedAxis[axis] : null;
}
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4d99cd0919594864482148f723dfa8e2
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

View File

@ -0,0 +1,98 @@
using UnityEngine;
using System.Collections;
using XInputDotNetPure;
using System;
using System.Collections.Generic;
namespace InputHandler
{
public abstract class InputManager : MonoBehaviour
{
public static InputManager Instance
{
get
{
return _instance;
}
}
private static InputManager _instance;
protected InputMapper[] _inputMappers;
public int MAX_PLAYER_COUNT = 2;
public InputMapperAsset InputMapperAsset;
protected abstract void InitialSetup();
protected abstract void MapInputs();
void Awake()
{
if (_instance != null)
{
Destroy(gameObject);
}
else
{
_instance = this;
_inputMappers = new InputMapper[MAX_PLAYER_COUNT];
Dictionary<string, InputContext> mappedContexts = InputMapperAsset.GetMappedContexts();
for (int i = 0; i < MAX_PLAYER_COUNT; i++)
{
_inputMappers[i] = new InputMapper(mappedContexts);
}
// Do the needed initial setup in the derived classes
InitialSetup();
}
}
void Update()
{
// Do the input mapping here in the derived classes
MapInputs();
for (int i = 0; i < _inputMappers.Length; i++)
{
_inputMappers[i].Dispatch();
}
}
public void AddCallback(int playerIndex, Action<MappedInput> action)
{
_inputMappers[playerIndex].AddCallback(action);
}
public void PushActiveContext(string name, int playerIndex)
{
_inputMappers[playerIndex].PushActiveContext(name);
}
public void PopActiveContext(int playerIndex)
{
// TODO: Give the choice to remove an active context not on top
_inputMappers[playerIndex].PopActiveContext();
}
public void ClearContexts()
{
// For now, all input mappers are gonna have the same contexts at the same time
for (int i = 0; i < _inputMappers.Length; i++)
{
_inputMappers[i].ClearActiveContexts();
}
}
void LateUpdate()
{
for (int i = 0; i < _inputMappers.Length; i++)
{
_inputMappers[i].ResetInputs();
}
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 967b7f4e180b49f4fb6f53702c67aa34
timeCreated: 1436627825
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: -100
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,205 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
/*
Strongly inspired from Mike Lewis' excellent post about input handling
http://www.gamedev.net/blog/355/entry-2250186-designing-a-robust-input-handling-system-for-games/
*/
namespace InputHandler
{
public class InputMapper
{
// Right now, the only active context is the peek of the stack, but when we will need multiple contexts at once, this is going to be useful
private Dictionary<string, InputContext> _contexts;
private Stack<InputContext> _activeContexts;
private List<Action<MappedInput>> _callbacks;
private MappedInput _currentFrameMappedInput;
public InputMapper(Dictionary<string, InputContext> contexts)
{
_contexts = contexts;
_activeContexts = new Stack<InputContext>();
_callbacks = new List<Action<MappedInput>>();
_currentFrameMappedInput = new MappedInput();
}
public void Dispatch()
{
foreach (Action<MappedInput> callback in _callbacks)
{
callback(_currentFrameMappedInput);
}
}
public void PushActiveContext(string name)
{
InputContext context = _contexts[name];
if (_activeContexts.Count == 0 || _activeContexts.Peek().Name != name)
{
_activeContexts.Push(context);
}
}
public void PopActiveContext()
{
if (_activeContexts.Count != 0)
{
_activeContexts.Pop();
}
}
public void ClearActiveContexts()
{
_activeContexts.Clear();
}
public void AddCallback(Action<MappedInput> callback)
{
_callbacks.Add(callback);
}
public void SetRawButtonState(int button, bool pressed, bool previouslyPressed)
{
string action = GetActionForButton(button);
string state = GetStateForButton(button);
if (pressed)
{
if (!previouslyPressed && action != null)
{
_currentFrameMappedInput.Actions.Add(action);
return;
}
if (state != null)
{
_currentFrameMappedInput.States.Add(state);
return;
}
}
// Uncomment if we start to have problems
//RemoveButtonFromLists(button);
}
public void SetRawAxisValue(int axis, float value)
{
// TODO: Have contexts for every single player?
// TODO: Use the commented code below instead when we will want multiple contexts to be available at the same time (maybe for when the player holds a weapon?). We'll keep it simple for now.
/*
foreach (InputContext activeContext in _activeContexts)
{
InputConstants.Ranges range = activeContext.GetRangeForAxis(axis);
if (range != InputConstants.Ranges.None)
{
// We only want the first active "range behaviour" of the player to handle the ranges values, since we don't want multiple actions to react to it
_mappedInputs[playerIndex].Ranges[range] = value;
break;
}
}*/
if (value != 0f)
{
string range = null;
if (_activeContexts.Count != 0)
{
range = _activeContexts.Peek().GetRangeForAxis(axis);
}
if (range != null)
{
_currentFrameMappedInput.Ranges[range] = value;
}
}
}
public void ResetInputs()
{
_currentFrameMappedInput.Clear();
}
#region Helper methods
private string GetActionForButton(int button)
{
// TODO: Have contexts for every single player?
// TODO: Use the commented code below instead when we will want multiple contexts to be available at the same time (maybe for when the player holds a weapon?). We'll keep it simple for now.
/*
foreach (InputContext activeContext in _activeContexts)
{
InputConstants.Actions action = activeContext.GetActionForButton(button);
if (action != InputConstants.Actions.None)
{
return action;
}
}*/
string action = null;
if (_activeContexts.Count != 0)
{
action = _activeContexts.Peek().GetActionForButton(button);
}
return action;
}
private string GetStateForButton(int button)
{
// TODO: Have contexts for every single player?
// TODO: Use the commented code below instead when we will want multiple contexts to be available at the same time (maybe for when the player holds a weapon?). We'll keep it simple for now.
/*
foreach (InputContext activeContext in _activeContexts)
{
InputConstants.States state = activeContext.GetStateForButton(button);
if (state != InputConstants.States.None)
{
return state;
}
}*/
string state = null;
if (_activeContexts.Count != 0)
{
state = _activeContexts.Peek().GetStateForButton(button);
}
return state;
}
private void RemoveButtonFromLists(int button)
{
string action = GetActionForButton(button);
string state = GetStateForButton(button);
if (action != null)
{
_currentFrameMappedInput.Actions.Remove(action);
}
if (state != null)
{
_currentFrameMappedInput.States.Remove(state);
}
}
#endregion
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 586455317dda0b543a30eff647db722e
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

View File

@ -0,0 +1,20 @@
using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
namespace InputHandler
{
public abstract class InputMapperAsset : ScriptableObject
{
public enum InputTypes { Action, State, Range }
public abstract Dictionary<string, InputContext> GetMappedContexts();
// TODO: Probably temporary, until we find a better way and all the classes are refactored
public abstract List<int> GetMappedKeyboardKeysAxis();
public abstract List<int> GetMappedKeyboardKeys();
public abstract List<int> GetMappedXboxAxis();
public abstract List<int> GetMappedXboxButtons();
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 3a5ffa04260e8db4a9eab84c1e6b11ae
timeCreated: 1434962375
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,23 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
namespace InputHandler
{
// Specific to the game
public class MappedInput
{
// We use hashets for the actions and the states because we just need to check if they are in the collection, and not retrieve them
public HashSet<string> Actions = new HashSet<string>();
public HashSet<string> States = new HashSet<string>();
public Dictionary<string, float> Ranges = new Dictionary<string, float>();
public void Clear()
{
Actions.Clear();
States.Clear();
Ranges.Clear();
}
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d5fe308a0d85530408827f4357cc1ff5
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

View File

@ -0,0 +1,43 @@
using UnityEngine;
using System.Collections;
namespace InputHandler
{
//TODO: When we will be ready to read raw inputs from a file, we need this to simply be generic "BUTTON_ONE, BUTTON_TWO, etc."
public class XboxInputConstants
{
// These buttons will eventually map to controls saved in a file
public enum Buttons
{
A,
B,
X,
Y,
LeftShoulder,
RightShoulder,
Back,
Start,
LeftStick,
RightStick,
DPadLeft,
DPadRight,
DPadUp,
DPadDown,
}
public enum Axis
{
LeftStickLeft,
LeftStickRight,
LeftStickUp,
LeftStickDown,
RightStickLeft,
RightStickRight,
RightStickUp,
RightStickDown,
TriggerLeft,
TriggerRight
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4b46fefecf9412e46bdad7c26a00d537
timeCreated: 1436628179
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,64 @@
using UnityEngine;
using System.Collections;
using InputHandler;
public class InputTest : MonoBehaviour {
private int PlayerNumber;
// Use this for initialization
void Start () {
InputManager.Instance.PushActiveContext("Gameplay", PlayerNumber);
InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerAxis);
InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerButtons);
}
private void HandlePlayerAxis(MappedInput input)
{
if (this == null) return;
// movement
float xValue = 0f;
if (input.Ranges.ContainsKey("MoveLeft"))
{
xValue = -input.Ranges["MoveLeft"];
Debug.Log("Moved left!");
}
else if (input.Ranges.ContainsKey("MoveRight"))
{
xValue = input.Ranges["MoveRight"];
Debug.Log("Moved right!");
}
float zValue = 0f;
if (input.Ranges.ContainsKey("MoveUp"))
{
zValue = input.Ranges["MoveUp"];
Debug.Log("Moved up!");
}
else if (input.Ranges.ContainsKey("MoveDown"))
{
zValue = -input.Ranges["MoveDown"];
Debug.Log("Moved down!");
}
if (input.Ranges.ContainsKey("Dash"))
{
//zValue = -input.Ranges["Dash"];
Debug.Log("Dashed!");
}
}
private void HandlePlayerButtons(MappedInput input)
{
if (this == null) return;
if (input.Actions.Contains("Jump"))
{
Debug.Log("Jumped!");
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c8ea5c2832373d844bbef8e01bc6c6a7
timeCreated: 1460092132
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: d760adee926677142b681f1c9f9f1a4a
folderAsset: yes
timeCreated: 1434247891
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,44 @@
using UnityEngine;
using System.Collections;
using MenusHandler;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class PlayerWinsMenu : Menu
{
public Text Message;
public override void Open()
{
base.Open();
GameManager.Instance.PushMenuContext();
Time.timeScale = 0f;
}
public override void Close()
{
base.Close();
GameManager.Instance.PopMenuContext();
Time.timeScale = 1f;
}
public void SetPlayerIndex(int index)
{
Message.text = "Player " + (index + 1) + " Wins!";
}
public void OnRestartClick()
{
Time.timeScale = 1f;
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
public void OnExitClick()
{
Application.Quit();
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e1b367055e661c84d965e27bf591f3f7
timeCreated: 1434247895
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,26 @@
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class SimpleMenu : MonoBehaviour
{
public int NextLevel;
// Update is called once per frame
void Update () {
if (Input.anyKeyDown) {
if (NextLevel == 200)
Application.Quit();
else
SceneManager.LoadScene(NextLevel);
}
}
IEnumerator AutoSkip() {
yield return new WaitForSeconds(5);
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 769d2d55a9b6b104baa54b6081fbe205
timeCreated: 1440313599
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 7fadf2e5fa3e5d640a263265b68583f2
folderAsset: yes
timeCreated: 1434216062
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,28 @@
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
namespace MenusHandler
{
[RequireComponent(typeof(MenuInputModule))]
public abstract class Menu : MonoBehaviour
{
private MenuInputModule _inputModule;
public MenuInputModule InputModule
{
get { return _inputModule; }
}
void Awake()
{
_inputModule = GetComponent<MenuInputModule>();
}
protected virtual void Start() { }
public virtual void Open() { }
public virtual void Close() { }
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 742b9043bc8a6ad49976846ccee3e85d
timeCreated: 1432957414
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,44 @@
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System;
using UnityEngine.EventSystems;
namespace MenusHandler
{
public class MenuButton : Button
{
public Image LeftSelectorImage;
public Image RightSelectorImage;
protected override void Awake()
{
base.Awake();
LeftSelectorImage.gameObject.SetActive(false);
RightSelectorImage.gameObject.SetActive(false);
}
public override void OnSelect(UnityEngine.EventSystems.BaseEventData eventData)
{
base.OnSelect(eventData);
LeftSelectorImage.gameObject.SetActive(true);
RightSelectorImage.gameObject.SetActive(true);
}
public override void OnDeselect(UnityEngine.EventSystems.BaseEventData eventData)
{
base.OnDeselect(eventData);
LeftSelectorImage.gameObject.SetActive(false);
RightSelectorImage.gameObject.SetActive(false);
}
public void SetText(string text)
{
GetComponentInChildren<Text>().text = text;
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 77f8cfacd7a48bc4e94dd33e9924e13e
timeCreated: 1434216115
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,197 @@
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using System;
using UnityEngine.Events;
namespace MenusHandler
{
[RequireComponent(typeof(EventSystem))]
public class MenuInputModule : BaseInputModule
{
public float Delay = 0.2f;
public float DeadZone = 0.5f;
public UnityEvent BackButtonEvent;
private EventSystem _eventSystem;
private bool _canNavigate = true;
private GameObject _previousTargettedObject;
private bool _acceptButtonPressed = false;
private bool _backButtonPressed = false;
private bool _menuDownPressed = false;
private bool _menuUpPressed = false;
private bool _menuRightPressed = false;
private bool _menuLeftPressed = false;
protected override void Start()
{
base.Start();
_eventSystem = GetComponent<EventSystem>();
}
public override void ActivateModule()
{
base.ActivateModule();
SelectFirstButton();
_canNavigate = true;
}
public override void Process()
{
if (_acceptButtonPressed)
{
ExecuteEvents.Execute(_eventSystem.currentSelectedGameObject.gameObject, new BaseEventData(eventSystem), ExecuteEvents.submitHandler);
}
else if (_backButtonPressed)
{
BackButtonEvent.Invoke();
}
else if (_canNavigate)
{
if (_menuRightPressed)
{
SelectRightButton();
}
else if (_menuLeftPressed)
{
SelectLeftButton();
}
else if (_menuDownPressed)
{
SelectDownButton();
}
else if (_menuUpPressed)
{
SelectUpButton();
}
}
_acceptButtonPressed = false;
_backButtonPressed = false;
_menuDownPressed = false;
_menuUpPressed = false;
_menuRightPressed = false;
_menuLeftPressed = false;
}
public void ChangeFirstButton(Selectable button)
{
_eventSystem.firstSelectedGameObject = button.gameObject;
}
public void SelectFirstButton()
{
if (_eventSystem.firstSelectedGameObject == null) return;
if (_eventSystem.currentSelectedGameObject != _eventSystem.firstSelectedGameObject)
{
ExecuteEvents.Execute(_eventSystem.currentSelectedGameObject, new BaseEventData(eventSystem), ExecuteEvents.deselectHandler);
}
ExecuteEvents.Execute(_eventSystem.firstSelectedGameObject, new BaseEventData(eventSystem), ExecuteEvents.selectHandler);
_eventSystem.SetSelectedGameObject(_eventSystem.firstSelectedGameObject);
}
private void SelectLeftButton()
{
if (_eventSystem.currentSelectedGameObject == null) return;
Selectable toBeSelected = _eventSystem.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnLeft();
if (toBeSelected != null)
{
_eventSystem.SetSelectedGameObject(toBeSelected.gameObject);
StartCoroutine("PauseNavigation");
}
}
private void SelectRightButton()
{
if (_eventSystem.currentSelectedGameObject == null) return;
Selectable toBeSelected = _eventSystem.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnRight();
if (toBeSelected != null)
{
_eventSystem.SetSelectedGameObject(toBeSelected.gameObject);
StartCoroutine("PauseNavigation");
}
}
private void SelectUpButton()
{
if (_eventSystem.currentSelectedGameObject == null) return;
Selectable toBeSelected = _eventSystem.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnUp();
if (toBeSelected != null)
{
_eventSystem.SetSelectedGameObject(toBeSelected.gameObject);
StartCoroutine("PauseNavigation");
}
}
private void SelectDownButton()
{
if (_eventSystem.currentSelectedGameObject == null) return;
Selectable toBeSelected = _eventSystem.currentSelectedGameObject.GetComponent<Selectable>().FindSelectableOnDown();
if (toBeSelected != null)
{
_eventSystem.SetSelectedGameObject(toBeSelected.gameObject);
StartCoroutine("PauseNavigation");
}
}
// Adds a delay before we can switch options again
private IEnumerator PauseNavigation()
{
_canNavigate = false;
float elapsedTime = 0f;
// Since the game might be paused here, we can't do "yield return new WaitForSeconds(0.2f);"
while (elapsedTime < Delay)
{
elapsedTime += Time.unscaledDeltaTime;
yield return null;
}
_canNavigate = true;
}
public void SetInputValues(bool acceptButton, bool backButton, float horizontalAxis, float verticalAxis)
{
if (acceptButton)
{
_acceptButtonPressed = true;
}
if (backButton)
{
_backButtonPressed = true;
}
if (verticalAxis != 0f)
{
_menuDownPressed = verticalAxis < -DeadZone;
_menuUpPressed = verticalAxis > DeadZone;
}
if (horizontalAxis != 0f)
{
_menuRightPressed = horizontalAxis > DeadZone;
_menuLeftPressed = horizontalAxis < -DeadZone;
}
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 38c11234779339d4f8412f72ddd8889b
timeCreated: 1434216114
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,123 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
namespace MenusHandler
{
public class MenusManager : MonoBehaviour
{
public Action OnMenusOpened;
public Action OnMenusClosed;
public Menu[] Menus;
private static MenusManager _instance;
private Dictionary<string, Menu> _menus;
private Dictionary<string, Menu> _cachedMenus;
private Menu _currentMenu;
public static MenusManager Instance
{
get { return _instance; }
}
void Awake()
{
if (Instance)
{
Destroy(gameObject);
}
else
{
_instance = this;
_menus = new Dictionary<string, Menu>();
_cachedMenus = new Dictionary<string, Menu>();
foreach (Menu menu in Menus)
{
_menus[menu.name] = menu;
}
}
}
public Menu ShowMenu(string name)
{
if (_currentMenu != null)
{
CloseCurrentMenu();
}
if (!_cachedMenus.ContainsKey(name) || _cachedMenus[name] == null)
{
_cachedMenus[name] = Instantiate(_menus[name], Vector3.zero, Quaternion.identity) as Menu;
DontDestroyOnLoad(_cachedMenus[name]);
_cachedMenus[name].name = name;
}
_currentMenu = _cachedMenus[name];
OpenCurrentMenu();
return _currentMenu;
}
public void RequestClose()
{
CloseCurrentMenu();
}
public void SetInputValues(bool acceptButton, bool backButton, float horizontalAxis, float verticalAxis)
{
if (_currentMenu != null)
{
_currentMenu.InputModule.SetInputValues(acceptButton, backButton, horizontalAxis, verticalAxis);
}
}
void OnDestroy()
{
foreach (KeyValuePair<string, Menu> kvp in _cachedMenus)
{
if (kvp.Value != null)
{
Destroy(kvp.Value.gameObject);
}
}
}
void OnLevelWasLoaded(int levelIndex)
{
// When we load a new level, we close the currently active menu if it's still open
CloseCurrentMenu();
}
// Can change based on whether we simply hide the menus or destroy them
private void OpenCurrentMenu()
{
_currentMenu.gameObject.SetActive(true);
_currentMenu.Open();
if (OnMenusOpened != null)
{
OnMenusOpened();
}
}
// Can change based on whether we simply hide the menus or destroy them
private void CloseCurrentMenu()
{
if (_currentMenu != null && _currentMenu.gameObject.activeSelf)
{
_currentMenu.Close();
_currentMenu.gameObject.SetActive(false);
if (OnMenusClosed != null)
{
OnMenusClosed();
}
}
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b40c9a6b8e14bc84a8e8d472d4e124ea
timeCreated: 1432957285
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
using UnityEngine;
using System.Collections;
public class PlanetUtilities {
public static void Spheric2Cartesian(float theta, float radius, out float x, out float y)
{
x = -radius * Mathf.Sin(Mathf.Deg2Rad * theta);
y = radius * Mathf.Cos(Mathf.Deg2Rad * theta);
}
public static float GetDisplacementAngle(float delta, float radius)
{
return Mathf.Rad2Deg * radius / delta;
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8f6095fa026be7947a9f7d253ee7e848
timeCreated: 1460114132
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1 +0,0 @@
tst

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 6681384214c3a3e4a90c112542387b03
timeCreated: 1460091047
licenseType: Pro
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/Test.meta Normal file
View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 1684ce2102780804caea41f9c941be9a
folderAsset: yes
timeCreated: 1460094089
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

138
Assets/Test/FloorTest.mat Normal file
View File

@ -0,0 +1,138 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: FloorTest
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _SrcBlend
second: 1
data:
first:
name: _DstBlend
second: 0
data:
first:
name: _Cutoff
second: 0.5
data:
first:
name: _Parallax
second: 0.02
data:
first:
name: _ZWrite
second: 1
data:
first:
name: _Glossiness
second: 0.5
data:
first:
name: _BumpScale
second: 1
data:
first:
name: _OcclusionStrength
second: 1
data:
first:
name: _DetailNormalMapScale
second: 1
data:
first:
name: _UVSec
second: 0
data:
first:
name: _Mode
second: 0
data:
first:
name: _Metallic
second: 0
m_Colors:
data:
first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Color
second: {r: 0, g: 0.003448248, b: 0.5, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 48b3602a683827541bcc7e6753cd9aa8
timeCreated: 1460102495
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d59d73cf72fdb0042a1a8f4fd05307f6
timeCreated: 1460094090
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More