Example #1
0
    /*
     * public string EditInput(string input)
     * {
     *
     * }
     */

    public bool ObjectClick()
    {
        if (Input.GetMouseButtonDown(0))
        {
            RaycastHit hit;
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);

            if (Physics.Raycast(ray, out hit))
            {
                if (hit.transform != null)
                {
                    if (hit.transform.GetComponent <VirtualFunction>() != null)
                    {
                        if (vfunction != null)
                        {
                            vfunction.DettachedToEditor();
                        }

                        vfunction = hit.transform.GetComponent <VirtualFunction>();
                        vfunction.AttachedToEditor();
                        os = vfunction.vos;
                    }

                    OpenEditor();
                    return(true);
                }
            }
        }

        return(false);
    }
 public EditorCommand(VirtualOS virtualOS)
 {
     Name           = "Editor";
     Command        = "editor";
     Description    = "Opens code editor";
     Help           = "Usage: No arguments";
     ArgLength      = 0;
     this.virtualOS = virtualOS;
     AddCommandToConsole();
 }
Example #3
0
    protected virtual void Start()
    {
        inTestMode = !VirtualOS.Active;

        if (inTestMode)
        {
            testCodeText = (testCode == null) ? "" : testCode.text;
            StartTask(testCodeText);
        }
        else
        {
            VirtualOS.RegisterTask(this);
        }
    }
Example #4
0
    public void Start()
    {
        outline = gameObject.AddComponent <Outline>();
        outline.OutlineWidth = 2;
        outline.OutlineColor = Color.black;
        outline.OutlineMode  = Outline.Mode.OutlineAll;
        outline.enabled      = false;

        if (vos == null)
        {
            vos = gameObject.GetComponent <VirtualOS>();
        }

        bus = new VirtualBUS(vos);

        SetBus();
    }
 protected virtual void Start()
 {
     VirtualOS.RegisterTask(this);
 }
Example #6
0
 public VirtualBUS(VirtualOS os)
 {
     this.os   = os;
     this.pins = new List <int>();
 }