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 = (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; }
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(); }
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); }