Added continue menu
This commit is contained in:
parent
586098b3cf
commit
44fb498e99
|
@ -19,6 +19,7 @@ public class GameBoardInstance : MonoBehaviour {
|
|||
}
|
||||
|
||||
public void SetupGame(){
|
||||
|
||||
if (NetworkManager.inRoom){
|
||||
var players = NetworkManager.net.CurrentRoom.Players.Values.OrderBy(p => p.ID);
|
||||
var p1 = players.ElementAt(0);
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ButtonContinueOption : ButtonOnClick {
|
||||
|
||||
public int option;
|
||||
|
||||
public override void OnClick() {
|
||||
if (GameTransition.Instance.state == GameState.Continue){
|
||||
Rematch.Instance.SelectOption(option);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 22272928c157b2445b238da54d3d2d59
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
|
@ -58,7 +58,7 @@ public class LobbySetup : MonoBehaviour {
|
|||
GameBoardInstance.instance.player2.authorityID = p2.ID;
|
||||
}
|
||||
var pready = PlayerProperties.lobbyStatus.Get(p2);
|
||||
readyCheck2.localRotation = Quaternion.RotateTowards(readyCheck1.localRotation, pready ? Quaternion.identity : Quaternion.Euler(0f, 0f, 45f), delta);
|
||||
readyCheck2.localRotation = Quaternion.RotateTowards(readyCheck2.localRotation, pready ? Quaternion.identity : Quaternion.Euler(0f, 0f, 45f), delta);
|
||||
readyImage2.color = pready ? Color.green : Color.red;
|
||||
} else {
|
||||
GameBoardInstance.instance.player2.authorityID = -1;
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
public class Rematch : MonoBehaviour {
|
||||
|
||||
public static Rematch Instance { get; private set; }
|
||||
|
||||
public GameObject[] buttons;
|
||||
public TextMeshProUGUI continueTextMesh;
|
||||
public string continueKey, waitKey;
|
||||
|
||||
public Image continueBar;
|
||||
public float continueDuration = 10f;
|
||||
private float continueTime;
|
||||
|
||||
private void Awake() {
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
if (GameTransition.Instance.state == GameState.Continue){
|
||||
var delta = Mathf.Clamp01(1f - (Time.time - continueTime) / continueDuration);
|
||||
|
||||
continueBar.fillAmount = delta;
|
||||
|
||||
if (delta <= 0f && PlayerProperties.playerResponse.GetLocal() == -1){
|
||||
PlayerProperties.playerResponse.SetLocal(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Setup(){
|
||||
foreach(var b in buttons){
|
||||
b.SetActive(true);
|
||||
}
|
||||
|
||||
continueTextMesh.text = Localization.GetString(continueKey);
|
||||
continueBar.fillAmount = 1f;
|
||||
continueTime = Time.time;
|
||||
}
|
||||
|
||||
public void SelectOption(int i){
|
||||
PlayerProperties.playerResponse.SetLocal(i);
|
||||
foreach(var b in buttons){
|
||||
b.SetActive(false);
|
||||
}
|
||||
|
||||
continueTextMesh.text = Localization.GetString(waitKey);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 23ed198f9b5a8df43ad32d56ca6bd311
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2a528bc7dcaff6848bbf47695881bb97
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
After Width: | Height: | Size: 57 KiB |
|
@ -0,0 +1,91 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c2764b1c8e78b504886aef33638e0e9f
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 10
|
||||
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
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
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
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue