Skip to content

Commit

Permalink
add previews
Browse files Browse the repository at this point in the history
  • Loading branch information
SLywnow committed Jul 13, 2022
1 parent ca28f2d commit a7048d3
Show file tree
Hide file tree
Showing 6 changed files with 550 additions and 26 deletions.
46 changes: 46 additions & 0 deletions Assets/SLywnowAssets/KopiaUnity/Editor/KPSL_Editor_ImgPrev.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using SLywnow;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class KPSL_Editor_ImgPrev : EditorWindow
{

private void OnEnable()
{
OnFocus();
}

Texture2D loaded;

private void OnFocus()
{
string path = Application.dataPath.Replace("/Assets", "/Temp/KopiaCheck/");

loaded = null;
if (FilesSet.CheckFile(path + "preview.png"))
{
loaded = FilesSet.LoadSprite(path + "preview.png", false).texture;
}
}

Vector2 pos;

private void OnGUI()
{
if (loaded !=null)
{
pos = GUILayout.BeginScrollView(pos);

GUILayout.Label(new GUIContent(loaded));

GUILayout.EndScrollView();
}
else
{
GUILayout.Label("Image not found! Try again!");
}
}

}
11 changes: 11 additions & 0 deletions Assets/SLywnowAssets/KopiaUnity/Editor/KPSL_Editor_ImgPrev.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a7048d3

Please sign in to comment.