playMaker

Author Topic: How to convert type 'system.Enum ' to  (Read 969 times)

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
How to convert type 'system.Enum ' to
« on: August 07, 2018, 06:10:24 PM »
Hello,

i have this little problem:

i want to get Enum choice to set it into the script:

here is a little portion of code from it
Code: [Select]
   [System.Serializable]
        public class GlobalConfiguration
        {
            // Global config
            public string worldName;

            public enum MapOrientations
            {
                xz,
                xy
            }

            public MapOrientations mapOrientation;


my code
Code: [Select]
[ObjectType(typeof(TileWorldConfiguration.GlobalConfiguration.MapOrientations))]
public FsmEnum MapOrientation;
configuration.global.mapOrientation = MapOrientation.Value;

my error:
Cannot implicitly convert type 'system.Enum' to Blablabla.MapOrientations'
An Explicit conversion exists (are you missing a cast? yes certainly...)


what is the magic formule for this conversion ?