void Start() { this.showCode = ReferenceBuffer.Instance.ShowCode; this.inputFocusManager = ReferenceBuffer.Instance.focusManager; var button = gameObject.GetComponent <Button>(); button.onClick.AddListener(CompileTextAndSendToTarget); }
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>(); }
void Start() { //Cursor.lockState = CursorLockMode.None; var thing = Cursor.lockState; this.rotate = false; var main = GameObject.Find("Main"); this.inputFocusManager = main.GetComponent <InputFocusManager>(); Init(); }
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>(); }