Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

How to store a value before it's changed?

$
0
0
Hi guys, I have a game with several states, and I need to store a PreviusState before I change the CurrentState. I'd like to know if there's a way to do that without manually assigning values. Here's the code I wrote in case it's confusing:

Code (CSharp):
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class GameController : MonoBehaviour
  5. {
  6.     public static float score = 0;
  7. //============================================
  8.     //Declare public variables.
  9.     public  float minX = -5.5f;...
How to store a value before it's changed?

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>