Create BattleResult
This commit is contained in:
parent
0d7f4f4954
commit
84782a9bb3
4 changed files with 46 additions and 4 deletions
30
Assets/Battle/BattleResult.cs
Normal file
30
Assets/Battle/BattleResult.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class BattleResult {
|
||||
private static BattleResult sResult;
|
||||
|
||||
private bool won;
|
||||
|
||||
public static void FinishBattle(BattleResult result) {
|
||||
sResult = result;
|
||||
if (result.Won) {
|
||||
Debug.Log("You won!");
|
||||
} else {
|
||||
Debug.Log("You lost!");
|
||||
}
|
||||
SceneManager.LoadScene("StoryScene");
|
||||
}
|
||||
|
||||
public static BattleResult RetrieveResult() {
|
||||
BattleResult result = sResult;
|
||||
sResult = null;
|
||||
return result;
|
||||
}
|
||||
|
||||
public BattleResult(bool won) {
|
||||
this.won = won;
|
||||
}
|
||||
|
||||
public bool Won {get => this.won;}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue