private void Start()
    {
        markerdetectorGO = MarkerDetector.Instance.gameObject;

        //hide markerindicator
        marketTargetindicator = markerdetectorGO.GetComponent<MarkerTargetIndicator>();
        marketTargetindicator.enabled = false;
    }
Ejemplo n.º 2
0
    private void Start()
    {
        markerdetectorGO = MarkerDetector.Instance.gameObject;

        //hide markerindicator
        marketTargetindicator         = markerdetectorGO.GetComponent <MarkerTargetIndicator>();
        marketTargetindicator.enabled = false;
    }
Ejemplo n.º 3
0
        /// <summary>
        /// Sets up the detector and marker indicator to find this marker.
        /// </summary>
        public void Start()
        {
            this.lamb           = new GameObject("lamb").transform;
            this.markerDetector = MarkerDetector.Instance;
            this.MetaScale      = DefaultMetaScale;
            this.MetaDepth      = DefaultMetaDepth;

            if (this.markerDetector == null)
            {
                throw new InvalidOperationException("The marker detector cannot be loaded. Is the Meta connected?");
            }

            // Hide the markerindicator
            MarkerTargetIndicator indicator = this.markerDetector.GetComponent <MarkerTargetIndicator>();

            indicator.enabled = false;
        }
    void Start()
    {
        markerdetectorGO = MarkerDetector.Instance.gameObject;
        //hide markerindicator
        marketTargetindicator = markerdetectorGO.GetComponent<MarkerTargetIndicator>();
        target = markerdetectorGO.GetComponent<MarkerTarget> ();
        //marketTargetindicator.enabled = false;

        bar = GameObject.CreatePrimitive (PrimitiveType.Cube);
        bar.transform.localScale = new Vector3 ((float)0, (float)0, (float)0);

        txtValue = new GameObject("TextField");
        txtValue.transform.localScale = new Vector3 ((float)0, (float)0, (float)0);

        bars = new GameObject[100];
        txtValues = new GameObject[100];
        for (var i=0; i<100; i++) {
            bars[i] = Instantiate(bar, new Vector3(0,0,0), Quaternion.identity) as GameObject;
            bars[i].name = "Bar_"+i.ToString();
            bars[i].AddComponent<Canvas>();
            //Canvas temp = bars[i].GetComponent<Canvas>();
            bars[i].GetComponent<RectTransform>().sizeDelta = new Vector2((float)1.5, (float)1.5);
            bars[i].transform.localScale = new Vector3((float)0.01, (float)0.06, (float)0.01);

            bars[i].GetComponent<Renderer>().enabled = false; // Makes the bars invisible.

            txtValues[i] = Instantiate(txtValue, new Vector3(0,0,0), Quaternion.identity) as GameObject;
            txtValues[i].name = "BarValue_"+i.ToString();
            txtValues[i].AddComponent<TextMesh>();
            //txtValues[i].AddComponent<MeshRenderer>();
            txtValues[i].GetComponent<TextMesh>().text = "1"; // Set some default text
            Font ArialFont = (Font)Resources.GetBuiltinResource (typeof(Font), "Arial.ttf"); // Get the font to apply to the textmesh
            txtValues[i].GetComponent<TextMesh>().font = ArialFont;
            txtValues[i].GetComponent<TextMesh>().fontSize = 10;
            txtValues[i].GetComponent<TextMesh>().renderer.sharedMaterial = ArialFont.material; // Important to set the font as a material
        }

        socketobject = GameObject.Find("SocketIO");
        socket = socketobject.GetComponent<SocketIOComponent> ();

        socket.On("open", OnSocketOpen);
        socket.On ("error", SocketError);

        socket.On ("UNITY_PING", dataTransmission);

        socket.On ("UNITYCLIENT_DATASET_WINDOW_UPDATE", datasetUpdate);
    }