Fixed end of game trigger on subsequent game. Fixed score not being saved after not entering name.
This commit is contained in:
parent
a0ec711c4a
commit
64c08d6459
10 changed files with 395 additions and 108 deletions
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
{"TestSuite":"","Date":0,"Player":{"Development":false,"ScreenWidth":0,"ScreenHeight":0,"ScreenRefreshRate":0,"Fullscreen":false,"Vsync":0,"AntiAliasing":0,"Batchmode":false,"RenderThreadingMode":"MultiThreaded","GpuSkinning":false,"Platform":"","ColorSpace":"","AnisotropicFiltering":"","BlendWeights":"","GraphicsApi":"","ScriptingBackend":"IL2CPP","AndroidTargetSdkVersion":"AndroidApiLevelAuto","AndroidBuildSystem":"Gradle","BuildTarget":"WebGL","StereoRenderingPath":"MultiPass"},"Hardware":{"OperatingSystem":"","DeviceModel":"","DeviceName":"","ProcessorType":"","ProcessorCount":0,"GraphicsDeviceName":"","SystemMemorySizeMB":0},"Editor":{"Version":"6000.0.34f1","Branch":"6000.0/staging","Changeset":"5ab2d9ed9190","Date":1736176501},"Dependencies":["com.unity.collab-proxy@2.6.0","com.unity.feature.2d@2.0.1","com.unity.feature.mobile@1.0.0","com.unity.ide.rider@3.0.31","com.unity.ide.visualstudio@2.0.22","com.unity.inputsystem@1.11.2","com.unity.multiplayer.center@1.0.0","com.unity.render-pipelines.universal@17.0.3","com.unity.timeline@1.8.7","com.unity.ugui@2.0.0","com.unity.visualscripting@1.9.5","com.unity.modules.accessibility@1.0.0","com.unity.modules.ai@1.0.0","com.unity.modules.androidjni@1.0.0","com.unity.modules.animation@1.0.0","com.unity.modules.assetbundle@1.0.0","com.unity.modules.audio@1.0.0","com.unity.modules.cloth@1.0.0","com.unity.modules.director@1.0.0","com.unity.modules.imageconversion@1.0.0","com.unity.modules.imgui@1.0.0","com.unity.modules.jsonserialize@1.0.0","com.unity.modules.particlesystem@1.0.0","com.unity.modules.physics@1.0.0","com.unity.modules.physics2d@1.0.0","com.unity.modules.screencapture@1.0.0","com.unity.modules.terrain@1.0.0","com.unity.modules.terrainphysics@1.0.0","com.unity.modules.tilemap@1.0.0","com.unity.modules.ui@1.0.0","com.unity.modules.uielements@1.0.0","com.unity.modules.umbra@1.0.0","com.unity.modules.unityanalytics@1.0.0","com.unity.modules.unitywebrequest@1.0.0","com.unity.modules.unitywebrequestassetbundle@1.0.0","com.unity.modules.unitywebrequestaudio@1.0.0","com.unity.modules.unitywebrequesttexture@1.0.0","com.unity.modules.unitywebrequestwww@1.0.0","com.unity.modules.vehicles@1.0.0","com.unity.modules.video@1.0.0","com.unity.modules.vr@1.0.0","com.unity.modules.wind@1.0.0","com.unity.modules.xr@1.0.0","com.unity.modules.subsystems@1.0.0","com.unity.modules.hierarchycore@1.0.0","com.unity.render-pipelines.core@17.0.3","com.unity.shadergraph@17.0.3","com.unity.render-pipelines.universal-config@17.0.3","com.unity.test-framework@1.4.5","com.unity.ext.nunit@2.0.5","com.unity.mobile.android-logcat@1.4.4","com.unity.adaptiveperformance@5.1.0","com.unity.mobile.notifications@2.4.0","com.unity.2d.animation@10.1.4","com.unity.2d.pixel-perfect@5.0.3","com.unity.2d.psdimporter@9.0.3","com.unity.2d.sprite@1.0.0","com.unity.2d.spriteshape@10.0.7","com.unity.2d.tilemap@1.0.0","com.unity.2d.tilemap.extras@4.1.0","com.unity.2d.aseprite@1.1.7","com.unity.searcher@4.9.2","com.unity.burst@1.8.18","com.unity.mathematics@1.3.2","com.unity.collections@2.5.1","com.unity.rendering.light-transport@1.0.1","com.unity.profiling.core@1.0.2","com.unity.2d.common@9.0.7","com.unity.nuget.mono-cecil@1.11.4","com.unity.test-framework.performance@3.0.3"],"Results":[]}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fd2f131e858fd504b9dbc37e51f92acc
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"MeasurementCount":-1}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e4138449aacb29a4193c131477ff92cb
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -78,7 +78,6 @@ namespace Scores
|
|||
|
||||
IEnumerator PostScoreToServer(string playerName, int levelId, int score)
|
||||
{
|
||||
Debug.Log("Post coroutine started");
|
||||
string url = _postScoreUrl;
|
||||
WWWForm form = new WWWForm();
|
||||
form.AddField("player", playerName);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ public class EndGameController : MonoBehaviour
|
|||
private VisualElement _diamondImageBox;
|
||||
private VisualElement _healthImageBox;
|
||||
private TextField _nameField;
|
||||
private Button _save;
|
||||
private Button _close;
|
||||
|
||||
private int _score;
|
||||
|
||||
|
|
@ -28,10 +30,10 @@ public class EndGameController : MonoBehaviour
|
|||
{
|
||||
VisualElement root = GetComponent<UIDocument>().rootVisualElement;
|
||||
|
||||
Button save = root.Q<Button>("Save");
|
||||
save.clicked += HandleSaveClicked;
|
||||
Button close = root.Q<Button>("Close");
|
||||
close.clicked += HandleCloseClicked;
|
||||
_save = root.Q<Button>("Save");
|
||||
_save.clicked += HandleSaveClicked;
|
||||
_close = root.Q<Button>("Close");
|
||||
_close.clicked += HandleCloseClicked;
|
||||
_diamondPoints = root.Q<Label>("PointsFromDiamond");
|
||||
_pointsFromHealth = root.Q<Label>("PointsFromHealth");
|
||||
_scoreSum = root.Q<Label>("ScoreSum");
|
||||
|
|
@ -40,6 +42,7 @@ public class EndGameController : MonoBehaviour
|
|||
_title = root.Q<Label>("Title");
|
||||
_message = root.Q<Label>("Message");
|
||||
_nameField = root.Q<TextField>("NameField");
|
||||
_nameField.RegisterCallback<ChangeEvent<string>>(evt => { nameEdited(evt.newValue); });
|
||||
|
||||
Image diamondImage = new Image();
|
||||
diamondImage.image = diamondSprite.texture;
|
||||
|
|
@ -80,4 +83,16 @@ public class EndGameController : MonoBehaviour
|
|||
SaveScoreClicked?.Invoke(_nameField.value, _score);
|
||||
LeaveDungeonClicked?.Invoke();
|
||||
}
|
||||
|
||||
private void nameEdited(string text)
|
||||
{
|
||||
if (text == String.Empty)
|
||||
{
|
||||
_save.SetEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_save.SetEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,9 +73,40 @@ namespace UI
|
|||
{
|
||||
RoomRewards.ChestRewarded -= HandleChestRewarded;
|
||||
|
||||
chestPopUpController.BlackDieSelected -= BlackDieAbilityGained;
|
||||
chestPopUpController.KeySelected -= TorchAbilityGained;
|
||||
chestPopUpController.ArmorAndDiamondSelected -= HealthAndDiamondGained;
|
||||
GameManager.EndOfGame -= HandleEndOfGame;
|
||||
|
||||
chestPopUpController.BlackDieSelected -= chestRewardSelection.HandleBlackDiceSelected;
|
||||
chestPopUpController.KeySelected -= chestRewardSelection.HandleTorchSelected;
|
||||
chestPopUpController.ArmorAndDiamondSelected -= chestRewardSelection.HandleDiamondAndLifeSelected;
|
||||
|
||||
hudController.RollClicked -= diceRoller.RollDice;
|
||||
hudController.PassClicked -= passManager.OnPassClicked;
|
||||
|
||||
diceRoller.Enabled -= () => hudController.SetDiceRollerEnabled(true);
|
||||
diceRoller.Disabled -= () => hudController.SetDiceRollerEnabled(false);
|
||||
|
||||
startingBlackDieAbility.MarkUseUsedEvent -= hudController.MarkStartingBlackDieAbilityUsed;
|
||||
startingBlackDieAbility.UnmarkUseUsedEvent -= hudController.UnmarkStartingBlackDieAbilityUsed;
|
||||
hudController.StartingBlackDieAbilityClicked -= startingBlackDieAbility.UseClicked;
|
||||
|
||||
blackDieAbility.MarkUseUsedEvent -= hudController.MarkBlackDieAbilityUsed;
|
||||
blackDieAbility.UnmarkUseUsedEvent -= hudController.UnmarkStartingBlackDieAbilityUsed;
|
||||
blackDieAbility.AbilityGained -= hudController.SetBlackDieAbilityEnabled;
|
||||
hudController.BlackDieAbilityClicked -= blackDieAbility.UseClicked;
|
||||
|
||||
chestRewardSelection.ArmorAndDiamondNoLongerAvailable -= chestPopUpController.DisableArmorAndDiamond;
|
||||
chestRewardSelection.TorchNoLongerAvailable -= chestPopUpController.DisableKey;
|
||||
chestRewardSelection.BlackDieNoLongerAvailable -= chestPopUpController.DisableBlackDie;
|
||||
|
||||
torchAbility.AbilityGained -= hudController.SetKeyAbilityEnabled;
|
||||
TorchAbility.TorchAbilityUsed -= hudController.MarkKeyAbilityUsed;
|
||||
hudController.KeyAbilityClicked -= torchAbility.UseClicked;
|
||||
|
||||
player.DiamondCountUpdated -= hudController.SetDiamondCount;
|
||||
player.HealthUpdated -= hudController.SetHealth;
|
||||
|
||||
armorAbility.ArmorAbilityGained -= hudController.SetArmorAbilityEnabled;
|
||||
armorAbility.MarkAbilityUsed -= hudController.MarkArmorAbilityUsed;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<engine:Label text="Label" name="ScoreSum" class="MenuText" style="-unity-text-align: upper-center;" />
|
||||
</engine:VisualElement>
|
||||
</engine:VisualElement>
|
||||
<engine:Button text="Save" name="Save" class="border button MenuText" style="position: absolute; right: 3px; bottom: 3px; font-size: 18px; background-color: rgb(87, 167, 0); color: rgb(0, 0, 0);" />
|
||||
<engine:Button text="Save" name="Save" enabled="false" class="border button MenuText" style="position: absolute; right: 3px; bottom: 3px; font-size: 18px; background-color: rgb(87, 167, 0); color: rgb(0, 0, 0);" />
|
||||
<engine:Button name="Close" text="X" class="CloseButton MenuText" />
|
||||
</engine:VisualElement>
|
||||
</engine:VisualElement>
|
||||
|
|
|
|||
|
|
@ -35,26 +35,26 @@ MonoBehaviour:
|
|||
m_List:
|
||||
- rid: 7752762179098771456
|
||||
- rid: 7752762179098771457
|
||||
- rid: 4022734937275760725
|
||||
- rid: 4022734981502599794
|
||||
- rid: 7752762179098771459
|
||||
- rid: 4022734937275760726
|
||||
- rid: 4022734981502599795
|
||||
- rid: 7752762179098771461
|
||||
- rid: 7752762179098771462
|
||||
- rid: 4022734937275760727
|
||||
- rid: 4022734981502599796
|
||||
- rid: 7752762179098771464
|
||||
- rid: 4022734937275760728
|
||||
- rid: 4022734981502599797
|
||||
- rid: 7752762179098771466
|
||||
- rid: 4022734937275760729
|
||||
- rid: 4022734981502599798
|
||||
- rid: 7752762179098771468
|
||||
- rid: 4022734937275760730
|
||||
- rid: 4022734937275760731
|
||||
- rid: 4022734937275760732
|
||||
- rid: 4022734981502599799
|
||||
- rid: 4022734981502599800
|
||||
- rid: 4022734981502599801
|
||||
- rid: 7752762179098771472
|
||||
- rid: 4022734937275760733
|
||||
- rid: 4022734937275760734
|
||||
- rid: 4022734937275760735
|
||||
- rid: 4022734981502599802
|
||||
- rid: 4022734981502599803
|
||||
- rid: 4022734981502599804
|
||||
- rid: 7752762179098771476
|
||||
- rid: 4022734937275760736
|
||||
- rid: 4022734981502599805
|
||||
m_RuntimeSettings:
|
||||
m_List:
|
||||
- rid: 7752762179098771456
|
||||
|
|
@ -90,7 +90,7 @@ MonoBehaviour:
|
|||
references:
|
||||
version: 2
|
||||
RefIds:
|
||||
- rid: 4022734937275760725
|
||||
- rid: 4022734981502599794
|
||||
type: {class: UniversalRenderPipelineEditorShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_AutodeskInteractive: {fileID: 4800000, guid: 0e9d5a909a1f7e84882a534d0d11e49f, type: 3}
|
||||
|
|
@ -102,14 +102,14 @@ MonoBehaviour:
|
|||
m_DefaultSpeedTree7Shader: {fileID: 4800000, guid: 0f4122b9a743b744abe2fb6a0a88868b, type: 3}
|
||||
m_DefaultSpeedTree8Shader: {fileID: -6465566751694194690, guid: 9920c1f1781549a46ba081a2a15a16ec, type: 3}
|
||||
m_DefaultSpeedTree9Shader: {fileID: -6465566751694194690, guid: cbd3e1cc4ae141c42a30e33b4d666a61, type: 3}
|
||||
- rid: 4022734937275760726
|
||||
- rid: 4022734981502599795
|
||||
type: {class: URPShaderStrippingSetting, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_StripUnusedPostProcessingVariants: 0
|
||||
m_StripUnusedVariants: 1
|
||||
m_StripScreenCoordOverrideVariants: 1
|
||||
- rid: 4022734937275760727
|
||||
- rid: 4022734981502599796
|
||||
type: {class: UniversalRendererResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
|
|
@ -117,7 +117,7 @@ MonoBehaviour:
|
|||
m_CameraMotionVector: {fileID: 4800000, guid: c56b7e0d4c7cb484e959caeeedae9bbf, type: 3}
|
||||
m_StencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3}
|
||||
m_DBufferClear: {fileID: 4800000, guid: f056d8bd2a1c7e44e9729144b4c70395, type: 3}
|
||||
- rid: 4022734937275760728
|
||||
- rid: 4022734981502599797
|
||||
type: {class: UniversalRenderPipelineEditorMaterials, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_DefaultMaterial: {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
|
||||
|
|
@ -126,7 +126,7 @@ MonoBehaviour:
|
|||
m_DefaultTerrainMaterial: {fileID: 2100000, guid: 594ea882c5a793440b60ff72d896021e, type: 2}
|
||||
m_DefaultDecalMaterial: {fileID: 2100000, guid: 31d0dcc6f2dd4e4408d18036a2c93862, type: 2}
|
||||
m_DefaultSpriteMaterial: {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
|
||||
- rid: 4022734937275760729
|
||||
- rid: 4022734981502599798
|
||||
type: {class: GPUResidentDrawerResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.GPUDriven.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
|
|
@ -139,21 +139,21 @@ MonoBehaviour:
|
|||
m_OcclusionCullingDebugKernels: {fileID: 7200000, guid: b23e766bcf50ca4438ef186b174557df, type: 3}
|
||||
m_DebugOcclusionTestPS: {fileID: 4800000, guid: d3f0849180c2d0944bc71060693df100, type: 3}
|
||||
m_DebugOccluderPS: {fileID: 4800000, guid: b3c92426a88625841ab15ca6a7917248, type: 3}
|
||||
- rid: 4022734937275760730
|
||||
- rid: 4022734981502599799
|
||||
type: {class: ProbeVolumeRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_Version: 1
|
||||
probeVolumeBlendStatesCS: {fileID: 7200000, guid: a3f7b8c99de28a94684cb1daebeccf5d, type: 3}
|
||||
probeVolumeUploadDataCS: {fileID: 7200000, guid: 0951de5992461754fa73650732c4954c, type: 3}
|
||||
probeVolumeUploadDataL2CS: {fileID: 7200000, guid: 6196f34ed825db14b81fb3eb0ea8d931, type: 3}
|
||||
- rid: 4022734937275760731
|
||||
- rid: 4022734981502599800
|
||||
type: {class: IncludeAdditionalRPAssets, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_version: 0
|
||||
m_IncludeReferencedInScenes: 0
|
||||
m_IncludeAssetsByLabel: 0
|
||||
m_LabelToInclude:
|
||||
- rid: 4022734937275760732
|
||||
- rid: 4022734981502599801
|
||||
type: {class: ProbeVolumeBakingResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_Version: 1
|
||||
|
|
@ -166,7 +166,7 @@ MonoBehaviour:
|
|||
skyOcclusionRT: {fileID: -5126288278712620388, guid: 5a2a534753fbdb44e96c3c78b5a6999d, type: 3}
|
||||
renderingLayerCS: {fileID: -6772857160820960102, guid: 94a070d33e408384bafc1dea4a565df9, type: 3}
|
||||
renderingLayerRT: {fileID: -5126288278712620388, guid: 94a070d33e408384bafc1dea4a565df9, type: 3}
|
||||
- rid: 4022734937275760733
|
||||
- rid: 4022734981502599802
|
||||
type: {class: ProbeVolumeDebugResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_Version: 1
|
||||
|
|
@ -176,18 +176,18 @@ MonoBehaviour:
|
|||
probeVolumeOffsetDebugShader: {fileID: 4800000, guid: db8bd7436dc2c5f4c92655307d198381, type: 3}
|
||||
probeSamplingDebugMesh: {fileID: -3555484719484374845, guid: 20be25aac4e22ee49a7db76fb3df6de2, type: 3}
|
||||
numbersDisplayTex: {fileID: 2800000, guid: 73fe53b428c5b3440b7e87ee830b608a, type: 3}
|
||||
- rid: 4022734937275760734
|
||||
- rid: 4022734981502599803
|
||||
type: {class: STP/RuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_setupCS: {fileID: 7200000, guid: 33be2e9a5506b2843bdb2bdff9cad5e1, type: 3}
|
||||
m_preTaaCS: {fileID: 7200000, guid: a679dba8ec4d9ce45884a270b0e22dda, type: 3}
|
||||
m_taaCS: {fileID: 7200000, guid: 3923900e2b41b5e47bc25bfdcbcdc9e6, type: 3}
|
||||
- rid: 4022734937275760735
|
||||
- rid: 4022734981502599804
|
||||
type: {class: ProbeVolumeGlobalSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_Version: 1
|
||||
m_ProbeVolumeDisableStreamingAssets: 0
|
||||
- rid: 4022734937275760736
|
||||
- rid: 4022734981502599805
|
||||
type: {class: UniversalRenderPipelineEditorAssets, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_DefaultSettingsVolumeProfile: {fileID: 11400000, guid: eda47df5b85f4f249abf7abd73db2cb2, type: 2}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue