Esempio n. 1
0
    public static void FindSpriteNamesInAllScene()
    {
        ListDictionary<string, string> spriteNames = new ListDictionary<string, string>();

        string[] scenes = (from scene in EditorBuildSettings.scenes where scene.enabled select scene.path).ToArray();
        foreach (string scene in scenes)
        {
            EditorApplication.OpenScene(scene);

            Transform[] allTrnasforms = GameObject.FindObjectsOfType<Transform>();
            foreach (Transform transform in allTrnasforms)
            {
                UISprite sprite = transform.GetComponent<UISprite>();
                if (sprite != null && !spriteNames.ContainsValue(scene, sprite.spriteName))
                    spriteNames.Add(scene, sprite.spriteName);
            }
        }

        string log = string.Empty;
        foreach (string scene in scenes)
        {
            if (!spriteNames.ContainsKey(scene))
                continue;

            log += string.Format("Scene : {0}\n", scene);

            string spriteNameInScene = string.Empty;
            foreach (string spriteName in spriteNames[scene])
                spriteNameInScene += string.Format("{0}\n", spriteName);

            log += string.Format("{0}\n\n", spriteNameInScene);
        }

        Debug.LogWarning(log);
    }
        private void UnregisterProject(IProject project)
        {
            var location = project.Location;

            if (_projects.ContainsKey(location))
            {
                _projects.Remove(location);
            }

            ReleaseProjectRefresher(project);
        }
Esempio n. 3
0
        private JsonObject ReadObject(ref char* ptr, ref char* end)
        {
            // check first letter
            Debug.Assert(*ptr == '{');
            ptr++;

            // check object is empty
            SkipWhitespaces(ref ptr, ref end);
            if (IsEndOfJson(ref ptr, ref end))
            {
                // not completed
                throw CreateException(ptr, "object is not closed.");
            }
            if (*ptr == '}')
            {
                ptr++;
                return JsonObject.Empty;
            }

            IDictionary<string, JsonValue> dict = new ListDictionary<string, JsonValue>(SmallDictionaryLength);
            int lest = SmallDictionaryLength;
            while (true)
            {
                var keyBegin = ptr;

                // read key
                Assert(ref ptr, ref end, '\"');
                var key = ReadObjectKey(ref ptr, ref end);

                if (dict.ContainsKey(key))
                {
                    throw CreateException(keyBegin, "duplicated key detected: " + key);
                }

                // read comma
                SkipWhitespaces(ref ptr, ref end);
                AssertAndReadNext(ref ptr, ':');

                // read value and add to dictionary
                dict.Add(key, ReadValue(ref ptr, ref end));
                if (--lest == 0)
                {
                    dict = ((ListDictionary<string, JsonValue>)dict).CreateDictionary();
                }

                // read close brace or comma
                SkipWhitespaces(ref ptr, ref end);

                if (IsEndOfJson(ref ptr, ref end))
                {
                    // not completed
                    throw CreateException(ptr, "object is not closed.");
                }

                // if end of array, next letter should be ']'.
                if (*ptr == '}')
                {
                    // end of array
                    ptr++;
                    break;
                }

                // otherwise, next letter should be ','.
                AssertAndReadNext(ref ptr, ',');

                // skip while next string
                SkipWhitespaces(ref ptr, ref end);
            }

            return new JsonObject(dict, true);
        }