コード例 #1
0
ファイル: ApplyBehaviour.cs プロジェクト: Nikismyname/RunTime
    void Start()
    {
        this.showCode          = ReferenceBuffer.Instance.ShowCode;
        this.inputFocusManager = ReferenceBuffer.Instance.focusManager;
        var button = gameObject.GetComponent <Button>();

        button.onClick.AddListener(CompileTextAndSendToTarget);
    }
コード例 #2
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>();
    }
コード例 #3
0
    void Start()
    {
        //Cursor.lockState = CursorLockMode.None;
        var thing = Cursor.lockState;

        this.rotate = false;

        var main = GameObject.Find("Main");

        this.inputFocusManager = main.GetComponent <InputFocusManager>();
        Init();
    }
コード例 #4
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>();
    }