void Awake() { mapWidth = GetComponent <RectTransform>().rect.width; mapHeight = GetComponent <RectTransform>().rect.height; panZoom = GetComponent <PanZoom>(); }
private void Awake() { if (instance != null) { Debug.LogWarning("More than one instance of PanZoom found!"); return; } instance = this; }
private void Start() { cam = Camera.main; camTransform = cam.gameObject.transform; camSize = cam.orthographicSize; canvas.enabled = false; panZoom = gameObject.GetComponent <PanZoom>(); highlightScript = GameObject.FindObjectOfType <Highlight>(); camBounds = GameObject.FindObjectOfType <CamMovementLimits>(); panZoom.enabled = false; highlightScript.enabled = false; camBounds.enabled = false; }
// Start is called before the first frame update void Start() { image = GameObject.Find("RawImage"); borderObject = GameObject.Find("Border"); sprite = GetComponent <SpriteRenderer>(); camera = GameObject.Find("Main Camera"); cameraScript = camera.GetComponent <PanZoom>(); moving = false; selected = false; imageRectTransform = image.GetComponent <RectTransform>(); m_RawImage = image.GetComponent <RawImage>(); borderImage = borderObject.GetComponent <Image>(); leanDrag = GetComponent <LeanDragTranslate>(); leanSelect = GetComponent <LeanSelectable>(); }
private void Start() { cam = Camera.main; ui_Menu = GameObject.Find("GardeningMenu"); sunflowerIcon = GameObject.Find("GardeningIcon"); zoomBar = GameObject.Find("Zoom Bar"); zoomIcon = GameObject.Find("ZoomIcon"); settings = GameObject.Find("MenuIcon"); settingsWindow = GameObject.Find("Options Window"); infoWindow = GameObject.Find("SeedWindow"); flowerImg = GameObject.Find("Image"); optionsPage = GameObject.Find("Options"); flowerPrefabs = new List <GameObject>(); highlightScript = FindObjectOfType <Highlight>(); _panZoom = FindObjectOfType <PanZoom>(); _seed = FindObjectOfType <Seed>(); //Finds all planting grids in the scene and adds them to the list plantingGrids foreach (GameObject go in GameObject.FindGameObjectsWithTag("PlantingGrid")) { plantingGrids.Add(go); } DisableButtons(); foreach (GameObject seedParent in GameObject.FindGameObjectsWithTag("SeedIcon")) { RawImage seeds = seedParent.GetComponent <RawImage>(); menuItems.Add(seeds); flowerPrefabs.Add(seedParent); seeds.color = new Color(0.5f, 0.5f, 0.5f, 255); } foreach (GameObject plotPos in GameObject.FindGameObjectsWithTag("plotZoom")) { Transform cameraPositions = plotPos.GetComponent <Transform>(); plotZoomPositions.Add(cameraPositions); } }
private void AsBigAsYouWantPanel_SizeChanged(object sender, SizeChangedEventArgs e) { PanZoom.CenterContent(); }
private void Awake() { Instance = this; }