void Awake() { c = gameObject.AddComponent<Camera> (); switcher = FindObjectOfType<CameraSwitcher> (); c.depth = 100; }
void Start() { cameraSwitcher = FindObjectOfType<CameraSwitcher> (); comments = new List<CommentObject> (); SetTarget (null); }
void Start() { // layerMask = LayerMask.GetMask ("Ignore Raycast"); handler = new HandleHandler (); handler.Init (this); if (placeItems == null) { placeItems = new GameObject ("Empty PlaceItems").AddComponent<PlaceItems> (); } selectionBox = Instantiate<GameObject> (selectionBox); cameraSwitcher = FindObjectOfType<CameraSwitcher> (); foreach (PlaceItem pi in placeItems.placeItems) { GameObject pip = GameObject.Instantiate (placeItemPrefab); pip.transform.SetParent (scrollContent.transform, false); PlaceItemEntry pie = pip.GetComponent<PlaceItemEntry> (); pie.PlaceItem = pi; pie.itemButton.onClick.AddListener (() => { CreatePlaceItemInstance (pie.PlaceItem); }); } placedItems = new List<PlaceItem> (); SetTarget (null); dataSaveLoad.AddHandler (DataLoaded, typeof(List<PlaceItemData>)); FileInfo fi = new FileInfo (dataSaveLoad.GetFilePath (latestAutoSavefile, folder)); print (dataSaveLoad.GetFilePath (folder, latestAutoSavefile)); if (fi.Exists) { dataSaveLoad.Load (fi, typeof(List<PlaceItemData>)); //PlaceItem[] pis = FindObjectsOfType<PlaceItem> (); //placedItems.AddRange (pis); SetTarget (null); } }