123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- using UnityEngine;
- namespace UnityTest
- {
- public static class Icons
- {
- public static readonly Texture2D failImg;
- public static readonly Texture2D ignoreImg;
- public static readonly Texture2D runImg;
- public static readonly Texture2D runFailedImg;
- public static readonly Texture2D runAllImg;
- public static readonly Texture2D successImg;
- public static readonly Texture2D unknownImg;
- public static readonly Texture2D inconclusiveImg;
- public static readonly Texture2D stopwatchImg;
- public static readonly Texture2D plusImg;
- public static readonly Texture2D gearImg;
- public static readonly Texture2D greenredyellowImg1;
- public static readonly Texture2D greenredyellowImg2;
- public static readonly Texture2D greenredyellowImg3;
- public static readonly Texture2D greenredyellowImg4;
- public static readonly GUIContent guiUnknownImg;
- public static readonly GUIContent guiInconclusiveImg;
- public static readonly GUIContent guiIgnoreImg;
- public static readonly GUIContent guiSuccessImg;
- public static readonly GUIContent guiFailImg;
- public static readonly GUIContent guiGreenredyellowImg1;
- public static readonly GUIContent guiGreenredyellowImg2;
- public static readonly GUIContent guiGreenredyellowImg3;
- public static readonly GUIContent guiGreenredyellowImg4;
- const string ICONS_PATH = "Assets/Core/UnityTestTools/Common/icons/";
-
- static Icons ()
- {
- failImg = LoadIcon("red.png");
- ignoreImg = LoadIcon("grey.png");
- runImg = LoadIcon("play.png");
- runFailedImg = LoadIcon("playred.png");
- runAllImg = LoadIcon("playall.png");
- successImg = LoadIcon("green.png");
- unknownImg = LoadIcon("white.png");
- inconclusiveImg = LoadIcon("yellow.png");
- stopwatchImg = LoadIcon("stopwatch.png");
- plusImg = LoadIcon("plus.png");
- gearImg = LoadIcon("gear.png");
- greenredyellowImg1 = LoadIcon("green-red-yellow1.png");
- greenredyellowImg2 = LoadIcon("green-red-yellow2.png");
- greenredyellowImg3 = LoadIcon("green-red-yellow3.png");
- greenredyellowImg4 = LoadIcon("green-red-yellow4.png");
- guiUnknownImg = new GUIContent (unknownImg);
- guiInconclusiveImg = new GUIContent (inconclusiveImg);
- guiIgnoreImg = new GUIContent (ignoreImg);
- guiSuccessImg = new GUIContent (successImg);
- guiFailImg = new GUIContent (failImg);
- guiGreenredyellowImg1 = new GUIContent (greenredyellowImg1);
- guiGreenredyellowImg2 = new GUIContent (greenredyellowImg2);
- guiGreenredyellowImg3 = new GUIContent (greenredyellowImg3);
- guiGreenredyellowImg4 = new GUIContent (greenredyellowImg4);
- }
- static Texture2D LoadIcon(string iconName)
- {
- return null;// (Texture2D)UnityEditor.AssetDatabase.LoadAssetAtPath(ICONS_PATH + iconName, typeof(Texture2D));
- }
- public static GUIContent GetSpinningIcon ()
- {
- var frame = ((int) (Time.realtimeSinceStartup * 7)) % 4;
- switch (frame)
- {
- case 0:
- return guiGreenredyellowImg1;
- case 1:
- return guiGreenredyellowImg2;
- case 2:
- return guiGreenredyellowImg3;
- case 3:
- return guiGreenredyellowImg4;
- default:
- return guiGreenredyellowImg1;
- }
- }
- }
- }
|