예제 #1
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);
    }
    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);
    }