// Use this for initialization
 void Start()
 {
     inputField   = GameObject.Find("InputField").GetComponent <HoloToolkit.UI.Keyboard.KeyboardInputField>();
     implicitMenu = GameObject.Find("ImplicitButtons");
     manager      = GameObject.Find("manager").GetComponent <Manager>();
     inputPanel   = GameObject.Find("KeyboardCanvas");
     cw           = GameObject.Find("manager").GetComponent <CalculatorWrapper>();
 }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     //You must use using blocks for use the memory as eficient.
     //Don't worry CaculatorWrapper class is CLI object. That's why, it has a Disposable pattern.
     //You don't need wrapping and implement dispose pattern for the CLI object.
     using (var wrapper = new CalculatorWrapper())
     {
         var sum = wrapper.Sum(10, 10); //10 + 10
         Console.WriteLine("Result: " + sum);
     }
     Console.Read();
 }
Ejemplo n.º 3
0
        public void Start()
        {
            State = AppBarStateEnum.Default;
            if (interactables.Count == 0)
            {
                RefreshTemplates();
                for (int i = 0; i < defaultButtons.Length; i++)
                {
                    CreateButton(defaultButtons[i], null);
                }

                for (int i = 0; i < buttons.Length; i++)
                {
                    CreateButton(buttons[i], CustomButtonIconProfile);
                }
            }

            /******************self-defined***************/
            manager         = GameObject.Find("manager");
            cameraTransform = GameObject.Find("MixedRealityCamera").GetComponent <Transform>();
            inputField      = GameObject.Find("InputField").GetComponent <HoloToolkit.UI.Keyboard.KeyboardInputField>();
            generatedMesh   = GameObject.Find("GeneratedMesh");
            upSurf          = GameObject.Find("UpSurf");
            upSurf          = GameObject.Find("DownSurf");


            shaderMenu = GameObject.Find("ShaderButtons");
            shaderMenu.SetActive(false);

            inputPanel = GameObject.Find("KeyboardCanvas");
            inputPanel.SetActive(false);

            valuePanel = GameObject.Find("ValueCanvas");
            valuePanel.SetActive(false);

            photoCanvas = GameObject.Find("PhotoCanvas");
            photoCanvas.SetActive(false);

            screenCapture = GameObject.Find("ScreenCapture");

            inputMenu = GameObject.Find("InputButtons");
            inputMenu.SetActive(false);

            implicitMenu = GameObject.Find("ImplicitButtons");
            implicitMenu.SetActive(false);

            captureMenu = GameObject.Find("CaptureButtons");
            captureMenu.SetActive(false);

            particlesys = GameObject.Find("Particle System").GetComponent <ParticleSystem>();
            pi          = new ParticleIllustration(particlesys);
            cw          = GameObject.Find("manager").GetComponent <CalculatorWrapper>();
        }
Ejemplo n.º 4
0
    private void Start()
    {
        var t0 = canvas.transform.Find("text0").GetComponent <TextMeshProUGUI>();
        var t1 = canvas.transform.Find("text1").GetComponent <TextMeshProUGUI>();
        var t2 = canvas.transform.Find("text2").GetComponent <TextMeshProUGUI>();
        var t3 = canvas.transform.Find("text3").GetComponent <TextMeshProUGUI>();

        const int a = 10;
        const int b = 5;

        using (var c = new CalculatorWrapper(a, b))
        {
            t0.text = $"a = {a}, b = {b}";
            t1.text = $"{a} + {b} = {c.Sum()}";
            t2.text = $"{a} - {b} = {c.Sub()}";
            t3.text = $"{a}! = {c.Factorial()}";
        }
    }