Example #1
0
 public void SetCursor(CursorManager.TYPE type)
 {
     if (this.m_WantedType != type)
     {
         this.m_WantedType = type;
     }
 }
Example #2
0
 public void ShowCursor(Vector2 pos, CursorManager.TYPE type)
 {
     this.ShowCursor(true, false);
     this.UpdateCursorVisibility();
     this.SetCursor(type);
     this.SetCursorPos(pos);
 }
Example #3
0
 public void SetCursor(CursorManager.TYPE type)
 {
     if (this.m_Type == type)
     {
         return;
     }
     this.m_Type = type;
     Cursor.SetCursor(this.m_TexturesMap[this.m_Type], Vector2.zero, this.m_Mode);
 }
Example #4
0
    private void LoadTextures()
    {
        TextAsset textAsset = Resources.Load("Scripts/Cursors") as TextAsset;

        DebugUtils.Assert(textAsset, "ERROR - Missing Cursors script.", true, DebugUtils.AssertType.Info);
        TextAssetParser textAssetParser = new TextAssetParser(textAsset);

        for (int i = 0; i < textAssetParser.GetKeysCount(); i++)
        {
            Key key = textAssetParser.GetKey(i);
            if (key.GetName() == "Cursor")
            {
                CursorManager.TYPE key2      = (CursorManager.TYPE)Enum.Parse(typeof(CursorManager.TYPE), key.GetVariable(0).SValue);
                Texture2D          texture2D = Resources.Load <Texture2D>("Cursors/" + key.GetVariable(1).SValue);
                DebugUtils.Assert(texture2D != null, "ERROR - Missing cursor texture. TYPE = " + key2.ToString(), true, DebugUtils.AssertType.Info);
                this.m_TexturesMap.Add(key2, texture2D);
            }
        }
        Resources.UnloadAsset(textAsset);
    }
Example #5
0
 public void ShowCursor(CursorManager.TYPE type)
 {
     this.ShowCursor(true, false);
     this.UpdateCursorVisibility();
     this.SetCursor(type);
 }