Skip to content
Permalink
13bc366381
Go to file
 
 
Cannot retrieve contributors at this time
38 lines (31 sloc) 739 Bytes
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 () {
}
}
You can’t perform that action at this time.