Example #1
0
    private void Start()
    {
        var main = GameObject.Find("Main");

        this.focusManager    = main.GetComponent <InputFocusManager>();
        this.referenceBuffer = main.GetComponent <ReferenceBuffer>();
        this.fileSwitcher    = GameObject.Find("ShowAvailableFilesButton").GetComponent <ShowAvailableCSFiles>();
        this.actionSwitcher  = GameObject.Find("ShowActionsButton").GetComponent <ShowActionsBehaviour>();
        this.showCode        = GameObject.Find("ShowCodeButton").GetComponent <ShowCodeBehaviour>();
    }
Example #2
0
    void Start()
    {
        var btn = gameObject.GetComponent <Button>();

        btn.onClick.AddListener(this.OnClick);

        this.fileSelectionPanel = GameObject.Find("ScrollableFileSelection");
        this.fileSelectionPanel.SetActive(false);

        this.showActions = GameObject.Find("Main").GetComponent <ReferenceBuffer>().ShowActions;
    }
Example #3
0
    void Start()
    {
        /// Creating the paraent object that will hold all UI Elements
        var globalParent = new GameObject("TestParent");

        globalParent.transform.SetParent(gameObject.transform, false);
        globalParent.transform.position = gameObject.transform.position;
        this.parentTransform            = globalParent.transform;
        ///...

        this.marginX = 10;
        this.marginY = 20;
        this.marginLableToItsButtons = 0;
        this.xLength = gameObject.GetComponent <RectTransform>().sizeDelta.x;
        /// Calculating the dimentions for lables, buttons and inputs
        this.buttonX = (xLength - 3 * this.marginX) / 2;
        this.buttonY = this.buttonX / 5;
        this.labelY  = this.buttonY;
        this.labelX  = this.buttonX * 2 + marginX;
        this.inputX  = buttonX;
        this.inputY  = this.buttonY;
        ///...

        /// Cashing scripts
        var main = GameObject.Find("Main");

        ///InputFocusManager is used to register inputs so when a shortcut is pressed
        ///during typing, it does not trigger the shortcut
        this.inputFocusManager = main.GetComponent <InputFocusManager>();
        this.colorPicker       = main.GetComponent <ReferenceBuffer>().ColorPicker;
        ///...

        /// Cashing the panel RectTransform
        this.parentRT = gameObject.GetComponent <RectTransform>();

        this.currentTarget  = null;
        this.previousTarget = null;

        this.visibilityManager = GameObject.Find("ShowActionsButton").GetComponent <ShowActionsBehaviour>();
    }