Пример #1
0
        public static void SetDirty(bool dirty)
        {
            GameObject levelObject = GameObjectExtensions.FindWithSubstring(LOADED_LEVEL_NAME + LOADED_LEVEL_DIRTY_DELIMITER);

            if (levelObject != null)
            {
                if (!dirty)
                {
                    levelObject.name = string.Format("{0}|{1}", LOADED_LEVEL_NAME, LoadedLevelPath);
                    return;
                }
            }

            else
            {
                levelObject = GameObjectExtensions.FindWithSubstring(LOADED_LEVEL_NAME);
                if (levelObject != null)
                {
                    if (dirty)
                    {
                        levelObject.name = string.Format("{0}{1}|{2}",
                                                         LOADED_LEVEL_NAME, LOADED_LEVEL_DIRTY_DELIMITER, LoadedLevelPath);
                        return;
                    }
                }

                else
                {
                    Debug.LogError("Failed to find a loaded level object!");
                }
            }
        }