Hello Devs,
Lets say I have a file called as LevelManager.cs and it looks like this
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class LevelManager : MonoBehaviour
{
// code
}
public class LevelInformation
{
static float LowestPoint, HighestPoint, HeightOfTheTree;
static int CurrentLevelNumber;
public static int GetCurrentLevelNumber ()
{
return CurrentLevelNumber;
}
}
Now outside of this file, can I call a method like this →
Debug.Log(LevelInformation.GetCurrentLevelNumber ());
I am under that assumption that as
- It does not inherit monobehaviour
- It is a public class and a public method
- The variable is a static variable
I can call this directly. Basically I am trying to call its method.
Please do correct if I am wrong.
You help is much appreciated.
Thank you,
Karsnen.