Ejemplo n.º 1
0
    void Find()
    {
        var allObjects = SceneObjectUtility.GetAllObjectsInScene(false);

        tagWithObjectList.Clear();

        foreach (var obj in allObjects)
        {
            if (obj.CompareTag("Untagged"))
            {
                continue;
            }

            var tagWithObj = tagWithObjectList.Find((item) => item.tag == obj.tag);

            if (tagWithObj == null)
            {
                tagWithObj = new TagWithObjects()
                {
                    tag = obj.tag
                };
                tagWithObjectList.Add(tagWithObj);
            }

            tagWithObj.objectList.Add(obj);
        }
    }
Ejemplo n.º 2
0
    void Find()
    {
        var allObjects = SceneObjectUtility.GetAllObjectsInScene(false);
        tagWithObjectList.Clear();

        foreach( var obj in allObjects )
        {
            if( obj.CompareTag("Untagged") )
                continue;

            var tagWithObj = tagWithObjectList.Find( (item) => item.tag == obj.tag) ;

            if( tagWithObj == null )
            {
                tagWithObj = new TagWithObjects(){ tag = obj.tag };
                tagWithObjectList.Add(tagWithObj);
            }

            tagWithObj.objectList.Add( obj );
        }
    }