Beispiel #1
0
 private void Update()
 {
     parent.Update();
     if (hasMouseover && mouseActive)
     {
         mouseTimeActive += Time.unscaledDeltaTime;
         if (mouseTimeActive >= MOUSE_OVER_DISPLAY_TRESHOLD)
         {
             MouseOver.Activate(parent.Text.AltText);
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// Loads in all the graphics files in the path (see also SetPath())
 /// </summary>
 public static void LoadGraphics()
 {
     string[] allPaths = Directory.GetFiles(path, "*.png", SearchOption.AllDirectories);
     dict = new Dictionary <string, Texture2D>();
     for (int i = 0; i < allPaths.Length; i++)
     {
         byte[]    data = File.ReadAllBytes(allPaths[i]);
         Texture2D t    = new Texture2D(32, 32, TextureFormat.ARGB32, false)
         {
             name = Path.GetFileNameWithoutExtension(allPaths[i])
         };
         t.LoadImage(data);
         dict.Add(Path.GetFileNameWithoutExtension(allPaths[i]), t);
     }
     Debug.Log("Loaded " + allPaths.Length + " graphics.");
     MouseOver.Create();
 }
Beispiel #3
0
 public void OnPointerExit(PointerEventData eventData)
 {
     mouseActive     = false;
     mouseTimeActive = 0;
     MouseOver.Deactivate();
 }