Unity SDK for Solana Development banner
solanabr solanabr

Unity SDK for Solana Development

Development community intermediate

Description

Progressive skill for Unity game development with Solana blockchain integration using Solana.Unity-SDK. ---

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

Repository README

This is the README for solanabr/solana-claude, shared by 5 entries in this directory. It describes the repository, not this entry specifically.

Unity SDK for Solana Development

Progressive skill for Unity game development with Solana blockchain integration using Solana.Unity-SDK.


C# Coding Guidelines

Basic Principles

  • KISS: Keep It Simple, Stupid
  • SOLID: Especially Single Responsibility, Interface Segregation, and Dependency Inversion
  • Read .editorconfig before writing code

Project Structure

Assets/
├── _Game/                          # Game-specific code
│   ├── Scenes/                     # Scene files (.unity)
│   ├── Scripts/
│   │   ├── Runtime/                # Runtime code
│   │   │   ├── _Game.asmdef        # Main assembly definition
│   │   │   ├── Core/               # Managers, state
│   │   │   ├── Blockchain/         # Solana integration
│   │   │   ├── UI/                 # UI components
│   │   │   └── Gameplay/           # Game mechanics
│   │   └── Editor/                 # Editor extensions
│   │       └── _Game.Editor.asmdef
│   └── Tests/
│       ├── EditMode/               # Edit Mode tests
│       │   ├── _Game.Tests.asmdef
│       │   └── TestDoubles/        # Stubs, Spies, Fakes
│       └── PlayMode/               # Play Mode tests
│           ├── _Game.PlayMode.Tests.asmdef
│           └── TestDoubles/
├── Packages/                       # UPM packages
└── Plugins/                        # Native plugins

Naming Conventions

Element Convention Example
Public fields PascalCase MaxHealth, PlayerName
Private fields _camelCase _walletService, _isConnected
Static fields s_camelCase s_instance, s_defaultConfig
Booleans Verb prefix IsConnected, HasPendingTx, CanSign
Properties PascalCase WalletAddress, Balance
Methods Verb + PascalCase GetBalance(), ConnectWallet()
Events Verb phrase OnConnected, OpeningDoor, DoorOpened
Interfaces IPascalCase IWalletService, IRpcClient

Serialized Properties Pattern

// Use field: target for Unity attributes on auto-properties
[field: SerializeField]
public int Health { get; private set; } = 100;

[field: SerializeField]
[field: Range(0, 100)]
[field: Tooltip("Maximum health points")]
public int MaxHealth { get; private set; } = 100;

Early Return Pattern

// Good - early return
public async Task ProcessTransaction(Transaction tx)
{
    if (tx == null)
        return false;

    if (!IsConnected)
        return false;

    var result = await SendTransaction(tx);
    return result.IsSuccess;
}

// Avoid - nested conditions
public async Task ProcessTransaction(Transaction tx)
{
    if (tx != null)
    {
        if (IsConnected)
        {
            var result = await SendTransaction(tx);
            return result.IsSuccess;
        }
    }
    return false;
}

Events with System.Action

// Define events
public event Action OnDisconnected;
public event Action OnConnected;
public e