コード例 #1
0
ファイル: HexCursor.cs プロジェクト: ChrisAttwood/WitchWorld
 private void Awake()
 {
     instance             = this;
     SpriteRenderer       = GetComponent <SpriteRenderer>();
     SpriteRenderer.color = DefaultColour;
     CurrentColour        = DefaultColour;
 }
コード例 #2
0
ファイル: GameUI.cs プロジェクト: Aspekt1024/HexCraft
 public void SetUICursor(HexCursor type)
 {
     uiCursor = type;
     if (isCursorInUI)
     {
         SetCursor(type);
     }
 }
コード例 #3
0
ファイル: GameUI.cs プロジェクト: Aspekt1024/HexCraft
 public void SetGameCursor(HexCursor type)
 {
     gameCursor = type;
     if (isCursorInUI)
     {
         return;
     }
     SetCursor(type);
 }
コード例 #4
0
ファイル: GameUI.cs プロジェクト: Aspekt1024/HexCraft
        private void SetCursor(HexCursor type)
        {
            Cursor.visible = type != HexCursor.None;
            var center = new Vector2(16f, 16f);

            switch (type)
            {
            case HexCursor.Default:
                Cursor.SetCursor(defaultCursor, Vector2.zero, CursorMode.ForceSoftware);
                break;

            case HexCursor.Attack:
                Cursor.SetCursor(attackCursor, center, CursorMode.ForceSoftware);
                break;

            case HexCursor.Move:
                Cursor.SetCursor(moveCursor, center, CursorMode.ForceSoftware);
                break;

            case HexCursor.Invalid:
                Cursor.SetCursor(invalidCursor, center, CursorMode.ForceSoftware);
                break;
            }
        }
コード例 #5
0
 private void Awake()
 {
     Instance = this;
 }