Player selector separated
This commit is contained in:
@@ -5,11 +5,22 @@ using UnityEngine.UI;
|
||||
|
||||
public class HubManager : MonoBehaviour
|
||||
{
|
||||
public static HubManager Instance;
|
||||
|
||||
public GameObject hubCamera;
|
||||
public GameObject gameButtonsParent;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("A HubManager already exists.");
|
||||
Destroy(this.gameObject);
|
||||
}
|
||||
hubCamera.SetActive(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ MonoBehaviour:
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 0}
|
||||
- m_Target: {fileID: 3284257257135167210}
|
||||
m_TargetAssemblyTypeName: PlayerManager, Assembly-CSharp
|
||||
m_MethodName: StartGame
|
||||
m_Mode: 1
|
||||
@@ -345,6 +345,103 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
playerJoinCardPrefab: {fileID: 539213549865726557, guid: e98314581589e49cf928afa2ae1398f2, type: 3}
|
||||
--- !u!1 &2163898604493315332
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8612248123672679463}
|
||||
- component: {fileID: 5917247641314516890}
|
||||
- component: {fileID: 3284257257135167210}
|
||||
m_Layer: 0
|
||||
m_Name: Player Manager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8612248123672679463
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2163898604493315332}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: -1014, y: -554, z: -10.092264}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 8640926751425774204}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &5917247641314516890
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2163898604493315332}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 621567455fd1c4ceb811cc8a00b6a1a5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_NotificationBehavior: 0
|
||||
m_MaxPlayerCount: -1
|
||||
m_AllowJoining: 1
|
||||
m_JoinBehavior: 1
|
||||
m_PlayerJoinedEvent:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_PlayerLeftEvent:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_JoinAction:
|
||||
m_UseReference: 1
|
||||
m_Action:
|
||||
m_Name: Join
|
||||
m_Type: 0
|
||||
m_ExpectedControlType:
|
||||
m_Id: 9b26d698-45b8-4b09-bfa5-81c3a8afe391
|
||||
m_Processors:
|
||||
m_Interactions:
|
||||
m_SingletonActionBindings: []
|
||||
m_Flags: 0
|
||||
m_Reference: {fileID: -7962223595281827953, guid: 6cbaae0ad99590d468c8b501c0452c36, type: 3}
|
||||
m_PlayerPrefab: {fileID: 1375850422501237868, guid: 1fd31b88e5609482ab7e8ab16a932947, type: 3}
|
||||
m_SplitScreen: 0
|
||||
m_MaintainAspectRatioInSplitScreen: 0
|
||||
m_FixedNumberOfSplitScreens: -1
|
||||
m_SplitScreenRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
--- !u!114 &3284257257135167210
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2163898604493315332}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 33e0fad1e452e0140bc99e780d4dda4f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
cards: []
|
||||
playerActions: {fileID: -944628639613478452, guid: 6cbaae0ad99590d468c8b501c0452c36, type: 3}
|
||||
playerColors:
|
||||
- {r: 1, g: 0.10015053, b: 0, a: 1}
|
||||
- {r: 0, g: 0.37863922, b: 1, a: 1}
|
||||
- {r: 1, g: 0.7593924, b: 0, a: 1}
|
||||
- {r: 0.37311256, g: 1, b: 0, a: 1}
|
||||
playerSelect: {fileID: 0}
|
||||
--- !u!1 &4033582026464147697
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -782,6 +879,7 @@ Transform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 8612248123672679463}
|
||||
- {fileID: 1280651175137877395}
|
||||
- {fileID: 597459829403929617}
|
||||
m_Father: {fileID: 0}
|
||||
|
||||
@@ -359,7 +359,6 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 33e0fad1e452e0140bc99e780d4dda4f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
players: []
|
||||
cards: []
|
||||
playerActions: {fileID: -944628639613478452, guid: 6cbaae0ad99590d468c8b501c0452c36, type: 3}
|
||||
playerColors:
|
||||
@@ -367,7 +366,7 @@ MonoBehaviour:
|
||||
- {r: 0, g: 0.37863922, b: 1, a: 1}
|
||||
- {r: 1, g: 0.7593924, b: 0, a: 1}
|
||||
- {r: 0.37311256, g: 1, b: 0, a: 1}
|
||||
playerSelect: {fileID: 1633531800}
|
||||
playerSelect: {fileID: 0}
|
||||
--- !u!114 &804358386
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -427,6 +426,51 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1125946066
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1125946068}
|
||||
- component: {fileID: 1125946067}
|
||||
m_Layer: 0
|
||||
m_Name: Game Manager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1125946067
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1125946066}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d6e4006937b044c9ab3de25a7ab68162, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
spawnPosition: {x: 0, y: 20}
|
||||
--- !u!4 &1125946068
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1125946066}
|
||||
serializedVersion: 2
|
||||
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_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1162228706
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -3948,11 +3992,6 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1633531800 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 7581121400164956810, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
m_PrefabInstance: {fileID: 1678402538523344735}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &1758254987
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -7605,67 +7644,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
parallaxCamera: {fileID: 8682934954266721943}
|
||||
--- !u!1001 &1678402538523344735
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 4162490554469064066, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
|
||||
value:
|
||||
objectReference: {fileID: 804358385}
|
||||
- target: {fileID: 7581121400164956810, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Player Select
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 1012
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 569
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
--- !u!1001 &8682934954266721942
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -7734,10 +7712,6 @@ PrefabInstance:
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308997821520447826, guid: e659ce6dc4d58ff4f9726fa05e1bab20, type: 3}
|
||||
propertyPath: m_Enabled
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
@@ -7763,5 +7737,5 @@ SceneRoots:
|
||||
- {fileID: 1758254989}
|
||||
- {fileID: 1335742587}
|
||||
- {fileID: 804358387}
|
||||
- {fileID: 1678402538523344735}
|
||||
- {fileID: 2119246465}
|
||||
- {fileID: 1125946068}
|
||||
|
||||
187
Assets/Scenes/Player Select.unity
Normal file
187
Assets/Scenes/Player Select.unity
Normal file
@@ -0,0 +1,187 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 10
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 3
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 13
|
||||
m_BakeOnSceneLoad: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 0
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 256
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRDenoiserTypeDirect: 1
|
||||
m_PVRDenoiserTypeIndirect: 1
|
||||
m_PVRDenoiserTypeAO: 1
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 1
|
||||
m_PVRFilteringGaussRadiusAO: 1
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 3
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
buildHeightMesh: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1001 &1678402538523344735
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 4162490554469064066, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
|
||||
value:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7581121400164956810, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Player Select
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 1012
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 569
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8640926751425774204, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 52622bff9e983494eb206a8735b4dbbf, type: 3}
|
||||
--- !u!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Roots:
|
||||
- {fileID: 1678402538523344735}
|
||||
7
Assets/Scenes/Player Select.unity.meta
Normal file
7
Assets/Scenes/Player Select.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c4687173f3c444edeb7ceed737239636
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -2184,7 +2184,7 @@ MonoBehaviour:
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument: Platformer With Headroom
|
||||
m_StringArgument: Player Select
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!212 &1227248460
|
||||
|
||||
@@ -16,7 +16,7 @@ public class PlayerCardCreator : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public PlayerJoinCard CreateCard(PlayerInput input)
|
||||
public PlayerJoinCard CreateCard()
|
||||
{
|
||||
GameObject card = Instantiate(playerJoinCardPrefab, transform);
|
||||
return card.GetComponent<PlayerJoinCard>();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class GameManager : MonoBehaviour
|
||||
@@ -10,4 +11,18 @@ public class GameManager : MonoBehaviour
|
||||
}
|
||||
|
||||
public static GameMode gameMode = GameMode.freeForAll;
|
||||
|
||||
public static string map = "Platformer With Headroom";
|
||||
|
||||
public static List<GameObject> players = new List<GameObject>();
|
||||
|
||||
public Vector2 spawnPosition;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
foreach (GameObject player in players)
|
||||
{
|
||||
player.transform.position = spawnPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public class PlayerCameraMovement : MonoBehaviour
|
||||
|
||||
private void Update()
|
||||
{
|
||||
List<GameObject> players = PlayerManager.Instance.players;
|
||||
List<GameObject> players = GameManager.players;
|
||||
|
||||
if (players.Count == 0) return;
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ public class PlayerManager : MonoBehaviour
|
||||
{
|
||||
public static PlayerManager Instance;
|
||||
|
||||
public List<GameObject> players;
|
||||
public List<PlayerJoinCard> cards;
|
||||
[SerializeField] private InputActionAsset playerActions;
|
||||
|
||||
@@ -14,8 +13,6 @@ public class PlayerManager : MonoBehaviour
|
||||
|
||||
public GameObject playerSelect;
|
||||
|
||||
private Vector2 spawnPosition;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Init();
|
||||
@@ -29,22 +26,24 @@ public class PlayerManager : MonoBehaviour
|
||||
|
||||
private void OnPlayerJoined(PlayerInput playerInput)
|
||||
{
|
||||
playerInput.transform.SetParent(transform);
|
||||
|
||||
PlayerJoinCard card = PlayerCardCreator.Instance.CreateCard(playerInput);
|
||||
card.playerNumber = players.Count + 1;
|
||||
print("Player joined");
|
||||
|
||||
//playerInput.transform.SetParent(transform);
|
||||
DontDestroyOnLoad(playerInput.gameObject);
|
||||
|
||||
PlayerJoinCard card = PlayerCardCreator.Instance.CreateCard();
|
||||
card.playerNumber = GameManager.players.Count + 1;
|
||||
cards.Add(card);
|
||||
|
||||
playerInput.transform.position = spawnPosition;
|
||||
players.Add(playerInput.gameObject);
|
||||
Colorize(players.Count - 1);
|
||||
print("Player joined");
|
||||
GameManager.players.Add(playerInput.gameObject);
|
||||
|
||||
Colorize(GameManager.players.Count - 1);
|
||||
}
|
||||
|
||||
private void OnPlayerLeft(PlayerInput playerInput)
|
||||
{
|
||||
Destroy(playerInput.gameObject);
|
||||
players.Remove(playerInput.gameObject);
|
||||
GameManager.players.Remove(playerInput.gameObject);
|
||||
print("Player left");
|
||||
}
|
||||
|
||||
@@ -59,36 +58,23 @@ public class PlayerManager : MonoBehaviour
|
||||
print("A PlayerManager already exists.");
|
||||
Destroy(this.gameObject);
|
||||
}
|
||||
|
||||
spawnPosition = transform.position;
|
||||
}
|
||||
|
||||
public void StartGame()
|
||||
{
|
||||
foreach (Camera camera in FindObjectsByType<Camera>(FindObjectsSortMode.None))
|
||||
{
|
||||
camera.enabled = !camera.enabled;
|
||||
}
|
||||
|
||||
foreach (GameObject player in players)
|
||||
{
|
||||
player.transform.position = spawnPosition;
|
||||
player.GetComponent<Damageable>().damage = 0f;
|
||||
}
|
||||
|
||||
Destroy(playerSelect);
|
||||
HubManager.Instance.LoadScene(GameManager.map);
|
||||
}
|
||||
|
||||
private void Colorize(int index)
|
||||
{
|
||||
GameObject player = players[index];
|
||||
GameObject player = GameManager.players[index];
|
||||
|
||||
Color color = playerColors[(players.Count - 1) % playerColors.Count];
|
||||
float tint = Mathf.Floor((players.Count - 1) / playerColors.Count);
|
||||
Color color = playerColors[(GameManager.players.Count - 1) % playerColors.Count];
|
||||
float tint = Mathf.Floor((GameManager.players.Count - 1) / playerColors.Count);
|
||||
color = (color + color + Color.white * tint) / (tint + 2);
|
||||
|
||||
ApplyColor(player, color);
|
||||
ApplyColor(cards[players.IndexOf(player)].playerPreview, color);
|
||||
ApplyColor(cards[GameManager.players.IndexOf(player)].playerPreview, color);
|
||||
}
|
||||
|
||||
private void ApplyColor(GameObject obj, Color color)
|
||||
|
||||
@@ -5,18 +5,12 @@ EditorBuildSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Scenes:
|
||||
- enabled: 0
|
||||
path: Assets/Old/Hub/Hub.unity
|
||||
guid: 218f4d2e730ae4d5a8ac6b2a48440175
|
||||
- enabled: 0
|
||||
path: Assets/Old/Pong/Pong.unity
|
||||
guid: 8c9cfa26abfee488c85f1582747f6a02
|
||||
- enabled: 0
|
||||
path: Assets/Scenes/Platformer.unity
|
||||
guid: 38493d985d15144a7ba4c78a9e6b68f9
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/Title Screen.unity
|
||||
guid: 058d7a4228c684a72b3ba88c80918819
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/Player Select.unity
|
||||
guid: c4687173f3c444edeb7ceed737239636
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/Platformer With Headroom.unity
|
||||
guid: e7d298a99af7a4dfb947795f0e02e4f0
|
||||
|
||||
Reference in New Issue
Block a user