void OnEnable()
    {
        #region Enable Scene View

        SceneView.onSceneGUIDelegate += SceneGUI;
        lastTool = Tools.current;

        #endregion

        if (!loadFromAssets)
        {
            loadFromAssets = ScriptableObject.CreateInstance <LoadFromAssets>();
        }

        //loadFromAssets.LoadGrid();
        loadFromAssets.LoadTileSets();

        if (!layersandtags)
        {
            layersandtags = ScriptableObject.CreateInstance <LayersAndTags>();
        }
        allLayerNames = layersandtags.editLayers(allLayerNames, ln2, indexLayers);
        tagNames      = layersandtags.getTags();

        /* if (!grid && !GameObject.Find("Grid(Clone)"))
         * {
         *  // grid = Instantiate(loadFromAssets.grid);
         *   g = grid.GetComponent<Grid>();
         * }
         * else if (!grid)
         * {
         *   grid = GameObject.Find("Grid(Clone)");
         *   g = grid.GetComponent<Grid>();
         * }*/
    }
示例#2
0
    void OnEnable()
    {
        if (!layersandtags)
        {
            layersandtags = ScriptableObject.CreateInstance <LayersAndTags>();
        }
        layerNames = layersandtags.editLayers(layerNames, ln2, indexLayers);
        tagNames   = layersandtags.getTags();

        if (!setGrid)
        {
            setGrid = ScriptableObject.CreateInstance <SetGrid>();
        }
        setGrid.LoadGrid();

        if (!grid && !GameObject.Find("Grid(Clone)"))
        {
            grid = Instantiate(setGrid.grid);
            g    = grid.GetComponent <Grid>();
        }
        else if (!grid)
        {
            grid = GameObject.Find("Grid(Clone)");
            g    = grid.GetComponent <Grid>();
        }
    }