本文整理匯總了C#中Prolog.LogicVariable.Unify方法的典型用法代碼示例。如果您正苦於以下問題:C# LogicVariable.Unify方法的具體用法?C# LogicVariable.Unify怎麽用?C# LogicVariable.Unify使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Prolog.LogicVariable
的用法示例。
在下文中一共展示了LogicVariable.Unify方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: EnumerateIList
static IEnumerable<CutState> EnumerateIList(IList listArg, LogicVariable objectArg)
{
foreach (var e in listArg)
{
#pragma warning disable 414, 168, 219
// ReSharper disable once UnusedVariable
foreach (var ignore in objectArg.Unify(e))
#pragma warning restore 414, 168, 219
yield return CutState.Continue;
}
}
示例2: EnumerateGameObjectsAndComponents
private static IEnumerable<CutState> EnumerateGameObjectsAndComponents(LogicVariable v, LogicVariable gov, Type type)
{
foreach (var component in UnityEngine.Object.FindObjectsOfType(type))
{
#pragma warning disable 414, 168, 219
// ReSharper disable UnusedVariable
foreach (var ignore in v.Unify(component))
foreach (var ignore2 in gov.Unify(((Component)component).gameObject))
// ReSharper restore UnusedVariable
#pragma warning restore 414, 168, 219
yield return CutState.Continue;
}
}
示例3: EnumerateComponents
private static IEnumerable<CutState> EnumerateComponents(LogicVariable v, GameObject gameObject, Type type)
{
foreach (var c in gameObject.GetComponents(type))
{
#pragma warning disable 414, 168, 219
// ReSharper disable once UnusedVariable
foreach (var ignore in v.Unify(c))
#pragma warning restore 414, 168, 219
yield return CutState.Continue;
}
}
示例4: EnumerateChildren
private static IEnumerable<CutState> EnumerateChildren(LogicVariable child, GameObject parent)
{
var transform = parent.transform;
for (int i=0; i<transform.childCount; i++)
#pragma warning disable 414, 168, 219
// ReSharper disable once UnusedVariable
foreach (var ignore in child.Unify(transform.GetChild(i).gameObject))
#pragma warning restore 414, 168, 219
yield return CutState.Continue;
}