protected override void Start() { base.Start(); StateLoader stateLoader = FindObjectOfType <StateLoader>(); if (stateLoader) { weapon = stateLoader.gameState.Weapon; } }
private void Awake() { if (saveSystem == null) { DontDestroyOnLoad(gameObject); //makes instance persist across scenes saveSystem = this; } else if (saveSystem != this) { Destroy(gameObject); //deletes copies of global which do not need to exist, so right version is used to get info from } }
private void Start() { DontDestroyOnLoad(this); StateLoader otherLoader = FindObjectsOfType <StateLoader>().FirstOrDefault(loader => loader != this); if (!otherLoader) { Destroy(gameObject); } if (otherLoader && gameState) { LoadState(gameState); } }
public override async Task <IState?> GetStateSnapshotAsync() { var state = await StateLoader.GetStateSnapshotAsync(); if (state == null) { return(null); } var itemState = (AuctionItemState)state.Data; var records = itemState.BiddingRecords; itemState.InitBiddingRecords(); if (records != null) { foreach (var(key, value) in records) { itemState.BiddingRecords.Add(key, value); } } return(state); }
public Uninitialized(string jsonString, StateLoader stateLoader) { this.stateLoader = stateLoader; this.jsonString = jsonString; }
internal PatchRun_InProgress(string jsonString, StateLoader stateLoader) { this.jsonString = jsonString; this.stateLoader = stateLoader; }
//to pass on to the next state internal ReAssessment_InProgress(string jsonString, StateLoader stateLoader) { this.jsonString = jsonString; this.stateLoader = stateLoader; }
//to pass on to the next state internal Cleanup_Started(string jsonString, StateLoader stateLoader) { this.jsonString = jsonString; this.stateLoader = stateLoader; }
public static void Main(string[] args) { StateLoader loader = new StateLoader(); loader.TransitionState(); }
internal PatchRun_Created(string jsonString, StateLoader stateLoader) { this.jsonString = jsonString; this.stateLoader = stateLoader; }