diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index 8b7d897..2e8067f 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -147,7 +147,6 @@ MonoBehaviour: type: 3} bombPrefab: {fileID: 3117706498189798980, guid: a43946458f796064fb840e21926c557b, type: 3} - arena: {fileID: 0} --- !u!114 &8085068997774988276 MonoBehaviour: m_ObjectHideFlags: 0 @@ -235,7 +234,7 @@ Rigidbody: m_Mass: 1 m_Drag: 0 m_AngularDrag: 0.05 - m_UseGravity: 0 + m_UseGravity: 1 m_IsKinematic: 0 m_Interpolate: 0 m_Constraints: 112 diff --git a/Assets/Scenes/MainScene Movement.unity b/Assets/Scenes/MainScene Movement.unity index 2a04ee0..98d473b 100644 --- a/Assets/Scenes/MainScene Movement.unity +++ b/Assets/Scenes/MainScene Movement.unity @@ -520,21 +520,15 @@ MonoBehaviour: m_RotationMode: 0 m_UpdateMethod: 2 m_Targets: - - target: {fileID: 2004073202} + - target: {fileID: 0} weight: 1 radius: 1 - - target: {fileID: 1633331188} + - target: {fileID: 0} weight: 1 radius: 1 - - target: {fileID: 1127976299} + - target: {fileID: 0} weight: 1 radius: 1 ---- !u!4 &1127976299 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - m_PrefabInstance: {fileID: 1585897015} - m_PrefabAsset: {fileID: 0} --- !u!1 &1349241911 GameObject: m_ObjectHideFlags: 0 @@ -544,6 +538,8 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 1349241912} + - component: {fileID: 1349241914} + - component: {fileID: 1349241913} m_Layer: 0 m_Name: Players m_TagString: Untagged @@ -561,13 +557,121 @@ Transform: 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: 2004073202} - - {fileID: 1633331188} - - {fileID: 1127976299} + m_Children: [] m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1349241913 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1349241911} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 621567455fd1c4ceb811cc8a00b6a1a5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NotificationBehavior: 2 + m_MaxPlayerCount: -1 + m_AllowJoining: 1 + m_JoinBehavior: 1 + m_PlayerJoinedEvent: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1349241914} + m_MethodName: OnPlayerJoined + m_Mode: 0 + 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_PlayerLeftEvent: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1349241914} + m_MethodName: OnPlayerLeft + m_Mode: 0 + 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_JoinAction: + m_UseReference: 0 + m_Action: + m_Name: Join + m_Type: 0 + m_ExpectedControlType: + m_Id: 14213029-6141-4b85-8552-69b258993bbd + m_Processors: + m_Interactions: + m_SingletonActionBindings: + - m_Name: + m_Id: fe0e82f0-3010-4444-b9b3-618510d1134c + m_Path: /buttonSouth + m_Interactions: + m_Processors: + m_Groups: + m_Action: Join + m_Flags: 0 + - m_Name: + m_Id: f29e160c-c467-4c1e-914f-13543c7e2f05 + m_Path: /start + m_Interactions: + m_Processors: + m_Groups: + m_Action: Join + m_Flags: 0 + - m_Name: + m_Id: 128daca3-95f7-4d96-8493-4752e2baca99 + m_Path: /space + m_Interactions: + m_Processors: + m_Groups: + m_Action: Join + m_Flags: 0 + - m_Name: + m_Id: 395bc498-ede6-4778-a5a0-6e98f62bdd4e + m_Path: /enter + m_Interactions: + m_Processors: + m_Groups: + m_Action: Join + m_Flags: 0 + m_Reference: {fileID: 0} + m_PlayerPrefab: {fileID: 8085068997774988267, guid: c432013b1f3140b40809ac8429d44961, + 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 &1349241914 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1349241911} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7eac22cc38c0734caa04d2377c7739a, type: 3} + m_Name: + m_EditorClassIdentifier: + players: [] --- !u!1 &1552615379 GameObject: m_ObjectHideFlags: 3 @@ -719,180 +823,6 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &1585897015 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 1349241912} - m_Modifications: - - target: {fileID: 8085068996913792608, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_Materials.Array.data[0] - value: - objectReference: {fileID: 2100000, guid: b30530c763953e04f97dc7914e2ae7aa, type: 2} - - target: {fileID: 8085068997774988267, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_Name - value: Player (2) - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988275, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: arena - value: - objectReference: {fileID: 2090411360} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalPosition.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalPosition.z - value: -7.29 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_RootOrder - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988279, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_Materials.Array.data[0] - value: - objectReference: {fileID: 2100000, guid: b30530c763953e04f97dc7914e2ae7aa, type: 2} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: c432013b1f3140b40809ac8429d44961, type: 3} ---- !u!4 &1633331188 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - m_PrefabInstance: {fileID: 1713979939} - m_PrefabAsset: {fileID: 0} ---- !u!1001 &1713979939 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 1349241912} - m_Modifications: - - target: {fileID: 8085068996913792608, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_Materials.Array.data[0] - value: - objectReference: {fileID: 2100000, guid: 61e257700ce329d49a1dffac7ce6d595, type: 2} - - target: {fileID: 8085068997774988267, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_Name - value: Player (1) - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988275, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: arena - value: - objectReference: {fileID: 2090411360} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalPosition.x - value: 3.94 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalPosition.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988279, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_Materials.Array.data[0] - value: - objectReference: {fileID: 2100000, guid: 61e257700ce329d49a1dffac7ce6d595, type: 2} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: c432013b1f3140b40809ac8429d44961, type: 3} --- !u!1 &1752689708 GameObject: m_ObjectHideFlags: 0 @@ -1076,12 +1006,6 @@ MonoBehaviour: m_RequiresDepthTexture: 0 m_RequiresColorTexture: 0 m_Version: 2 ---- !u!4 &2004073202 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - m_PrefabInstance: {fileID: 8085068998021310727} - m_PrefabAsset: {fileID: 0} --- !u!1 &2090411359 GameObject: m_ObjectHideFlags: 0 @@ -1128,77 +1052,3 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &8085068998021310727 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 1349241912} - m_Modifications: - - target: {fileID: 8085068997774988267, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_Name - value: Player - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988275, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: arena - value: - objectReference: {fileID: 2090411360} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalPosition.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalPosition.z - value: 3.5 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_RootOrder - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8085068997774988277, guid: c432013b1f3140b40809ac8429d44961, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: c432013b1f3140b40809ac8429d44961, type: 3} diff --git a/Assets/Scripts/Lobby.cs b/Assets/Scripts/Lobby.cs new file mode 100644 index 0000000..a55cbc5 --- /dev/null +++ b/Assets/Scripts/Lobby.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.InputSystem; +using Random = UnityEngine.Random; + +public class Lobby : MonoBehaviour { + [SerializeField] List players; + + void Awake() => players = new List(); + + public void OnPlayerJoined(PlayerInput playerInput) { + playerInput.transform.parent = transform; + + players.Add(playerInput.GetComponent()); + + playerInput.gameObject.name = "Player " + players.Count; + Debug.Log(playerInput.gameObject.name + " joined!"); + + var color = Random.ColorHSV(0, 1, 0.8f, 1, 0.8f, 1); + playerInput.GetComponent().material + .color = color; + + float h, s, v; + Color.RGBToHSV(color, out h, out s, out v); + playerInput.transform.GetChild(0).GetComponent().material + .color = Color.HSVToRGB((h - 0.05f) % 1f, s + 0.05f, v - 0.1f); + + } + + public void OnPlayerLeft(PlayerInput playerInput) + => Debug.Log(playerInput.gameObject.name + " left :O"); +} \ No newline at end of file diff --git a/Assets/Scripts/Lobby.cs.meta b/Assets/Scripts/Lobby.cs.meta new file mode 100644 index 0000000..47e58c9 --- /dev/null +++ b/Assets/Scripts/Lobby.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b7eac22cc38c0734caa04d2377c7739a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Player.cs b/Assets/Scripts/Player.cs index 18bcfcc..4354f42 100644 --- a/Assets/Scripts/Player.cs +++ b/Assets/Scripts/Player.cs @@ -5,9 +5,11 @@ using UnityEngine.InputSystem; public class Player : MonoBehaviour { public GameObject labelPrefab; public GameObject bombPrefab; - public Arena arena; - + + Arena arena; int strength = 1; + + void Awake() => arena = GameObject.Find("Arena").GetComponent(); void Start() { Transform canvas = GameObject.Find("Canvas").transform; diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 7404e25..4b6255b 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2019.4.1f1 -m_EditorVersionWithRevision: 2019.4.1f1 (e6c045e14e4e) +m_EditorVersion: 2019.4.3f1 +m_EditorVersionWithRevision: 2019.4.3f1 (f880dceab6fe) diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset index cab35cc..a45c679 100644 --- a/ProjectSettings/QualitySettings.asset +++ b/ProjectSettings/QualitySettings.asset @@ -95,7 +95,7 @@ QualitySettings: skinWeights: 2 textureQuality: 0 anisotropicTextures: 1 - antiAliasing: 0 + antiAliasing: 2 softParticles: 0 softVegetation: 1 realtimeReflectionProbes: 1