Permalink
Cannot retrieve contributors at this time
using UnityEngine; | |
using System.Collections; | |
public class Persistence : MonoBehaviour { | |
public int health = 100; | |
public int score = 0; | |
public int cores = 0; | |
public int power = 0; | |
//Awake | |
void Awake() | |
{ | |
//DontDestroyOnLoad(health); | |
//DontDestroyOnLoad(score); | |
//DontDestroyOnLoad(power); | |
DontDestroyOnLoad(gameObject); | |
} | |
//Collisoin Detection | |
void OnCollisionEnter2D(Collision2D col) | |
{ | |
if (col.gameObject.tag == "EscapeCharge") | |
{ | |
Debug.Log("Charge Counted"); | |
power = power + 1; | |
} | |
} | |
// Use this for initialization | |
void Start () { | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
} |