public void SetState(ISerialDataStore state) { SaveUI past = (SaveUI)state; IsAlive = past.IsAlive; filterImg.enabled = past.filterImgEnabled; filterImg.color = GetAlphaChange(filterImg, past.alphaFilter); deathText.enabled = past.deathTextEnabled; deathText.color = GetAlphaChange(deathText, past.alphaText); deathAnimationTrigger = past.deathAnimationTrigger; timeBar.transform.position = new Vector2(past.timeBarPositionX, past.timeBarPositionY); timeBar.transform.localScale = new Vector2(past.timeBarScale, past.timeBarScale); Time.timeScale = past.timeScale; pastStates.TogglePause(past.isPaused); rewindPrompt.enabled = past.rewindPrompting; restartPrompt.enabled = past.restartPrompting; outOfJuiceText.enabled = past.outOfJuicing; rewindPrompt.color = GetAlphaChange(rewindPrompt, past.rewindPromptAlpha); restartPrompt.color = GetAlphaChange(restartPrompt, past.restartPromptAlpha); outOfJuiceText.color = GetAlphaChange(outOfJuiceText, past.outOfJuiceAlpha); }
// Update is called once per frame private void OnTriggerEnter2D(Collider2D collision) { if (!isTriggered) { CP_Manager.currentCP_Position = transform.position; if (!CP_Manager.loadFromCP) { SaveUI.setSaveUIFlag(); } } CP_Manager.loadFromCP = false; Debug.Log("Checkpoint"); isTriggered = true; animator.SetBool("isTriggered", isTriggered); }
void Awake() { Instance = this; }