30 lines
1.0 KiB
C#
30 lines
1.0 KiB
C#
// <auto-generated> File: CookwareDataAsset.cs
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
|
|
namespace DDD
|
|
{
|
|
[CreateAssetMenu(fileName = "InteractionDataAsset", menuName = "GoogleSheet/InteractionDataAsset")]
|
|
public class InteractionDataAsset : DataAsset<InteractionDataEntry>
|
|
{
|
|
public bool TryGetValueByTypeName(string interactionTypeName, string subsystemTypeName, out InteractionDataEntry interactionDataEntry)
|
|
{
|
|
var targetString = string.Empty;
|
|
if (string.IsNullOrWhiteSpace(subsystemTypeName))
|
|
{
|
|
targetString = interactionTypeName;
|
|
}
|
|
else
|
|
{
|
|
targetString = $"{interactionTypeName}.{subsystemTypeName}";
|
|
}
|
|
interactionDataEntry = _datas.FirstOrDefault(entry =>
|
|
string.Equals(entry.UnparsedInteractionType, targetString, StringComparison.Ordinal));
|
|
|
|
return interactionDataEntry != null;
|
|
}
|
|
}
|
|
} |