Far Out SDK for Unity

Documentation and resources for the Far Out SDK

Configuration Guide

This guide provides detailed information about configuring the Far Out SDK for Unity to meet your specific project needs.

The NasaConfig ScriptableObject

The Far Out SDK uses a central configuration asset to manage all settings. This approach makes it easy to configure the SDK and share settings across your project.

Creating a Configuration Asset

  1. In Unity, right-click in your Project window
  2. Select Create > NASA > NasaConfig
  3. Name the asset (e.g., "NasaSDKConfig")

Configuration Settings

The NasaConfig asset includes the following settings:

API Key

Your NASA API key. Required for all API requests.

Cache Settings

Configure how the SDK caches data to reduce API calls and improve performance:

Network Settings

Logging

Usage with Multiple Scenes

We recommend creating a single NasaConfig asset and either:

Runtime Configuration

While most settings are configured via the ScriptableObject, you can also modify some settings at runtime:

// Get a reference to your config asset
NasaConfig config = Resources.Load("NasaSDKConfig");

// Modify settings
config.EnableDiskCache = true;
config.CacheExpirationHours = 24;

// Create client with updated config
NasaClient client = new NasaClient(config);

Advanced: Configuration Provider

For advanced use cases, you can implement the INasaConfigProvider interface to supply configuration dynamically:

public class MyConfigProvider : MonoBehaviour, INasaConfigProvider
{
    private NasaConfig _dynamicConfig;
    
    public NasaConfig GetConfig()
    {
        // Create or modify config based on runtime conditions
        if (_dynamicConfig == null)
        {
            _dynamicConfig = ScriptableObject.CreateInstance();
            _dynamicConfig.ApiKey = PlayerPrefs.GetString("NasaApiKey");
            // Set other properties
        }
        
        return _dynamicConfig;
    }
}

Then use your provider with the client:

var provider = GetComponent();
var client = new NasaClient(provider);
Back to Top