void Awake() { if (EditManager.Instance) { throw new Exception("EditManager is found."); } EditManager.Instance = this; Application.wantsToQuit += WantToQuit; this.Layers = new List <EditLayer>(); var gridObj = new GameObject("Grid"); gridObj.transform.parent = this.transform; this.Grid = gridObj.AddComponent <Grid>(); var cursorObj = new GameObject("EditCursor"); cursorObj.transform.parent = EditManager.Instance.transform; this.Cursor = cursorObj.AddComponent <EditCursor>(); var selectionObj = new GameObject("Selector"); selectionObj.transform.parent = this.transform; this.Selector = selectionObj.AddComponent <Selector>(); var routePathObj = new GameObject("RoutePath"); selectionObj.transform.parent = this.transform; this.RoutePath = routePathObj.AddComponent <RoutePath>(); routePathObj.SetActive(false); this.ToolMenu = GameObject.FindObjectOfType <ToolMenu>(); this.ModelProperties = GameObject.FindObjectOfType <ModelProperties>(); this.MetaInfo = GameObject.FindObjectOfType <MetaInfo>(); this.QuitDialog = GameObject.FindObjectOfType <QuitDialog>(); this.QuitDialog.Close(); this.LayerListView = GameObject.FindObjectOfType <LayerListView>(); this.BlockMaterial = Resources.Load <Material>("Materials/BlockMaterial"); this.WaterMaterial = Resources.Load <Material>("Materials/WaterMaterial"); this.ModelMaterial = Resources.Load <Material>("Materials/ModelMaterial"); BlockShape.LoadData(); ModelShape.LoadData(); }