Exemplo n.º 1
0
        public static void FavoriteScene(SceneData sceneAsset)
        {
            if (IsSceneFavorite(sceneAsset) == true)
            {
                Debug.LogWarningFormat("Scene {0} is already favorite. Can't favorite it again.", sceneAsset.Name);
                return;
            }

            FavoritesScenesPath.Add(sceneAsset.Path);
        }
 private void DrawScene(SceneData sceneAsset)
 {
     GUILayout.BeginHorizontal();
     {
         DrawFavoriteButton(sceneAsset);
         GUILayout.Label(sceneAsset.Name);
         DrawOpenButtons(sceneAsset);
     }
     GUILayout.EndHorizontal();
 }
Exemplo n.º 3
0
 public static void ToggleFavorite(SceneData sceneAsset)
 {
     if (IsSceneFavorite(sceneAsset) == true)
     {
         UnfavoriteScene(sceneAsset);
     }
     else
     {
         FavoriteScene(sceneAsset);
     }
 }
        private void DrawFavoriteButton(SceneData sceneAsset)
        {
            Texture buttonTexture = Favorites.IsSceneFavorite(sceneAsset) ? SceneBrowserResources.GetFullStarTexture() : SceneBrowserResources.GetEmptyStarTexture();


            bool clickOnFavoriteButton = GUILayout.Button(new GUIContent(buttonTexture), GUILayout.Height(EditorGUIUtility.singleLineHeight), GUILayout.Width(EditorGUIUtility.singleLineHeight + 15));

            if (clickOnFavoriteButton == true)
            {
                Favorites.ToggleFavorite(sceneAsset);
            }
        }
Exemplo n.º 5
0
 public static bool IsSceneFavorite(SceneData sceneAsset)
 {
     return(FavoritesScenesPath.Contains(sceneAsset.Path));
 }
Exemplo n.º 6
0
 public static void UnfavoriteScene(SceneData sceneAsset)
 {
     FavoritesScenesPath.Remove(sceneAsset.Path);
 }