Skip to content
Permalink
13bc366381
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
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 () {
}
}