mirror of
https://github.com/ConjureETS/PixelSphinx.git
synced 2026-03-24 02:20:58 +00:00
Added the main menu functionality - Demo build
This commit is contained in:
parent
cfc6224f6d
commit
d623e15232
BIN
Assets/Art/T_Winner_Screen_01.png
Normal file
BIN
Assets/Art/T_Winner_Screen_01.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 602 KiB |
57
Assets/Art/T_Winner_Screen_01.png.meta
Normal file
57
Assets/Art/T_Winner_Screen_01.png.meta
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1a44999b3aa3205409c63d7e38a15fe5
|
||||||
|
timeCreated: 1460239102
|
||||||
|
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:
|
||||||
@ -7,6 +7,11 @@ public class MenuManager : MonoBehaviour {
|
|||||||
public bool canPlay = false;
|
public bool canPlay = false;
|
||||||
public GameObject PressStart;
|
public GameObject PressStart;
|
||||||
|
|
||||||
|
void Awake()
|
||||||
|
{
|
||||||
|
WorldManager.Instance.PlayersActive = new bool[] { true, true, true, true } ;
|
||||||
|
}
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start () {
|
void Start () {
|
||||||
//Place all players
|
//Place all players
|
||||||
|
|||||||
@ -2,11 +2,14 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
public class PlanetManager : MonoBehaviour
|
public class PlanetManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
public float PlayerAngle;
|
public float PlayerAngle;
|
||||||
public float PlayerOffset;
|
public float PlayerOffset;
|
||||||
|
public bool InMenu;
|
||||||
|
public GameObject YouWin;
|
||||||
public int _NbActivePlayersRemaining = 0;
|
public int _NbActivePlayersRemaining = 0;
|
||||||
public int NbCartiers = 10;
|
public int NbCartiers = 10;
|
||||||
public float TailleCartiersEnDegres = 0; //radian -> valeurs 0 a 360
|
public float TailleCartiersEnDegres = 0; //radian -> valeurs 0 a 360
|
||||||
@ -22,6 +25,7 @@ public class PlanetManager : MonoBehaviour
|
|||||||
public GameObject WedgePrefab = null;
|
public GameObject WedgePrefab = null;
|
||||||
public List<Wedge> wedges = new List<Wedge>();
|
public List<Wedge> wedges = new List<Wedge>();
|
||||||
private int numPlayer;
|
private int numPlayer;
|
||||||
|
private bool gameEnded = false;
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
public void Awake () {
|
public void Awake () {
|
||||||
@ -65,9 +69,6 @@ public class PlanetManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
Destroy(GameObject.Find("Astronaut_3"));
|
Destroy(GameObject.Find("Astronaut_3"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
@ -229,6 +230,7 @@ public class PlanetManager : MonoBehaviour
|
|||||||
|
|
||||||
public void EjectPlayers(float range)
|
public void EjectPlayers(float range)
|
||||||
{
|
{
|
||||||
|
if (InMenu) return;
|
||||||
Astronaut[] players = FindObjectsOfType<Astronaut>();
|
Astronaut[] players = FindObjectsOfType<Astronaut>();
|
||||||
foreach (Astronaut p in players)
|
foreach (Astronaut p in players)
|
||||||
{
|
{
|
||||||
@ -260,7 +262,6 @@ public class PlanetManager : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,14 +271,21 @@ public class PlanetManager : MonoBehaviour
|
|||||||
//check if all players are dead
|
//check if all players are dead
|
||||||
if (numPlayer < 2)
|
if (numPlayer < 2)
|
||||||
{
|
{
|
||||||
if (numPlayer < 1)
|
if (!gameEnded)
|
||||||
|
{
|
||||||
|
StartCoroutine(EndGame());
|
||||||
|
WorldManager.Instance.PlayersActive = new bool[] { true, true, true, true };
|
||||||
|
YouWin.SetActive(true);
|
||||||
|
gameEnded = true;
|
||||||
|
}
|
||||||
|
/*if (numPlayer < 1)
|
||||||
{
|
{
|
||||||
print("game is lost");
|
print("game is lost");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print("winner is you!");
|
print("winner is you!");
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,6 +360,15 @@ public class PlanetManager : MonoBehaviour
|
|||||||
return new Vector3(x, y, 0);
|
return new Vector3(x, y, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IEnumerator EndGame()
|
||||||
|
{
|
||||||
|
for (float i = 0; i < 5; i+= Time.deltaTime)
|
||||||
|
{
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
SceneManager.LoadScene("Selection");
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// retourn le no de plateforme
|
/// retourn le no de plateforme
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -10,5 +10,5 @@ public class WorldManager
|
|||||||
}
|
}
|
||||||
private WorldManager() { }
|
private WorldManager() { }
|
||||||
|
|
||||||
public bool[] PlayersActive = { true, true, false, false };
|
public bool[] PlayersActive = { true, true, true, true };
|
||||||
}
|
}
|
||||||
|
|||||||
@ -697,9 +697,17 @@ Prefab:
|
|||||||
propertyPath: PlayerOffset
|
propertyPath: PlayerOffset
|
||||||
value: 108
|
value: 108
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1, type: 2}
|
||||||
|
propertyPath: YouWin
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 2026503038}
|
||||||
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
|
||||||
|
--- !u!4 &1469146137 stripped
|
||||||
|
Transform:
|
||||||
|
m_PrefabParentObject: {fileID: 421424, guid: 198e988adacced646a19f757f6237ae1, type: 2}
|
||||||
|
m_PrefabInternal: {fileID: 1469146136}
|
||||||
--- !u!1001 &1481633668
|
--- !u!1001 &1481633668
|
||||||
Prefab:
|
Prefab:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -1192,3 +1200,61 @@ MonoBehaviour:
|
|||||||
shakeTimeAmount: 0
|
shakeTimeAmount: 0
|
||||||
shakeAmount: 0.6
|
shakeAmount: 0.6
|
||||||
decreaseFactor: 1
|
decreaseFactor: 1
|
||||||
|
--- !u!1 &2026503038
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
serializedVersion: 4
|
||||||
|
m_Component:
|
||||||
|
- 4: {fileID: 2026503040}
|
||||||
|
- 212: {fileID: 2026503039}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: T_Winner_Screen_01
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 0
|
||||||
|
--- !u!212 &2026503039
|
||||||
|
SpriteRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2026503038}
|
||||||
|
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: 1a44999b3aa3205409c63d7e38a15fe5, type: 3}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_FlipX: 0
|
||||||
|
m_FlipY: 0
|
||||||
|
--- !u!4 &2026503040
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2026503038}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -0.07468354, y: 0.021518989, z: 0}
|
||||||
|
m_LocalScale: {x: 0.12658228, y: 0.12658228, z: 10}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 1469146137}
|
||||||
|
m_RootOrder: 1
|
||||||
|
|||||||
@ -145,7 +145,7 @@ SpriteRenderer:
|
|||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingOrder: 5
|
m_SortingOrder: 5
|
||||||
m_Sprite: {fileID: 21300000, guid: d2d6ea121d5394f438fc5ae564a441a1, type: 3}
|
m_Sprite: {fileID: 21300000, guid: d2d6ea121d5394f438fc5ae564a441a1, type: 3}
|
||||||
m_Color: {r: 0.08823532, g: 1, b: 0.13225162, a: 1}
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
m_FlipX: 0
|
m_FlipX: 0
|
||||||
m_FlipY: 0
|
m_FlipY: 0
|
||||||
--- !u!1001 &72971843
|
--- !u!1001 &72971843
|
||||||
@ -423,7 +423,7 @@ SpriteRenderer:
|
|||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingOrder: 5
|
m_SortingOrder: 5
|
||||||
m_Sprite: {fileID: 21300000, guid: d2d6ea121d5394f438fc5ae564a441a1, type: 3}
|
m_Sprite: {fileID: 21300000, guid: d2d6ea121d5394f438fc5ae564a441a1, type: 3}
|
||||||
m_Color: {r: 0.08823532, g: 1, b: 0.13225162, a: 1}
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
m_FlipX: 0
|
m_FlipX: 0
|
||||||
m_FlipY: 0
|
m_FlipY: 0
|
||||||
--- !u!1 &771276056
|
--- !u!1 &771276056
|
||||||
@ -899,7 +899,7 @@ SpriteRenderer:
|
|||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingOrder: 5
|
m_SortingOrder: 5
|
||||||
m_Sprite: {fileID: 21300000, guid: d2d6ea121d5394f438fc5ae564a441a1, type: 3}
|
m_Sprite: {fileID: 21300000, guid: d2d6ea121d5394f438fc5ae564a441a1, type: 3}
|
||||||
m_Color: {r: 0.08823532, g: 1, b: 0.13225162, a: 1}
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
m_FlipX: 0
|
m_FlipX: 0
|
||||||
m_FlipY: 0
|
m_FlipY: 0
|
||||||
--- !u!1 &1394874970
|
--- !u!1 &1394874970
|
||||||
@ -957,7 +957,7 @@ SpriteRenderer:
|
|||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingOrder: 5
|
m_SortingOrder: 5
|
||||||
m_Sprite: {fileID: 21300000, guid: d2d6ea121d5394f438fc5ae564a441a1, type: 3}
|
m_Sprite: {fileID: 21300000, guid: d2d6ea121d5394f438fc5ae564a441a1, type: 3}
|
||||||
m_Color: {r: 0.08823532, g: 1, b: 0.13225162, a: 1}
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
m_FlipX: 0
|
m_FlipX: 0
|
||||||
m_FlipY: 0
|
m_FlipY: 0
|
||||||
--- !u!4 &1419848163 stripped
|
--- !u!4 &1419848163 stripped
|
||||||
@ -1035,6 +1035,10 @@ Prefab:
|
|||||||
propertyPath: CartierResetRatioSpeedFactor
|
propertyPath: CartierResetRatioSpeedFactor
|
||||||
value: 0.1
|
value: 0.1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1, type: 2}
|
||||||
|
propertyPath: InMenu
|
||||||
|
value: 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
|
||||||
|
|||||||
@ -5,5 +5,7 @@ EditorBuildSettings:
|
|||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Scenes:
|
m_Scenes:
|
||||||
|
- enabled: 1
|
||||||
|
path: Assets/_Scenes/Selection.unity
|
||||||
- enabled: 1
|
- enabled: 1
|
||||||
path: Assets/_Scenes/Main.unity
|
path: Assets/_Scenes/Main.unity
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user