Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        menuOpen = false;
        darkscreen.SetActive(false);
        curShowCursor             = true;
        stationManager            = GameObject.FindGameObjectWithTag("Stations").GetComponent <StationManager>();
        ray                       = GetComponent <GraphicRaycaster>();
        EventSystem               = GetComponent <EventSystem>();
        camZoomCont               = GameObject.FindObjectOfType <CamZoomControls>();
        stationDisplayPosAndScale = GameObject.FindObjectOfType <StationDisplayPosAndScaleController>();

        //the 8 UI sprite slices are here
        elem = new List <GameObject>();
        for (int i = 0; i < 8; i++)
        {
            elem.Add(element.transform.GetChild(i).gameObject);
        }
        foreach (var e in elem)
        {
            e.GetComponent <Image>().alphaHitTestMinimumThreshold = 0.01f; // make raycast ignore transparency
        }
    }
Ejemplo n.º 2
0
 // Start is called before the first frame update
 void Awake()
 {
     stationDisplayPosAndScaleController = GameObject.FindObjectOfType <StationDisplayPosAndScaleController>();
     chosenScaleIndex = (int)stationDisplayPosAndScaleController.chosenCenterCamScale;
 }