Commit 719329b1 authored by Abdulrahman Mohammed's avatar Abdulrahman Mohammed

Done with lobby & Realy & Player Data and more

parent 9dbded49
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
fileFormatVersion: 2
guid: 1bddaa6d28a025f4ea5e0ab2d8626077
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 13945ac71fb987c4b852f9da18082e90
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 07db3674ee1770e43a359aa468ea4a78
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 112000000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 87881d620d9ea6e4d81726a0cec02602
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 1
seamlessCubemap: 1
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: 0
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 2
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 100
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WindowsStoreApps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 352bf19a87eb5f84da505d6b76a39310
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
using Unity.Services.Authentication;
using Unity.Services.Core;
using UnityEngine;
public class AppInit : MonoBehaviour
{
private async void Start()
{
Application.targetFrameRate = 60;
await UnityServices.InitializeAsync();
await AuthenticationRequest.StartAuth();
}
}
fileFormatVersion: 2 fileFormatVersion: 2
guid: 370cfd0e752ac684196e8f0079e99762 guid: 31766047a0063dc438f31d0b3db24006
\ No newline at end of file \ No newline at end of file
using EasyTransition;
using Unity.VectorGraphics;
using UnityEngine;
using UnityEngine.SceneManagement;
public class ChangeSceneManager : MonoBehaviour
{
public static ChangeSceneManager Instance { get; private set; }
[SerializeField] TransitionSettings transitionSettings;
private void Awake()
{
if (Instance == null)
Instance = this;
else
Destroy(this);
}
void Change(string sceneName)
{
// TransitionManager.Instance().Transition(sceneName, transitionSettings,0);
SceneManager.LoadScene(sceneName);
}
void Change(int sceneIndex)
{
// TransitionManager.Instance().Transition(sceneName, transitionSettings,0);
SceneManager.LoadScene(sceneIndex);
}
public void ChangeToLobbyScene()
{
Change("LobbyScene");
}
public void ChangeToMainmenuScene()
{
Change("MainMenu");
}
}
fileFormatVersion: 2 fileFormatVersion: 2
guid: c2748c014d68398489af6ae652c0769f guid: c574610257016cb4ea3bcbc2fd758e50
\ No newline at end of file \ No newline at end of file
...@@ -8,51 +8,9 @@ public class ScoreManager : NetworkBehaviour ...@@ -8,51 +8,9 @@ public class ScoreManager : NetworkBehaviour
[SerializeField] LeaderboardText leaderboardPrefab; [SerializeField] LeaderboardText leaderboardPrefab;
[SerializeField] Transform leaderboardWinParent; [SerializeField] Transform leaderboardWinParent;
private void UpdateLeaderboard()
Dictionary<ulong, string> players = new Dictionary<ulong, string>();
Dictionary<ulong, int> scoreList = new Dictionary<ulong, int>();
Dictionary<ulong, LeaderboardText> leaderboardUIElements = new Dictionary<ulong, LeaderboardText>();
[Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Everyone)]
public void AddPlayersServerRpc(ulong playerId, string playerName)
{
if (!players.ContainsKey(playerId))
{ {
players.Add(playerId, playerName);
}
if (!scoreList.ContainsKey(playerId))
{
scoreList.Add(playerId, 0);
}
AddPlayerToLeaderboardClientRpc(playerId, playerName);
}
[Rpc(SendTo.ClientsAndHost)]
private void AddPlayerToLeaderboardClientRpc(ulong playerId, string playerName)
{
LeaderboardText newLeaderboardElement = Instantiate(leaderboardPrefab, leaderboardParent);
newLeaderboardElement.UpdatePlayerScore(playerId, playerName, 0);
leaderboardUIElements[playerId] = newLeaderboardElement;
}
public void AddScoreToList(ulong playerId, int score)
{
if (IsServer)
{
if (!scoreList.ContainsKey(playerId)) scoreList.Add(playerId, score);
else scoreList[playerId] = score;
UpdateLeaderboardClientRpc();
}
}
[Rpc(SendTo.ClientsAndHost)]
private void UpdateLeaderboardClientRpc()
{
Debug.Log(scoreList.Count);
Debug.Log(players.Count);
//var leaderboard = scoreList.OrderByDescending(x => x.Value).ToList(); //var leaderboard = scoreList.OrderByDescending(x => x.Value).ToList();
//for (int i = 0; i < leaderboard.Count; i++) //for (int i = 0; i < leaderboard.Count; i++)
......
...@@ -3,7 +3,6 @@ using UnityEngine; ...@@ -3,7 +3,6 @@ using UnityEngine;
[CreateAssetMenu(fileName = "GameSetting", menuName = "Scriptable Objects/GameSetting")] [CreateAssetMenu(fileName = "GameSetting", menuName = "Scriptable Objects/GameSetting")]
public class GameSetting : ScriptableObject public class GameSetting : ScriptableObject
{ {
[field: SerializeField] public int MaxPlayersInGame { get; private set; }
[field: SerializeField] public int MaxAnimalsInRound { get; private set; } [field: SerializeField] public int MaxAnimalsInRound { get; private set; }
[field: SerializeField] public int TimeOfRound { get; private set; } [field: SerializeField] public int TimeOfRound { get; private set; }
[field: SerializeField] public int NumberOfRounds { get; private set; } [field: SerializeField] public int NumberOfRounds { get; private set; }
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 23847be85f003824a9bf9f10244fcfc6 guid: 2a90b69c741806a44b86ca46bc8baec0
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
......
using Unity.Netcode;
public struct PlayerData : INetworkSerializable
{
public ulong playerId;
public ulong playerName;
public ulong playerAvatar;
public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
{
serializer.SerializeValue(ref playerId);
serializer.SerializeValue(ref playerName);
serializer.SerializeValue(ref playerAvatar);
}
}
fileFormatVersion: 2 fileFormatVersion: 2
guid: aa4d058fbc279b04aaa4d4f6b4c21d5b guid: 837186c0124e929429e67d97131db225
\ No newline at end of file \ No newline at end of file
fileFormatVersion: 2
guid: 6af6987fab33f834ab67619371a85276
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using TMPro;
using Unity.Services.Lobbies;
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
using Unity.Services.Lobbies.Models;
public class CreateLobby : MonoBehaviour
{
[SerializeField] TMP_InputField lobbyNameInput;
[SerializeField] Toggle lobbyPriveteToggle;
[SerializeField] Button CreateLobbyButton;
FadeWithText _fadeWithText;
private void Start()
{
CreateLobbyButton.onClick.AddListener(Create);
_fadeWithText = FadeWithText.Instance;
}
private async void Create()
{
if (!string.IsNullOrEmpty(lobbyNameInput.text))
{
CreateLobbyButton.interactable = false;
_fadeWithText.ShowMessage("جاري التحميل...", false);
bool createLobby = await LobbyRequest.Create(lobbyNameInput.text, 4, LobbyOptions());
if (createLobby)
{
ChangeSceneManager.Instance.ChangeToLobbyScene();
}
else
{
CreateLobbyButton.interactable = true;
FadeWithText.Instance.ShowMessage("حدث خطأ", true);
}
}
else
_fadeWithText.ShowMessage("من فضلك ادخل اسم الغرفة", true);
}
CreateLobbyOptions LobbyOptions()
{
CreateLobbyOptions lobbyOptions = new CreateLobbyOptions();
lobbyOptions.IsPrivate = lobbyPriveteToggle.isOn;
lobbyOptions.Data = new Dictionary<string, DataObject>
{
{"AllocationCode",new DataObject(visibility: DataObject.VisibilityOptions.Member,value:"") },
{"NPCsCount", new DataObject(visibility:DataObject.VisibilityOptions.Public,value:"0") }
};
return lobbyOptions;
}
}
fileFormatVersion: 2
guid: 593e38993ca6daa4084c75dd6b153806
\ No newline at end of file
using System;
using System.Threading.Tasks;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class JoinLobbyByCode : MonoBehaviour
{
[SerializeField] TMP_InputField lobbyCodeInput;
[SerializeField] Button createLobbyButton;
void Start()
{
createLobbyButton.onClick.AddListener(Join);
}
private async void Join()
{
if (!string.IsNullOrEmpty(lobbyCodeInput.text))
{
createLobbyButton.interactable = false;
FadeWithText.Instance.ShowMessage("جاري التحميل", false);
bool join = await LobbyRequest.JoinLobbyByCode(lobbyCodeInput.text);
if (join)
{
ChangeSceneManager.Instance.ChangeToLobbyScene();
}
else
{
createLobbyButton.interactable = true;
FadeWithText.Instance.ShowMessage("الرقم غير صحيح", true);
}
}
else
FadeWithText.Instance.ShowMessage("من فضلك ادخل رقم الغرفة", true);
}
}
fileFormatVersion: 2
guid: 935852d4802d2b7458026b895e786774
\ No newline at end of file
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using TMPro;
using Unity.Services.Authentication;
using Unity.Services.Lobbies;
using Unity.Services.Lobbies.Models;
using Unity.VisualScripting.Antlr3.Runtime.Misc;
using UnityEngine;
using UnityEngine.UI;
using static UnityEngine.LowLevelPhysics2D.PhysicsLayers;
public class LobbyRoom : MonoBehaviour
{
[SerializeField] PlayersInLobbyRoom[] playersSlot;
[SerializeField] TextMeshProUGUI lobbyCode;
[SerializeField] Button startButton;
[SerializeField] Button exitButton;
bool _isOwner;
int _currentNPCs;
LobbyHeart _lobbyHeart;
ILobbyEvents _lobbyEvents;
void Start()
{
_isOwner = LobbyRequest._currentLobby.HostId == AuthenticationService.Instance.PlayerId;
startButton.interactable = _isOwner;
exitButton.onClick.AddListener(LeaveLobby);
ShowLobbyCode();
_lobbyHeart = FindAnyObjectByType<LobbyHeart>();
RefreshLobby();
SubscribeToLobbyEvent();
}
async void SubscribeToLobbyEvent()
{
LobbyEventCallbacks lobbyEventCallbacks = new LobbyEventCallbacks();
lobbyEventCallbacks.PlayerJoined += PlayerJoined;
lobbyEventCallbacks.PlayerLeft += PlayerLeft;
lobbyEventCallbacks.PlayerDataChanged += PlayerDataChanged;
lobbyEventCallbacks.DataChanged += DataChanged;
lobbyEventCallbacks.LobbyDeleted += LobbyDeleted;
_lobbyEvents = await LobbyService.Instance.SubscribeToLobbyEventsAsync(LobbyRequest._currentLobby.Id, lobbyEventCallbacks);
}
private void LobbyDeleted()
{
ChangeSceneManager.Instance.ChangeToMainmenuScene();
}
private void DataChanged(Dictionary<string, ChangedOrRemovedLobbyValue<DataObject>> obj)
{
RefreshLobby();
}
private void PlayerDataChanged(Dictionary<int, Dictionary<string, ChangedOrRemovedLobbyValue<PlayerDataObject>>> obj)
{
RefreshLobby();
}
private void PlayerJoined(List<LobbyPlayerJoined> playersObj)
{
RefreshLobby();
}
private void PlayerLeft(List<int> playerIndices)
{
RefreshLobby();
}
private void ShowLobbyCode()
{
lobbyCode.text = $"Room Code: {PlayerPrefs.GetString("JoinCode")}";
}
async void AddNPCs(int count)
{
UpdateLobbyOptions updateLobbyOptions = new UpdateLobbyOptions()
{
Data = new Dictionary<string, DataObject>
{
{"NPCsCount", new DataObject(visibility: DataObject.VisibilityOptions.Public, value: _currentNPCs.ToString())}
}
};
await LobbyService.Instance.UpdateLobbyAsync(LobbyRequest._currentLobby.Id, updateLobbyOptions);
}
async void StartGame()
{
Debug.Log("Starting Game");
UpdateLobbyOptions updateLobbyOptions = new UpdateLobbyOptions()
{
IsLocked = true
};
await LobbyService.Instance.UpdateLobbyAsync(LobbyRequest._currentLobby.Id, updateLobbyOptions);
}
private async void RefreshLobby()
{
try
{
var lobby = await LobbyService.Instance.GetLobbyAsync(LobbyRequest._currentLobby.Id);
ClearAllSlots();
foreach (var player in lobby.Players)
{
AddPlayerToSlot(player);
}
}
catch (Exception e)
{
Debug.LogException(e);
}
}
void ClearAllSlots()
{
foreach (PlayersInLobbyRoom slot in playersSlot)
{
slot.Clear();
}
}
void AddPlayerToSlot(Player player)
{
string playerName = player.Data["Name"].Value;
string avatarIndex = player.Data["AvatarIndex"].Value;
string playerId = player.Id;
foreach (PlayersInLobbyRoom slots in playersSlot)
{
if (!slots.isBusySlot)
{
slots.Init(playerName, avatarIndex, playerId, _isOwner);
break;
}
}
}
private void LeaveLobby()
{
CleanupLobby();
ChangeSceneManager.Instance.ChangeToMainmenuScene();
}
private void OnApplicationQuit()
{
CleanupLobby();
}
void CleanupLobby()
{
_lobbyEvents?.UnsubscribeAsync();
if (_isOwner)
{
Destroy(_lobbyHeart.gameObject);
LobbyRequest.RemoveLobby();
}
else
{
LobbyRequest.RemovePlayerFromLobby(AuthenticationService.Instance.PlayerId);
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 7c078fbdeeb607c418add6383867a2c0
\ No newline at end of file
fileFormatVersion: 2
guid: 065ae04c6baf52d4e921c4e4fc597166
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System;
using Unity.Netcode;
public struct PlayerState
{
}
fileFormatVersion: 2
guid: 74b86cef1cb2e2442a756afc4397847c
\ No newline at end of file
fileFormatVersion: 2
guid: c18359293cdb0024f9670e03c86f525e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
public class AvatarMenu : MonoBehaviour
{
[SerializeField] Sprite[] avatarIndex;
public Sprite GetSpriteByIndex(int index)
{
return avatarIndex[index];
}
}
fileFormatVersion: 2
guid: 374412ada46c1fe4db51c536a0dc5749
\ No newline at end of file
using System;
using System.Threading.Tasks;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class LobbyDetails : MonoBehaviour
{
[SerializeField] TextMeshProUGUI lobbyNameText;
[SerializeField] TextMeshProUGUI lobbyPlayersCountText;
[SerializeField] Button joinLobbyButton;
string _joinCode;
private void Start()
{
joinLobbyButton.onClick.AddListener(joinLobby);
}
private async void joinLobby()
{
joinLobbyButton.interactable = false;
FadeWithText.Instance.ShowMessage("جاري التحميل", false);
bool join = await LobbyRequest.JoinLobby(_joinCode);
if (join) {
ChangeSceneManager.Instance.ChangeToLobbyScene();
}
else
{
joinLobbyButton.interactable = true;
FadeWithText.Instance.ShowMessage("حدث خطأ", true);
}
}
public void AddDetailsToLobby(string lobbyName, string lobbyPlayersCount, string joinCode)
{
lobbyNameText.text = lobbyName;
lobbyPlayersCountText.text = lobbyPlayersCount;
this._joinCode = joinCode;
}
}
fileFormatVersion: 2
guid: 7c0786d808001b149b4bf2bee1f3c2f5
\ No newline at end of file
using System.Threading.Tasks;
using Unity.Services.Lobbies;
using Unity.Services.Lobbies.Models;
using UnityEngine;
using UnityEngine.UI;
public class LobbyList : MonoBehaviour
{
[SerializeField] Transform lobbyParent;
[SerializeField] LobbyDetails lobbyPrefab;
[SerializeField] Button refreshButton;
void Start()
{
refreshButton.onClick.AddListener(RefreshLobbyList);
}
private async void RefreshLobbyList()
{
refreshButton.interactable = false;
FadeWithText.Instance.ShowMessage("جاري التحميل", false);
QueryResponse list = await LobbyRequest.CurrentLobbies();
DestroyLastLobbysList();
foreach (var lobby in list.Results)
{
LobbyDetails lobbyDetails = Instantiate(lobbyPrefab, lobbyParent);
int npcCounter = int.Parse(lobby.Data["NPCsCount"].Value.ToString()) + lobby.Players.Count;
string playersCount = $"{npcCounter}/{lobby.MaxPlayers}";
lobbyDetails.AddDetailsToLobby(lobby.Name, playersCount, lobby.Id);
lobbyDetails.gameObject.SetActive(npcCounter < lobby.MaxPlayers);
}
await Task.Delay(2000);
FadeWithText.Instance.FadeOut();
refreshButton.interactable = true;
}
void DestroyLastLobbysList()
{
if (lobbyParent.childCount > 0)
{
foreach (Transform child in lobbyParent)
{
Destroy(child.gameObject);
}
}
}
}
fileFormatVersion: 2
guid: 0ed1f501d59904d40ac20d33f493c6bc
\ No newline at end of file
using System;
using TMPro;
using Unity.Services.Authentication;
using UnityEngine;
using UnityEngine.UI;
public class PlayersInLobbyRoom : MonoBehaviour
{
[field: SerializeField] public bool isBusySlot { get; private set; }
[field: SerializeField] public string playerId { get; private set; }
[SerializeField] TextMeshProUGUI playerName;
[SerializeField] Image avatarImage;
[SerializeField] int playerAvatarIndex;
[SerializeField] Button readyButton;
public void Init(string name, string avatarIndex, string playerId,bool isOwner)
{
ChangeAvatar(int.Parse(avatarIndex));
playerName.text = name;
isBusySlot = true;
this.playerId = playerId;
if (playerId == null)
{
readyButton.interactable = true;
readyButton.GetComponentInChildren<TextMeshProUGUI>().text = "Add NPCs";
isBusySlot = false;
}
else
{
readyButton.interactable = playerId == AuthenticationService.Instance.PlayerId;
readyButton.GetComponentInChildren<TextMeshProUGUI>().text = "Ready";
}
}
public void Clear()
{
isBusySlot = false;
playerId = null;
playerName.text = " ";
ChangeAvatar(0);
readyButton.interactable = false;
}
void ChangeAvatar(int index)
{
avatarImage.sprite = GetComponentInParent<AvatarMenu>().GetSpriteByIndex(index);
}
}
fileFormatVersion: 2
guid: bd7addcbfc2b864408bfe3400dbe7059
\ No newline at end of file
fileFormatVersion: 2
guid: bcf48ba4dbbc8164c90a1821f3f4103a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 28568120ade028f498c2721e8c4c6fd4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Threading.Tasks;
using Unity.Services.Relay;
using Unity.Services.Relay.Models;
using UnityEngine;
public static class AllocationRequest
{
static Allocation _allocation;
public static async Task<string> Create()
{
try
{
_allocation = await RelayService.Instance.CreateAllocationAsync(4);
}
catch (Exception ex)
{
Debug.LogException(ex);
}
try
{
return await RelayService.Instance.GetJoinCodeAsync(_allocation.AllocationId);
}
catch (Exception ex)
{
Debug.LogException(ex);
}
return null;
}
public static Allocation GetCurrentAllocation()
{
return _allocation;
}
}
fileFormatVersion: 2
guid: 835a84e3f33cb7d4ab149db19164ec20
\ No newline at end of file
fileFormatVersion: 2
guid: bfc0957863ebc89438864c7c3e241efd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Threading.Tasks;
using Unity.Services.Authentication;
using Unity.Services.Core;
using Unity.VisualScripting;
using UnityEngine;
public enum AuthState
{
NotAuthenticated,
Authenticated,
Authenticating,
Error,
TimeOut,
}
public static class AuthenticationRequest
{
public static AuthState AuthState { get; private set; } = AuthState.NotAuthenticated;
public static async Task<AuthState> StartAuth(int maxReTries = 5)
{
if (AuthState == AuthState.Authenticated)
{
Debug.LogWarning("Player Is Authenticated");
return AuthState;
}
if (AuthState == AuthState.Authenticating)
{
Debug.LogWarning("Player Is Authenticating...");
await Authenticating();
return AuthState;
}
await SignInAnonymously(5);
return AuthState;
}
static async Task<AuthState> Authenticating()
{
while (AuthState == AuthState.Authenticating || AuthState == AuthState.NotAuthenticated)
{
await Task.Delay(200);
}
return AuthState;
}
static async Task SignInAnonymously(int maxTries)
{
AuthState = AuthState.Authenticating;
int reTries = 0;
while (AuthState == AuthState.Authenticating && reTries < maxTries)
{
try
{
await AuthenticationService.Instance.SignInAnonymouslyAsync();
if (AuthenticationService.Instance.IsSignedIn && AuthenticationService.Instance.IsAuthorized)
{
AuthState = AuthState.Authenticated;
break;
}
}
catch (AuthenticationException authEx)
{
Debug.LogException(authEx);
AuthState = AuthState.Error;
}
catch (RequestFailedException RequestEx)
{
Debug.LogException(RequestEx);
AuthState = AuthState.Error;
}
catch (Exception ex)
{
Debug.LogException(ex);
AuthState = AuthState.Error;
}
reTries++;
await Task.Delay(1000);
}
if (AuthState != AuthState.Authenticated)
{
Debug.LogError($"Player cannot signin after {reTries}");
AuthState = AuthState.TimeOut;
}
}
public static void playerIsSignOut()
{
AuthState = AuthState.NotAuthenticated;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 8f3b27ae5b5526242aa1225b54433312
\ No newline at end of file
fileFormatVersion: 2
guid: f4c8a36c12e99fe45a1b4a4441043e9e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
public class LobbyHeart : MonoBehaviour
{
Coroutine _heartCoroutine;
private void Awake()
{
DontDestroyOnLoad(gameObject);
}
private void Start()
{
_heartCoroutine = StartCoroutine(LobbyRequest.LobbyHearBeat());
}
private void OnDestroy()
{
StopCoroutine(_heartCoroutine);
}
}
fileFormatVersion: 2
guid: aa182ac67b90ca745bb07001a884d752
\ No newline at end of file
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using Unity.Services.Authentication;
using Unity.Services.Lobbies;
using Unity.Services.Lobbies.Models;
using UnityEngine;
public static class LobbyRequest
{
public static Lobby _currentLobby { get; private set; }
public static async Task<bool> Create(string lobbyName, int maxPlayer, CreateLobbyOptions createLobbyOptions)
{
createLobbyOptions.Player = SetPlayerData();
try
{
_currentLobby = await LobbyService.Instance.CreateLobbyAsync(lobbyName, maxPlayer, createLobbyOptions);
SetPlayerPrefs();
new GameObject("LobbyHeart").AddComponent<LobbyHeart>();
return true;
}
catch (LobbyServiceException ex)
{
Debug.LogException(ex);
}
catch (Exception ex)
{
Debug.LogException(ex);
}
return false;
}
public static IEnumerator LobbyHearBeat()
{
WaitForSecondsRealtime waitForSecondsRealtime = new WaitForSecondsRealtime(15);
while (true)
{
LobbyService.Instance.SendHeartbeatPingAsync(_currentLobby.Id);
yield return waitForSecondsRealtime;
}
}
public static async Task<QueryResponse> CurrentLobbies()
{
try
{
QueryLobbiesOptions lobbiesOptions = new QueryLobbiesOptions();
lobbiesOptions.Filters = new List<QueryFilter>
{
new QueryFilter(QueryFilter.FieldOptions.IsLocked,"0",QueryFilter.OpOptions.EQ)
};
return await LobbyService.Instance.QueryLobbiesAsync(lobbiesOptions);
}
catch (LobbyServiceException ex)
{
Debug.LogException(ex);
}
catch (Exception ex)
{
Debug.LogException(ex);
}
return null;
}
public static async Task<bool> JoinLobby(string joinCode)
{
try
{
JoinLobbyByIdOptions joinLobbyByIdOptions = new JoinLobbyByIdOptions() { Player = SetPlayerData() };
_currentLobby = await LobbyService.Instance.JoinLobbyByIdAsync(joinCode, joinLobbyByIdOptions);
SetPlayerPrefs();
return true;
}
catch (LobbyServiceException ex)
{
Debug.LogException(ex);
}
catch (Exception ex)
{
Debug.LogException(ex);
}
return false;
}
public static async void RemovePlayerFromLobby(string playerId)
{
if (_currentLobby == null) return;
try
{
if (playerId == AuthenticationService.Instance.PlayerId)
{
await LobbyService.Instance.RemovePlayerAsync(_currentLobby.Id, playerId);
_currentLobby = null;
}
}
catch (LobbyServiceException ex)
{
Debug.LogException(ex);
}
catch (Exception ex)
{
Debug.LogException(ex);
}
}
public static async void RemoveLobby()
{
if (_currentLobby == null) return;
try
{
await LobbyService.Instance.DeleteLobbyAsync(_currentLobby.Id);
_currentLobby = null;
}
catch (LobbyServiceException ex)
{
Debug.LogException(ex);
}
catch (Exception ex)
{
Debug.LogException(ex);
}
}
public static async Task<bool> JoinLobbyByCode(string lobbyCode)
{
try
{
JoinLobbyByCodeOptions joinLobbyByCodeOptions = new JoinLobbyByCodeOptions() { Player = SetPlayerData() };
_currentLobby = await LobbyService.Instance.JoinLobbyByCodeAsync(lobbyCode, joinLobbyByCodeOptions);
SetPlayerPrefs();
return true;
}
catch (LobbyServiceException ex)
{
Debug.LogException(ex);
}
catch (Exception ex)
{
Debug.LogException(ex);
}
return false;
}
static Player SetPlayerData()
{
Player player = new Player(
id: AuthenticationService.Instance.PlayerId,
data: new Dictionary<string, PlayerDataObject>
{
{
"Name",
new PlayerDataObject(
PlayerDataObject.VisibilityOptions.Member,
"Player#" + UnityEngine.Random.Range(1000,9999)
)
},
{
"AvatarIndex",
new PlayerDataObject(PlayerDataObject.VisibilityOptions.Member,"1")
},
{"IsReady",
new PlayerDataObject(PlayerDataObject.VisibilityOptions.Member,"False")
}
}
);
return player;
}
static void SetPlayerPrefs()
{
PlayerPrefs.SetString("JoinCode", _currentLobby.LobbyCode);
}
}
fileFormatVersion: 2
guid: 161663833f0c02b4586e33198315b8ae
\ No newline at end of file
...@@ -7,7 +7,7 @@ using UnityEngine; ...@@ -7,7 +7,7 @@ using UnityEngine;
public class PlayerDetails : NetworkBehaviour public class PlayerDetails : NetworkBehaviour
{ {
public NetworkVariable<FixedString32Bytes> PlayerName = new NetworkVariable<FixedString32Bytes>(writePerm: NetworkVariableWritePermission.Owner, readPerm: NetworkVariableReadPermission.Everyone); public NetworkVariable<FixedString32Bytes> PlayerName = new NetworkVariable<FixedString32Bytes>("Unknown",NetworkVariableReadPermission.Everyone,NetworkVariableWritePermission.Owner);
[field: SerializeField] public Sprite PlayerImage { get; private set; } [field: SerializeField] public Sprite PlayerImage { get; private set; }
[SerializeField] RTLTextMeshPro nameText; [SerializeField] RTLTextMeshPro nameText;
......
...@@ -8,14 +8,11 @@ public class Fade : MonoBehaviour ...@@ -8,14 +8,11 @@ public class Fade : MonoBehaviour
[SerializeField] bool fadeOnInStart; [SerializeField] bool fadeOnInStart;
[SerializeField] bool fadeOutInStart; [SerializeField] bool fadeOutInStart;
[SerializeField] UnityEvent onFinish;
[SerializeField] UnityEvent onStart;
[SerializeField] float FadeDuration = .4f; [SerializeField] float FadeDuration = .4f;
CanvasGroup _canvasGroup; CanvasGroup _canvasGroup;
public void Start() public virtual void Start()
{ {
_canvasGroup = GetComponent<CanvasGroup>(); _canvasGroup = GetComponent<CanvasGroup>();
if (fadeOnInStart) if (fadeOnInStart)
...@@ -25,11 +22,11 @@ public class Fade : MonoBehaviour ...@@ -25,11 +22,11 @@ public class Fade : MonoBehaviour
} }
public void FadeIn() public void FadeIn()
{ {
_canvasGroup.DOFade(1, FadeDuration).OnComplete(() => {onStart?.Invoke(); _canvasGroup.blocksRaycasts = true; }); _canvasGroup.DOFade(1, FadeDuration).OnComplete(() => _canvasGroup.blocksRaycasts = true);
} }
public void FadeOut() public void FadeOut()
{ {
_canvasGroup.DOFade(0, FadeDuration).OnComplete(() => { onFinish?.Invoke(); _canvasGroup.blocksRaycasts = false; }); _canvasGroup.DOFade(0, FadeDuration).OnComplete(() => _canvasGroup.blocksRaycasts = false);
} }
private void OnDestroy() private void OnDestroy()
{ {
......
using UnityEngine.UI;
using RTLTMPro;
public class FadeWithText : Fade
{
public static FadeWithText Instance { get; private set; }
RTLTextMeshPro _textMessage;
Button _closeButton;
private void Awake()
{
if (Instance == null)
Instance = this;
else
Destroy(this);
}
public override void Start()
{
base.Start();
_textMessage = GetComponentInChildren<RTLTextMeshPro>();
_closeButton = GetComponentInChildren<Button>();
}
public void ShowMessage(string message, bool showButton)
{
_textMessage.text = message;
_closeButton.gameObject.SetActive(showButton);
FadeIn();
}
}
fileFormatVersion: 2
guid: 3be580c7eafc05a4c940825f3a5c88df
\ No newline at end of file
...@@ -5,7 +5,7 @@ public class LeaderboardText : MonoBehaviour ...@@ -5,7 +5,7 @@ public class LeaderboardText : MonoBehaviour
{ {
[SerializeField] RTLTextMeshPro playerScoreText; [SerializeField] RTLTextMeshPro playerScoreText;
public void UpdatePlayerScore(ulong playerId,string playerName, int score) public void InitData(string playerName, int score)
{ {
playerScoreText.text = $"{playerName}: {score}"; playerScoreText.text = $"{playerName}: {score}";
} }
......
using System;
using System.Collections.Generic;
using Unity.Netcode;
using UnityEngine;
public class LeaderboardUI : NetworkBehaviour
{
[SerializeField] Transform leaderboardParent;
[SerializeField] LeaderboardText leaderboardPrefab;
Dictionary<ulong, LeaderboardText> leaderboardUIElements = new Dictionary<ulong, LeaderboardText>();
public override void OnNetworkSpawn()
{
if (IsServer)
{
NetworkManager.Singleton.OnClientConnectedCallback += ClientConnected;
NetworkManager.Singleton.OnClientDisconnectCallback += ClientDisconnect;
}
}
public override void OnNetworkDespawn()
{
if (IsServer)
{
NetworkManager.Singleton.OnClientDisconnectCallback += ClientDisconnect;
NetworkManager.Singleton.OnClientConnectedCallback -= ClientConnected;
}
}
private void ClientConnected(ulong obj)
{
if (!leaderboardUIElements.ContainsKey(obj))
{
string clientName = NetworkManager.Singleton.ConnectedClients[obj].PlayerObject.GetComponent<PlayerDetails>().PlayerName.ToString();
LeaderboardText leaderboardText = Instantiate(leaderboardPrefab,leaderboardParent);
leaderboardText.InitData(clientName,0);
leaderboardUIElements.Add(obj, leaderboardText);
}
}
private void ClientDisconnect(ulong obj)
{
if (leaderboardUIElements.ContainsKey(obj))
{
leaderboardUIElements.Remove(obj);
}
}
}
fileFormatVersion: 2
guid: 898a5c43a5351014a8aa047392d4591f
\ No newline at end of file
using UnityEngine;
public class SwitchPanel : MonoBehaviour
{
public static SwitchPanel Instance;
[SerializeField] GameObject CreateRoom;
private void Awake()
{
if (Instance == null)
Instance = this;
else Destroy(this);
}
}
fileFormatVersion: 2
guid: b843aaa8bf5dd144a83fcee792259f9a
\ No newline at end of file
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.UI;
public class StartGame : MonoBehaviour
{
[SerializeField] TMP_InputField playerName;
[SerializeField] Button host;
[SerializeField] Button client;
void Start()
{
host.onClick.AddListener(() => { PlayerPrefs.SetString("PlayerName", playerName.text); gameObject.SetActive(false); NetworkManager.Singleton.StartHost(); });
client.onClick.AddListener(() => { PlayerPrefs.SetString("PlayerName", playerName.text); gameObject.SetActive(false); NetworkManager.Singleton.StartClient(); });
}
}
fileFormatVersion: 2
guid: 39768e90e1ee3fe4ab5545e7db3894f0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 4f4b3b54a3c93ce42b48eeb48d0f02f7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2beb18749f99d3f4bb3c31003ac50efb
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WindowsStoreApps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 10cef9670e8f9414ab9e32f3480f2da5
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WindowsStoreApps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: f7854f4c75e2fb047bc9c7ec9d23c0f4
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WindowsStoreApps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d729f7d9ef2392749b2b6d674d07f587
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WindowsStoreApps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2309ad067460c6141b1fca1d22c118b5
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WindowsStoreApps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a628dfd74e09af84e85b761687ec7b4b
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WindowsStoreApps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 750b0c74f15479c4ebecefa612aaf84d
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WindowsStoreApps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
...@@ -8,6 +8,9 @@ EditorBuildSettings: ...@@ -8,6 +8,9 @@ EditorBuildSettings:
- enabled: 1 - enabled: 1
path: Assets/_project/Scenes/Game.unity path: Assets/_project/Scenes/Game.unity
guid: ed75d94d1c2d6934f9aa9556db95a098 guid: ed75d94d1c2d6934f9aa9556db95a098
- enabled: 1
path: Assets/_project/Scenes/LobbyScene.unity
guid: 352bf19a87eb5f84da505d6b76a39310
- enabled: 1 - enabled: 1
path: Assets/_project/Scenes/MainMenu.unity path: Assets/_project/Scenes/MainMenu.unity
guid: 9a357ab131db7bd4d8e56aa52459b9a4 guid: 9a357ab131db7bd4d8e56aa52459b9a4
......
...@@ -25,7 +25,7 @@ EditorSettings: ...@@ -25,7 +25,7 @@ EditorSettings:
m_AsyncShaderCompilation: 1 m_AsyncShaderCompilation: 1
m_PrefabModeAllowAutoSave: 1 m_PrefabModeAllowAutoSave: 1
m_EnterPlayModeOptionsEnabled: 1 m_EnterPlayModeOptionsEnabled: 1
m_EnterPlayModeOptions: 3 m_EnterPlayModeOptions: 0
m_GameObjectNamingDigits: 1 m_GameObjectNamingDigits: 1
m_GameObjectNamingScheme: 0 m_GameObjectNamingScheme: 0
m_AssetNamingUsesSpace: 1 m_AssetNamingUsesSpace: 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment