33 lines
667 B
C#
33 lines
667 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
|
|
namespace BITKit
|
|
{
|
|
public interface IConfigProvider
|
|
{
|
|
string GetConfig(params object[] args);
|
|
void Configure(params object[] args);
|
|
}
|
|
|
|
[Serializable]
|
|
public sealed class ConfigProviders:IConfigProvider
|
|
{
|
|
[SerializeReference,SubclassSelector] private IConfigProvider[] providers;
|
|
public string GetConfig(params object[] args)
|
|
{
|
|
return string.Join("\n",providers.Select(x=>x.GetConfig(args)));
|
|
}
|
|
|
|
public void Configure(params object[] args)
|
|
{
|
|
foreach (var provider in providers)
|
|
{
|
|
provider.Configure(args);
|
|
}
|
|
}
|
|
}
|
|
}
|