Ejemplo n.º 1
0
    void ProcessPosition(string tagID, Vector3 pos)
    {
        GameObject tag = null;

        try {
            tag = GameObject.FindGameObjectsWithTag(TagDefs.TAG_TAG).Where(t => tagID == t.name).First();
        } catch (Exception) {
            tag      = Instantiate(TagPrefab, new Vector3(0, 0.5f, 0), Quaternion.identity) as GameObject;
            tag.name = tagID;
        }

        TagMove tagScript = tag.GetComponent <TagMove> ();

        if (tagScript != null)
        {
            tagScript.Move(pos);
        }
    }
Ejemplo n.º 2
0
    public void ProcessPosition(string tagID, Vector3 pos)
    {
        GameObject tag = null;

        try {
            tag = GameObject.Find(tagID);
        } catch (Exception) {
        }

        if (tag == null)
        {
            tag      = Instantiate(TagPrefab, new Vector3(0, 0.5f, 0), Quaternion.identity) as GameObject;
            tag.name = tagID;
        }

        TagMove tagScript = tag.GetComponent <TagMove> ();

        if (tagScript != null)
        {
            //tagScript.Move(pos);
            tagScript.PushPosition(pos);
        }
    }
Ejemplo n.º 3
0
    private void UpdateTag(string tagID, List <AnchorInfoPacket> packets)
    {
        if (packets.Count < 3)
        {
            throw new ArgumentException("Must have at least 3 packets. " + packets.Count.ToString() + "were provided.");
        }

        Vector3 newTagPosition = CalculateTagPositionByPackets(packets);

        GameObject tag = null;

        try {
            tag = GameObject.FindGameObjectsWithTag(TagDefs.TAG_TAG).Where(t => tagID == t.name).First();
        } catch (Exception) {
        }


        if (tag == null)
        {
            tag      = Instantiate(TagPrefab, new Vector3(0, 0.5f, 0), Quaternion.identity) as GameObject;
            tag.name = tagID;
        }


//        CPTagPositioner tagScript = (CPTagPositioner)tag.GetComponent(typeof(CPTagPositioner));
//        if(tagScript != null) {
//            tagScript.AddPosition(newTagPosition);
//        }

        TagMove tagScript = tag.GetComponent <TagMove> ();

        if (tagScript != null)
        {
            tagScript.Move(newTagPosition);
        }
    }
Ejemplo n.º 4
0
        public void MoveString(string ingresado, string esperado)
        {
            var tag = new TagMove(ingresado);

            Assert.AreEqual(esperado, tag.ToString());
        }