void OnEnable()
    {
        //_target = (VesselsInstantiator)target;
        _objects      = Resources.LoadAll("Vessels", typeof(GameObject)).ToList();
        _vesselsSaved = (VesselsSaved)Resources.Load("VesselsConfig");

        if (_vesselsSaved == null)
        {
            ScriptableObjectsCreator.CreateVesselsConfig();
            _vesselsSaved = (VesselsSaved)Resources.Load("VesselsConfig");
        }

        EditorUtility.SetDirty(_vesselsSaved);

        _pathsSaved = (PathConfig)Resources.Load("PathConfig");

        if (_pathsSaved == null)
        {
            ScriptableObjectsCreator.CreatePathConfig();
            _pathsSaved = (PathConfig)Resources.Load("PathConfig");
        }

        editModeStyle.fontSize          = 20;
        insideVesselLimitStyle.fontSize = 20;
    }
Example #2
0
    public void Init()
    {
        maxSize = new Vector2(501, 525);
        minSize = new Vector2(500, 524);

        _seed = GameObject.FindGameObjectWithTag("Seed").GetComponent <Seed>();

        _sceneButtonsConfig = (SceneButtonsConfig)Resources.Load("SceneButtonsConfig");

        if (_sceneButtonsConfig == null)
        {
            ScriptableObjectsCreator.CreateSceneButtonsConfig();
            _sceneButtonsConfig = (SceneButtonsConfig)Resources.Load("SceneButtonsConfig");
        }

        EditorUtility.SetDirty(_sceneButtonsConfig);

        _pathsSaved = (PathConfig)Resources.Load("PathConfig");

        if (_pathsSaved == null)
        {
            ScriptableObjectsCreator.CreatePathConfig();
            _pathsSaved = (PathConfig)Resources.Load("PathConfig");
        }

        _cameraRect = GetWindow <SceneView>().camera.pixelRect;

        ConfigurateButtonsByDefault();
    }
    void OnEnable()
    {
        _target = (Seed)target;

        _target.gameObject.tag = "Seed";

        pathsSaved = (PathConfig)Resources.Load("PathConfig");

        if (pathsSaved == null)
        {
            ScriptableObjectsCreator.CreatePathConfig();
            pathsSaved = (PathConfig)Resources.Load("PathConfig");
        }

        _sceneButtonsConfig = (SceneButtonsConfig)Resources.Load("SceneButtonsConfig");

        if (_sceneButtonsConfig == null)
        {
            ScriptableObjectsCreator.CreateSceneButtonsConfig();
            _sceneButtonsConfig = (SceneButtonsConfig)Resources.Load("SceneButtonsConfig");
        }

        EditorUtility.SetDirty(_sceneButtonsConfig);

        ConfigurateButtonsByDefault();

        pathsSaved.objectsToInstantiate.Clear();

        ConfigurateObjects();
    }
    void OnEnable()
    {
        _target = (Path)target;

        _sceneButtonsConfig = (SceneButtonsConfig)Resources.Load("SceneButtonsConfig");

        if (_sceneButtonsConfig == null)
        {
            ScriptableObjectsCreator.CreateSceneButtonsConfig();
            _sceneButtonsConfig = (SceneButtonsConfig)Resources.Load("SceneButtonsConfig");
        }

        EditorUtility.SetDirty(_sceneButtonsConfig);
    }
    private void OnEnable()
    {
        _pathsSaved = (PathConfig)Resources.Load("PathConfig");

        if (_pathsSaved == null)
        {
            ScriptableObjectsCreator.CreatePathConfig();
            _pathsSaved = (PathConfig)Resources.Load("PathConfig");
        }

        _vesselsSaved = (VesselsSaved)Resources.Load("VesselsConfig");

        if (_vesselsSaved == null)
        {
            ScriptableObjectsCreator.CreateVesselsConfig();
            _vesselsSaved = (VesselsSaved)Resources.Load("VesselsConfig");
        }

        EditorUtility.SetDirty(_vesselsSaved);
    }
    void OnEnable()
    {
        _target = (Vessel)target;

        _vesselsSaved = (VesselsSaved)Resources.Load("VesselsConfig");

        if (_vesselsSaved == null)
        {
            ScriptableObjectsCreator.CreateVesselsConfig();
            _vesselsSaved = (VesselsSaved)Resources.Load("VesselsConfig");
        }

        EditorUtility.SetDirty(_vesselsSaved);

        _sceneButtonsConfig = (SceneButtonsConfig)Resources.Load("SceneButtonsConfig");

        if (_sceneButtonsConfig == null)
        {
            ScriptableObjectsCreator.CreateSceneButtonsConfig();
            _sceneButtonsConfig = (SceneButtonsConfig)Resources.Load("SceneButtonsConfig");
        }

        EditorUtility.SetDirty(_sceneButtonsConfig);
    }
    public void Init()
    {
        maxSize = new Vector2(501, 585);
        minSize = new Vector2(500, 584);

        _pathsSaved = (PathConfig)Resources.Load("PathConfig");

        if (_pathsSaved == null)
        {
            ScriptableObjectsCreator.CreateVesselsConfig();
            _pathsSaved = (PathConfig)Resources.Load("PathConfig");
        }

        _pathCurrentIndex        = _pathsSaved.pathTypeSelected;
        _checkCurrentIndexChange = _pathsSaved.pathTypeSelected;

        StartDropListWithCurrentMaterial();
        ShowPreview();

        _guiStyle.fontSize  = 15;
        _guiStyle.fontStyle = FontStyle.Bold;

        GetAllScripts();
    }