当前位置: 首页>>代码示例>>C#>>正文


C# System.Func类代码示例

本文整理汇总了C#中System.Func的典型用法代码示例。如果您正苦于以下问题:C# System.Func类的具体用法?C# System.Func怎么用?C# System.Func使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


System.Func类属于命名空间,在下文中一共展示了System.Func类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CustomFunction

 public CustomFunction(string name, System.Func<double,double> func, bool enableSymbolicationTimeEvaluation)
 {
     this.func1d = func;
     this.enableSymbolicationTimeEvaluation = enableSymbolicationTimeEvaluation;
     this.paramCount = 1;
     this.name = name;
 }
开发者ID:akuukka,项目名称:ExpressionSolver,代码行数:7,代码来源:CustomFunction.cs

示例2: TimedTick

 /// Repeatable perform an action each frame for x amount of seconds until a condition is met.
 /// Takes the action to perform, the condition for completion and the maximum amount of time each frame
 /// to spend performing the action
 public TimedTick( System.Action action, System.Func<bool> stopCondition, float time = .1f )
 {
     start_ = Time.realtimeSinceStartup;
     action_ = action;
     stopCondition_ = stopCondition;
     maxTime_ = time;
 }
开发者ID:sarkahn,项目名称:unityroguetest,代码行数:10,代码来源:TimedTick.cs

示例3: AssignedTask

 public AssignedTask(PartyMember member, AssignedTaskTypes type, System.Func<bool> check, System.Action mainAction)
 {
     taskType=type;
     preconditionCheck=check;
     actionToPerform=mainAction;
     performingMember=member;
     startTaskAction=null;
     endTaskAction=null;
 }
开发者ID:bitterpark,项目名称:unassumingrepo,代码行数:9,代码来源:PartyManager.cs

示例4: Start

 void Start()
 {
     var lProperty = component.GetType().GetProperty(memberName);
     if (lProperty.PropertyType == typeof(string))
         getTextFunc = (System.Func<string>)System.Delegate.CreateDelegate(
              typeof(System.Func<string>), component, lProperty.GetGetMethod());
     else
         getTextFunc = () => lProperty.GetValue(component, null).ToString();
 }
开发者ID:Seraphli,项目名称:TheInsectersWar,代码行数:9,代码来源:zzGUIModifierLabel.cs

示例5: SetParams

        public void SetParams(float radius, System.Func<GameObject, bool> checkTrigger, System.Action callBack)
        {
            _checkTrigger = checkTrigger;
            _callBack = callBack;
            _radius = radius;

            SphereCollider co = gameObject.AddComponent<SphereCollider>();
            co.radius = radius;
            co.isTrigger = true;
        }
开发者ID:CWHISME,项目名称:CryStoryEditor,代码行数:10,代码来源:TriggerObject.cs

示例6: GUIButton

        public GUIButton(GameObject obj, System.Func<bool> enableChecker)
        {
            m_button = obj.GetComponent<Button>();
            m_lable = new GUILable(obj.transform.Find("Text").gameObject);
            m_enableChecker = enableChecker;

            Transform iconTrans = obj.transform.Find("Icon");
            if (iconTrans != null)
            {
                RawImage rawImage = iconTrans.GetComponent<RawImage>();
                m_icon = new GUIImageStatic(iconTrans.gameObject, rawImage.texture);
            }
        }
开发者ID:yakolla,项目名称:MarineVsAlien,代码行数:13,代码来源:YGUISystem.cs

示例7: Construct

		public void Construct(params object[] args)
		{
			#if DEBUG
			Debug.Assert(!args.IsNullOrEmpty());
			#endif // DEBUG

			bkgProc = args[0] as System.Func<object, object>;
			param = 1 < args.Length ? args[1] : null;
			result = null;

			#if DEBUG
			Debug.Assert(null != bkgProc);
			#endif // DEBUG
		}
开发者ID:vivence,项目名称:GhostStudio,代码行数:14,代码来源:AsyncTask.cs

示例8: Start

    ///////////////////////////////////////////////////////////////////////////////
    // functions
    ///////////////////////////////////////////////////////////////////////////////
    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------
    public void Start( bool _rewind = false, float _duration = -1.0f )
    {
        duration = (_duration <= 0.0f) ? data.length : _duration;

        callback = data.useEaseCurve ? exEase.GetEaseFunc(data.easeCurveType) : data.animationCurve.Evaluate;
        lastTime = Time.time;
        if ( _rewind || started == false ) {
            if ( speed < 0.0f )
                time = duration;
            else
                time = 0.0f;
        }
        timeup = false;
        started = true;
    }
开发者ID:exdev,项目名称:ex-unity-old-deprecated,代码行数:21,代码来源:exTimebasedCurveInfo.cs

示例9: ValidationDelegateTaken

 /// <summary>
 /// 初始化 HtmlDocumentValidation 的新实例。
 /// </summary>
 /// <param name="name">此验证的名称信息(用于向用户界面显示)。</param>
 /// <param name="documentValidation">一个委托,用于验证 HtmlDocument 是否符合规则。</param>
 /// <param name="errorMessage">验证不符合规则时的提示信息。</param>
 public ValidationDelegateTaken(String name, ValidationType validationType, System.Func<HtmlAgilityPack.HtmlDocument, bool> documentValidation, String errorMessage)
 {
     this.documentValidation = documentValidation;
     this.errorMessage = errorMessage;
     this.Name = name;
     this.Type = validationType;
     if (documentValidation == null)
     {
         throw new ArgumentNullException("documentValidation");
     }
     if (errorMessage == null)
     {
         throw new ArgumentNullException("errorMessage");
     }
 }
开发者ID:darklx,项目名称:Staticize,代码行数:21,代码来源:ValidationDelegateTaken.cs

示例10: Generate

    public static List<Room> Generate(int LevelWidth, int LevelHeight, int MinRoomWidth, int MinRoomHeight, int MaxRoomWidth, int MaxRoomHeight, Object Tile, Object Wall)
    {
        //Make sure that the width and height of the tile array is the size of the level
        tilePlacements = new int[LevelWidth, LevelHeight];
        pathFinder = new PathFinder(tilePlacements);
        pathFinder.pathDiagonal = false; //Stop diagonal path finding
        getPathingValueFunc = CalculatePathingValue;
        rooms = new List<Room>();

        for (int y = 0; y < LevelHeight; y++)
        {
            for (int x = 0; x < LevelWidth; x++)
            {
                genRoom(x, y, MinRoomWidth, MinRoomHeight, MaxRoomWidth, MaxRoomHeight, LevelWidth, LevelHeight);
            }
        }
        MakeCorridors();
        placeInLevel(Tile,Wall);
        return rooms;
    }
开发者ID:spiderdj,项目名称:Procedual,代码行数:20,代码来源:Generator.cs

示例11: DeploymentManagerFactory

 public DeploymentManagerFactory(System.Func<IDeploymentManager> factory)
 {
     _factory = factory;
 }
开发者ID:remcoros,项目名称:kudu,代码行数:4,代码来源:NinjectServices.cs

示例12: Initialize

        // Public Methods

        public virtual void Initialize(int id, System.Func<int, bool> isFocusedCallback) {
            if(_initialized) {
                Debug.LogError("Window is already initialized!");
                return;
            }
            _id = id;
            _isFocusedCallback = isFocusedCallback;
            _timer = new Timer();
            _contentText = new List<Text>();
            _canvasGroup = GetComponent<CanvasGroup>();
            _initialized = true;
        }
开发者ID:nkornek,项目名称:RocketShips,代码行数:14,代码来源:Window.cs

示例13: FPS

 public FPS( System.Func<float> _deltaTime )
 {
     DeltaTime = _deltaTime;
 }
开发者ID:KzoNag,项目名称:project_k,代码行数:4,代码来源:FPS.cs

示例14: OnGUI

 public bool OnGUI(Rect position, SerializedProperty property, GUIContent label, bool includeChildren)
 {
     var drawer = this.GetDrawer(property);
     if(drawer != null)
     {
         EditorGUI.BeginChangeCheck();
         drawer.OnGUI(position, property, label);
         return EditorGUI.EndChangeCheck();
     }
     else
     {
         if (_imp_DefaultPropertyField == null) _imp_DefaultPropertyField = _editorGuiAccessWrapper.GetStaticMethod("DefaultPropertyField", typeof(System.Func<Rect, SerializedProperty, GUIContent, bool>)) as System.Func<Rect, SerializedProperty, GUIContent, bool>;
         return _imp_DefaultPropertyField(position, property, label);
     }
 }
开发者ID:yuanchunfa,项目名称:spacepuppy-unity-framework,代码行数:15,代码来源:StandardPropertyHandler.cs

示例15: SetDeathCallback

	public void SetDeathCallback( System.Func<Transform,System.Void> deathCallback ){
		m_DeathCallback = deathCallback;
	}
开发者ID:Waltari10,项目名称:LifeRitual,代码行数:3,代码来源:PickupProperties.cs


注:本文中的System.Func类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。