Exemplo n.º 1
0
	void LoadTileMapData()
	{
		width = tileMap.width;
		height = tileMap.height;
		partitionSizeX = tileMap.partitionSizeX;
		partitionSizeY = tileMap.partitionSizeY;
	
		GetEditorData();

		if (tileMap.data && editorData && tileMap.Editor__SpriteCollection != null)
		{
			// Rebuild the palette
			editorData.CreateDefaultPalette(tileMap.SpriteCollectionInst, editorData.paletteBrush, editorData.paletteTilesPerRow);
		}
		
		// Rebuild the render utility
		if (sceneGUI != null)
		{
			sceneGUI.Destroy();
		}
		sceneGUI = new tk2dTileMapSceneGUI(this, tileMap, editorData);
		
		// Rebuild the brush renderer
		brushRenderer = null;
	}
    void LoadTileMapData()
    {
        buildKey = tileMap.buildKey;

        string editorDataPath = AssetDatabase.GUIDToAssetPath(tileMap.editorDataGUID);

        editorData = Resources.LoadAssetAtPath(editorDataPath, typeof(tk2dTileMapEditorData)) as tk2dTileMapEditorData;

        width          = tileMap.width;
        height         = tileMap.height;
        partitionSizeX = tileMap.partitionSizeX;
        partitionSizeY = tileMap.partitionSizeY;

        if (tileMap.data && editorData)
        {
            // Rebuild the palette
            editorData.CreateDefaultPalette(tileMap.spriteCollection, editorData.paletteBrush, editorData.paletteTilesPerRow);
        }

        // Rebuild the render utility
        if (sceneGUI != null)
        {
            sceneGUI.Destroy();
        }
        sceneGUI = new tk2dTileMapSceneGUI(this, tileMap, editorData);

        // Rebuild the brush renderer
        if (brushRenderer != null)
        {
            brushRenderer.Destroy();
        }
        brushRenderer = new tk2dEditor.BrushRenderer(tileMap.spriteCollection);
    }
    public tk2dScratchpadGUI(tk2dTileMapSceneGUI _parent, tk2dEditor.BrushRenderer _brushRenderer, tk2dTileMapEditorBrush _workingBrush)
    {
        parent = _parent;

        brushRenderer = _brushRenderer;

        workingBrush = _workingBrush;
    }
Exemplo n.º 4
0
	void OnDisable()
	{
		brushRenderer = null;
		guiBrushBuilder = null;
		
		if (sceneGUI != null)
		{
			sceneGUI.Destroy();
			sceneGUI = null;
		}
		
		if (editorData)
		{
			EditorUtility.SetDirty(editorData);
		}
		
		if (tileMap && tileMap.data)
		{
			EditorUtility.SetDirty(tileMap.data);
		}
	}
Exemplo n.º 5
0
	void LoadTileMapData()
	{
		width = tileMap.width;
		height = tileMap.height;
		partitionSizeX = tileMap.partitionSizeX;
		partitionSizeY = tileMap.partitionSizeY;
	
		GetEditorData();

		if (tileMap.data && editorData && tileMap.Editor__SpriteCollection != null)
		{
			// Rebuild the palette
			editorData.CreateDefaultPalette(tileMap.SpriteCollectionInst, editorData.paletteBrush, editorData.paletteTilesPerRow);
		}
		
		// Rebuild the render utility
		if (sceneGUI != null)
		{
			sceneGUI.Destroy();
		}
		sceneGUI = new tk2dTileMapSceneGUI(this, tileMap, editorData);
		
		// Rebuild the brush renderer
		brushRenderer = null;
	}
Exemplo n.º 6
0
	void OnDisable()
	{
		brushRenderer = null;
		guiBrushBuilder = null;
		
		if (sceneGUI != null)
		{
			sceneGUI.Destroy();
			sceneGUI = null;
		}
		
		if (editorData)
		{
			EditorUtility.SetDirty(editorData);
		}
		
		if (tileMap && tileMap.data)
		{
			EditorUtility.SetDirty(tileMap.data);
		}
	}
Exemplo n.º 7
0
	public tk2dScratchpadGUI(tk2dTileMapSceneGUI _parent, tk2dEditor.BrushRenderer _brushRenderer, tk2dTileMapEditorBrush _workingBrush) {
		parent = _parent;
		brushRenderer = _brushRenderer;
		workingBrush = _workingBrush;
	}
	void LoadTileMapData()
	{
		buildKey = tileMap.buildKey;
		
		string editorDataPath = AssetDatabase.GUIDToAssetPath(tileMap.editorDataGUID);
		editorData = AssetDatabase.LoadAssetAtPath(editorDataPath, typeof(tk2dTileMapEditorData)) as tk2dTileMapEditorData;
		
		width = tileMap.width;
		height = tileMap.height;
		partitionSizeX = tileMap.partitionSizeX;
		partitionSizeY = tileMap.partitionSizeY;
		
		if (tileMap.data && editorData)
		{
			// Rebuild the palette
			editorData.CreateDefaultPalette(tileMap.SpriteCollectionInst, editorData.paletteBrush, editorData.paletteTilesPerRow);
		}
		
		// Rebuild the render utility
		if (sceneGUI != null)
		{
			sceneGUI.Destroy();
		}
		sceneGUI = new tk2dTileMapSceneGUI(this, tileMap, editorData);
		
		// Rebuild the brush renderer
		brushRenderer = null;
	}