Hello,
i got a problem with my code. I tried to make a get/set function for my
life variable, but the get, set and value is always marked as red, with the information: "The name get does not exist in the current context"
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
private int life;
//return the life value
public int Life() {
get
{
return life;
}
set{
life = value;
}
}
}
↧