Added main menu

This commit is contained in:
RosimInc 2016-04-09 17:42:10 -04:00
parent ad03730dbb
commit bd90aa8936
10 changed files with 339 additions and 45 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@ -0,0 +1,57 @@
fileFormatVersion: 2
guid: b10a47314c9e9f54eb0d62019ca49971
timeCreated: 1460236344
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: 24 KiB

View File

@ -0,0 +1,57 @@
fileFormatVersion: 2
guid: 69076e315a6e1064da20c70c88286915
timeCreated: 1460237872
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

@ -16,6 +16,9 @@ MonoBehaviour:
ButtonActions: ButtonActions:
- name: Jump - name: Jump
XboxButtons: 00000000 XboxButtons: 00000000
KeyboardKeys:
- name: Start
XboxButtons: 07000000
KeyboardKeys: 20000000 KeyboardKeys: 20000000
AxisRanges: AxisRanges:
- name: Dash - name: Dash

View File

@ -5,7 +5,6 @@ using System.Collections.Generic;
public class AsteroidSpawner : TimerFunctionsClass public class AsteroidSpawner : TimerFunctionsClass
{ {
public float NextSpawnTime = 1.0f; public float NextSpawnTime = 1.0f;
public GameObject AsteroidPrefab1; public GameObject AsteroidPrefab1;
public GameObject AsteroidPrefab2; public GameObject AsteroidPrefab2;

View File

@ -7,12 +7,14 @@ public class MenuController : MonoBehaviour
private Astronaut _astronaut; private Astronaut _astronaut;
public GameObject ReadySprite; public GameObject ReadySprite;
public MenuManager Menu;
public int PlayerNumber; public int PlayerNumber;
public void Update() public void Update()
{ {
ReadySprite.SetActive(_astronaut.Height < 3.5); bool active = _astronaut.Height < 3.5;
//Debug.Log(_astronaut.Height); ReadySprite.SetActive(active);
WorldManager.Instance.PlayersActive[PlayerNumber] = active;
} }
// Use this for initialization // Use this for initialization
@ -38,5 +40,10 @@ public class MenuController : MonoBehaviour
{ {
_astronaut.Jump(); _astronaut.Jump();
} }
if (input.Actions.Contains("Start"))
{
Menu.StartGame();
}
} }
} }

View File

@ -1,21 +1,36 @@
using UnityEngine; using UnityEngine;
using System.Collections; using System.Collections;
using UnityEngine.SceneManagement;
public class MenuManager : MonoBehaviour { public class MenuManager : MonoBehaviour {
public bool canPlay = false;
public GameObject PressStart;
// Use this for initialization // Use this for initialization
void Start () { void Start () {
//Place all players //Place all players
/*Astronaut[] players = FindObjectOfType<Astronaut>(); MenuController[] players = FindObjectsOfType<MenuController>();
foreach (Astronaut p in players) Debug.Log(players.Length);
foreach (MenuController player in players)
{ {
p.SetTheta(); player.Menu = this;
}*/ }
} }
// Update is called once per frame // Update is called once per frame
void Update () { void Update () {
int numPlayers = 0;
foreach (bool b in WorldManager.Instance.PlayersActive)
numPlayers += b ? 1 : 0;
canPlay = numPlayers > 1;
PressStart.SetActive(canPlay);
}
public void StartGame()
{
if (canPlay)
SceneManager.LoadScene("Main");
} }
} }

View File

@ -1,25 +1,14 @@
using UnityEngine; using UnityEngine;
using System.Collections; using System.Collections;
public class WorldManager : MonoBehaviour { public class WorldManager
{
private static WorldManager instance = null; private static WorldManager instance = new WorldManager();
private WorldManager(){} public static WorldManager Instance
{
// Use this for initialization get { return instance; }
public void Awake () {
if (!instance)
{
instance = new WorldManager();
}
} }
private WorldManager() { }
public WorldManager getInstance() { public bool[] PlayersActive = { false, false, false, false };
return instance;
}
// Update is called once per frame
void Update () {
}
} }

View File

@ -113,8 +113,8 @@ Transform:
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 52383534} m_GameObject: {fileID: 52383534}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 2.26, z: -0.11} m_LocalPosition: {x: 0, y: 2.71, z: -0.11}
m_LocalScale: {x: 0.5, y: 0.6, z: 1} m_LocalScale: {x: 0.3, y: 0.35, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 10252813} m_Father: {fileID: 10252813}
m_RootOrder: 1 m_RootOrder: 1
@ -317,6 +317,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
ReadySprite: {fileID: 1394874970} ReadySprite: {fileID: 1394874970}
Menu: {fileID: 0}
PlayerNumber: 1 PlayerNumber: 1
--- !u!1 &334654674 stripped --- !u!1 &334654674 stripped
GameObject: GameObject:
@ -334,6 +335,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
ReadySprite: {fileID: 1358448712} ReadySprite: {fileID: 1358448712}
Menu: {fileID: 0}
PlayerNumber: 0 PlayerNumber: 0
--- !u!1 &345530092 --- !u!1 &345530092
GameObject: GameObject:
@ -389,8 +391,8 @@ Transform:
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 460107759} m_GameObject: {fileID: 460107759}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 2.26, z: -0.11} m_LocalPosition: {x: 0, y: 2.71, z: -0.11}
m_LocalScale: {x: 0.5, y: 0.6, z: 1} m_LocalScale: {x: 0.3, y: 0.35, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 1297255189} m_Father: {fileID: 1297255189}
m_RootOrder: 1 m_RootOrder: 1
@ -424,6 +426,64 @@ SpriteRenderer:
m_Color: {r: 0.08823532, g: 1, b: 0.13225162, a: 1} m_Color: {r: 0.08823532, g: 1, b: 0.13225162, a: 1}
m_FlipX: 0 m_FlipX: 0
m_FlipY: 0 m_FlipY: 0
--- !u!1 &771276056
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 771276057}
- 212: {fileID: 771276058}
m_Layer: 0
m_Name: T_Text_PressStart
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &771276057
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 771276056}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.15411687, y: -1.942733, z: -0.11}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1793181213}
m_RootOrder: 0
--- !u!212 &771276058
SpriteRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 771276056}
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: 69076e315a6e1064da20c70c88286915, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
--- !u!4 &780956563 stripped --- !u!4 &780956563 stripped
Transform: Transform:
m_PrefabParentObject: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} m_PrefabParentObject: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2}
@ -490,6 +550,64 @@ Prefab:
m_RemovedComponents: [] m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: df46c50b8d1900d41856ac14ea277586, type: 2} m_ParentPrefab: {fileID: 100100000, guid: df46c50b8d1900d41856ac14ea277586, type: 2}
m_IsPrefabParent: 0 m_IsPrefabParent: 0
--- !u!1 &916100836
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 916100837}
- 212: {fileID: 916100838}
m_Layer: 0
m_Name: T_PlanetTremor_Title_01
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &916100837
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 916100836}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3.32, y: 4.41, z: -0.11}
m_LocalScale: {x: 1.5, y: 1.5, z: 1}
m_Children: []
m_Father: {fileID: 1793181213}
m_RootOrder: 1
--- !u!212 &916100838
SpriteRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 916100836}
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: b10a47314c9e9f54eb0d62019ca49971, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
--- !u!114 &1027139440 stripped --- !u!114 &1027139440 stripped
MonoBehaviour: MonoBehaviour:
m_PrefabParentObject: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1, m_PrefabParentObject: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1,
@ -559,6 +677,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
ReadySprite: {fileID: 460107759} ReadySprite: {fileID: 460107759}
Menu: {fileID: 0}
PlayerNumber: 2 PlayerNumber: 2
--- !u!1001 &1223268487 --- !u!1001 &1223268487
Prefab: Prefab:
@ -748,8 +867,8 @@ Transform:
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1358448712} m_GameObject: {fileID: 1358448712}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 2.26, z: -0.11} m_LocalPosition: {x: 0, y: 2.71, z: -0.11}
m_LocalScale: {x: 0.5, y: 0.6, z: 1} m_LocalScale: {x: 0.3, y: 0.35, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 1419848163} m_Father: {fileID: 1419848163}
m_RootOrder: 1 m_RootOrder: 1
@ -806,8 +925,8 @@ Transform:
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1394874970} m_GameObject: {fileID: 1394874970}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 2.26, z: -0.11} m_LocalPosition: {x: 0, y: 2.71, z: -0.11}
m_LocalScale: {x: 0.5, y: 0.6, z: 1} m_LocalScale: {x: 0.3, y: 0.35, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 780956563} m_Father: {fileID: 780956563}
m_RootOrder: 1 m_RootOrder: 1
@ -912,6 +1031,10 @@ Prefab:
propertyPath: PlayerOffset propertyPath: PlayerOffset
value: 54 value: 54
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1, type: 2}
propertyPath: CartierResetRatioSpeedFactor
value: 0.1
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 198e988adacced646a19f757f6237ae1, type: 2} m_ParentPrefab: {fileID: 100100000, guid: 198e988adacced646a19f757f6237ae1, type: 2}
m_IsPrefabParent: 0 m_IsPrefabParent: 0
@ -1199,6 +1322,49 @@ Prefab:
- {fileID: 11434752, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} - {fileID: 11434752, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2}
m_ParentPrefab: {fileID: 100100000, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} m_ParentPrefab: {fileID: 100100000, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2}
m_IsPrefabParent: 0 m_IsPrefabParent: 0
--- !u!1 &1793181211
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1793181213}
- 114: {fileID: 1793181212}
m_Layer: 0
m_Name: MenuManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1793181212
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1793181211}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 67b495a5d73b72a45ad6c14e819a980a, type: 3}
m_Name:
m_EditorClassIdentifier:
canPlay: 0
PressStart: {fileID: 771276056}
--- !u!4 &1793181213
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1793181211}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.036000013, y: 0.0765, z: 0.11}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 771276057}
- {fileID: 916100837}
m_Father: {fileID: 0}
m_RootOrder: 8
--- !u!1001 &1867085521 --- !u!1001 &1867085521
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1372,7 +1538,7 @@ Camera:
far clip plane: 1000 far clip plane: 1000
field of view: 60 field of view: 60
orthographic: 1 orthographic: 1
orthographic size: 9.36 orthographic size: 6.46
m_Depth: -1 m_Depth: -1
m_CullingMask: m_CullingMask:
serializedVersion: 2 serializedVersion: 2
@ -1393,7 +1559,7 @@ Transform:
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1945693977} m_GameObject: {fileID: 1945693977}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10} m_LocalPosition: {x: 0, y: 1.41, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
@ -1414,4 +1580,5 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
ReadySprite: {fileID: 52383534} ReadySprite: {fileID: 52383534}
Menu: {fileID: 0}
PlayerNumber: 3 PlayerNumber: 3