Esempio n. 1
0
 public Unity_Level(Unity_Map[] maps,
                    Unity_ObjectManager objManager,
                    List <Unity_Object> eventData = null,
                    Unity_Object rayman           = null,
                    IReadOnlyDictionary <string, string[]> localization = null,
                    int defaultMap    = 0, int defaultCollisionMap = 0,
                    int pixelsPerUnit = 16,
                    int cellSize      = 16,
                    Func <byte, Unity_MapCollisionTypeGraphic> getCollisionTypeGraphicFunc = null,
                    Texture2D background         = null,
                    Texture2D parallaxBackground = null,
                    Unity_Sector[] sectors       = null)
 {
     Maps                        = maps;
     ObjManager                  = objManager;
     EventData                   = eventData ?? new List <Unity_Object>();
     Rayman                      = rayman;
     Localization                = localization;
     DefaultMap                  = defaultMap;
     DefaultCollisionMap         = defaultCollisionMap == -1 ? 0 : defaultCollisionMap;
     PixelsPerUnit               = pixelsPerUnit;
     CellSize                    = cellSize;
     GetCollisionTypeGraphicFunc = getCollisionTypeGraphicFunc ?? (x => ((R1_TileCollisionType)x).GetCollisionTypeGraphic());
     Background                  = background;
     ParallaxBackground          = parallaxBackground;
     Sectors                     = sectors;
 }
Esempio n. 2
0
        public Unity_Level(Unity_Map[] maps,
                           Unity_ObjectManager objManager,
                           List <Unity_Object> eventData = null,
                           Unity_Object rayman           = null,
                           IReadOnlyDictionary <string, string[]> localization = null,
                           int defaultMap    = 0, int defaultCollisionMap = 0,
                           int pixelsPerUnit = 16,
                           int cellSize      = 16,
                           Func <ushort, string> getCollisionTypeNameFunc = null,
                           Func <ushort, Unity_MapCollisionTypeGraphic> getCollisionTypeGraphicFunc = null,
                           Texture2D background              = null,
                           Texture2D parallaxBackground      = null,
                           Unity_Sector[] sectors            = null,
                           Unity_IsometricData isometricData = null)
        {
            Maps                        = maps;
            ObjManager                  = objManager;
            EventData                   = eventData ?? new List <Unity_Object>();
            Rayman                      = rayman;
            Localization                = localization;
            DefaultMap                  = defaultMap;
            DefaultCollisionMap         = defaultCollisionMap == -1 ? 0 : defaultCollisionMap;
            PixelsPerUnit               = pixelsPerUnit;
            CellSize                    = cellSize;
            GetCollisionTypeNameFunc    = getCollisionTypeNameFunc ?? (x => ((R1_TileCollisionType)x).ToString());
            GetCollisionTypeGraphicFunc = getCollisionTypeGraphicFunc ?? (x => ((R1_TileCollisionType)x).GetCollisionTypeGraphic());
            Background                  = background;
            ParallaxBackground          = parallaxBackground;
            Sectors                     = sectors;
            IsometricData               = isometricData;

            MaxWidth  = Maps.Max(m => m.Width);
            MaxHeight = Maps.Max(m => m.Height);

            GridMap = new Unity_Map
            {
                Width   = MaxWidth,
                Height  = MaxHeight,
                TileSet = new Unity_TileSet[]
                {
                    new Unity_TileSet(Util.GetGridTex(cellSize), cellSize),
                },
                MapTiles = Enumerable.Range(0, MaxWidth * MaxHeight).Select(x => new Unity_Tile(new MapTile())).ToArray(),
                Type     = Unity_Map.MapType.Graphics,
                Layer    = Unity_Map.MapLayer.Overlay
            };
        }
Esempio n. 3
0
 public DummyLegacyEditorWrapper(Unity_Object obj)
 {
     Obj = obj;
 }
Esempio n. 4
0
 public abstract bool IsCurrentState(Unity_Object obj);
Esempio n. 5
0
 public abstract void Apply(Unity_Object obj);
 public override bool IsCurrentState(Unity_Object obj) => AnimIndex == ((Unity_Object_GBAMadTrax)obj).CurrentSprite;
            public override void Apply(Unity_Object obj)
            {
                var madTraxObj = (Unity_Object_GBAMadTrax)obj;

                madTraxObj.CurrentSprite = (short)AnimIndex;
            }