Hiya, i declared an enum
public enum PlanetList {S , Mer , Ven , Eth , Mrs , Jup , Sat , Ura , Nep , Plt};
public PlanetList List = PlanetList.S;
and i was wondering how to pass this through to another script, so that i can find out when List is at another planet.
Thanks for any assistance.
If you declared the enum outside of a class you can access it from everywhere. If it's in a class you need to specify the full path:
public class Test
{
public enum PlanetList {S , Mer , Ven , Eth , Mrs , Jup , Sat , Ura , Nep , Plt};
}
from another script:
Test.PlanetList home = Test.PlanetList.Eth;
edit
Just read your question again. Do you want to access the List variable or the enum type ?
To access a variable from another script instance you have to use GetComponent on the GameObject the script is attached to, or if there’s only one instance in the scene you can use FindObjectOfType