// The map object is our Main Asset - the prefab that is created in our scene when dragged into the hierarchy private bool PrepareMainObject() { var icon = SuperIcons.GetTmxIcon(); var goGrid = new GameObject("_MapMainObject"); SuperImportContext.AddObjectToAsset("_MapPrfab", goGrid, icon); SuperImportContext.SetMainObject(goGrid); m_MapComponent = goGrid.AddComponent <SuperMap>(); return(true); }
// The map object is our Main Asset - the prefab that is created in our scene when dragged into the hierarchy private bool PrepareMainObject() { var icon = SuperImportContext.Icons.TmxIcon; // The Main Gameobject is our grid containing all the layers var goGrid = new GameObject("_MapMainObject"); SuperImportContext.AddObjectToAsset("_MapPrfab", goGrid, icon); SuperImportContext.SetMainObject(goGrid); m_MapComponent = goGrid.AddComponent <SuperMap>(); return(true); }
private void CreateTileset(XElement xTileset) { Assert.IsNull(this.Tileset); Tileset = ScriptableObject.CreateInstance <SuperTileset>(); Tileset.m_IsInternal = false; SuperImportContext.AddObjectToAsset("_TilesetScriptObject", Tileset, SuperImportContext.Icons.TsxIcon); SuperImportContext.SetMainObject(this.Tileset); var loader = new TilesetLoader(this.Tileset, this, m_UseSpriteAtlas, (int)m_AtlasWidth, (int)m_AtlasHeight); loader.LoadFromXml(xTileset); }
protected override void InternalOnImportAsset() { base.InternalOnImportAsset(); ImporterVersion = ImporterConstants.WorldVersion; AddSuperAsset <SuperAssetWorld>(); var goWorld = new GameObject("world"); var icon = SuperIcons.GetWorldIcon(); SuperImportContext.AddObjectToAsset("_world", goWorld, icon); SuperImportContext.SetMainObject(goWorld); goWorld.AddComponent <SuperWorld>(); try { ParseJsonAsset(goWorld); } catch (Exception ex) { ReportError("Unknown error importing World file: {0}\n{1}\n{2}", assetPath, ex.Message, ex.StackTrace); } }