How do I get global integer variable? Using 1.50f AC unity 5.2.4
I'm trying this
using UnityEngine;
using System.Collections;
namespace AC
{
public class VarableTest: MonoBehaviour {
GVar MyVar;
// Use this for initialization
void Start () {
MyVar= AC.GlobalVariables.GetVariable (228);
}
// Update is called once per frame
void Update ()
{
if (MyVar.IntegerValue = 20)
{
Debug.Log ("test");
}
}
}
}
It's giving me this
Assets/VarableTest.cs(21,38): error CS1061: Type AC.GVar' does not contain a definition for
IntegerValue' and no extension method IntegerValue' of type
AC.GVar' could be found (are you missing a using directive or an assembly reference?)
if I use
if (MyVar = 20)
it gives
Cannot implicitly convert type int' to
AC.GVar'
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The Scripting Guide is for the current release - it won't apply for such an outdated version.
Read "val" instead of "IntegerValue", and you comparison checks require two equal signs: