Example #1
0
    void Awake()
    {
        mapWidth  = GetComponent <RectTransform>().rect.width;
        mapHeight = GetComponent <RectTransform>().rect.height;

        panZoom = GetComponent <PanZoom>();
    }
Example #2
0
 private void Awake()
 {
     if (instance != null)
     {
         Debug.LogWarning("More than one instance of PanZoom found!");
         return;
     }
     instance = this;
 }
Example #3
0
 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;
 }
Example #4
0
 // 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>();
 }
Example #5
0
    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);
        }
    }
Example #6
0
 private void AsBigAsYouWantPanel_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     PanZoom.CenterContent();
 }
Example #7
0
 private void Awake()
 {
     Instance = this;
 }