示例#1
0
    void Find()
    {
        var allObjects = SceneObjectUtility.GetAllObjectsInScene(false);

        layerWithObjectList.Clear();

        int defaultLayer = LayerMask.NameToLayer("Default");

        foreach (var obj in allObjects)
        {
            if (obj.layer == defaultLayer)
            {
                continue;
            }

            var layerWithObj = layerWithObjectList.Find((item) => item.layer == obj.layer);

            if (layerWithObj == null)
            {
                layerWithObj = new LayerWithObject()
                {
                    layer = obj.layer
                };
                layerWithObjectList.Add(layerWithObj);
            }

            layerWithObj.objectList.Add(obj);
        }
    }
示例#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);
        }
    }
示例#3
0
    /*
     * void OnSelectionChange ()
     * // void Update()
     * {
     *
     *      if (EditorApplication.isPaused || !EditorApplication.isPlaying) {
     *              UpdateAllObject ();
     *              UpdateList ();
     *      }
     * }
     */

    void UpdateAllObject()
    {
        allObject = SceneObjectUtility.GetAllObjectsInScene(false);
    }