當前位置: 首頁>>代碼示例>>C#>>正文


C# LogicVariable.Unify方法代碼示例

本文整理匯總了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;
            }
        }
開發者ID:rzubek,項目名稱:MKULTRA,代碼行數:11,代碼來源:PrologPrimitives.cs

示例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;
            }
        }
開發者ID:rzubek,項目名稱:MKULTRA,代碼行數:13,代碼來源:PrologPrimitives.cs

示例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;
            }
        }
開發者ID:rzubek,項目名稱:MKULTRA,代碼行數:11,代碼來源:PrologPrimitives.cs

示例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;
 }
開發者ID:rzubek,項目名稱:UnityProlog,代碼行數:10,代碼來源:PrologPrimitives.cs


注:本文中的Prolog.LogicVariable.Unify方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。