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


C# Val类代码示例

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


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

示例1: Err

 /// <summary>
 /// This constructor is used by special subclasses which provide
 /// a transparent mapping between .NET and Fantom exception types.
 /// </summary>
 public Err(Val val, Exception actual)
 {
     this.val = val;
       val.m_err = this;
       this.m_actual = actual;
       this.m_msg = actual.Message;
 }
开发者ID:nomit007,项目名称:f4,代码行数:11,代码来源:Err.cs

示例2: Node_OrientTowards

    //public Node Node_GoAlongPoints(Val<Vector3>[] targ)
    //{
    //    return new LeafInvoke(
    //        () => this.Character.NavAlongPoints(targ),
    //        () => this.Character.NavStop());
    //}

    // TODO: No speed support yet! - AS 5/4/14
    ///// <summary>
    ///// Approaches a target with a certain speed
    ///// </summary>
    //public Node Node_GoTo(Val<Vector3> targ, Val<float> speed)
    //{
    //    this.Character.SetSpeed(speed.Value);
    //    return new LeafInvoke(
    //        () => this.Character.NavGoTo(targ),
    //        () => this.Character.NavStop());
    //}

    /// <summary>
    /// Orient towards a target position
    /// </summary>
    /// <param name="targ"></param>
    /// <returns></returns>
    public Node Node_OrientTowards(Val<Vector3> targ)
    {
        return new LeafInvoke(
            () => this.Character.NavTurn(targ),
            () => this.Character.NavOrientBehavior(
                OrientationBehavior.LookForward));
    }
开发者ID:fgeraci,项目名称:CS195-Core,代码行数:31,代码来源:BehaviorMecanim.cs

示例3: ApproachAndOrientTarget

 protected Node ApproachAndOrientTarget(GameObject a, Val<Vector3> target, Val<float> distance)
 {
     Quaternion rotation = Quaternion.LookRotation(target.Value - a.transform.position);
     Vector3 targetLoc = target.Value - (rotation * new Vector3(0, 0, distance.Value));
     Val<Vector3> targetAdjusted = Val.V(() => targetLoc);
     return new Sequence(mec(a).Node_GoTo(targetAdjusted), mec(a).Node_OrientTowards(target));
 }
开发者ID:CG-F15-20-Rutgers,项目名称:UnityProjects,代码行数:7,代码来源:BehaviorTree2.cs

示例4: Node_Affordance

 public static Node Node_Affordance(
     this SmartObject o,
     Behavior b,
     Val<string> affordance)
 {
     return new LeafInvoke(
         () => o.Affordance(b.Character, affordance.Value));
 }
开发者ID:alerdenisov,项目名称:ADAPT,代码行数:8,代码来源:SmartObjectNodes.cs

示例5: conversationTree

 //
 //Root Node
 //
 protected Node conversationTree(Val<Vector3> P1Pos, Val<Vector3> P2Pos, Val<Vector3> P3Pos)
 {
     return new Sequence(OrientAndWave(P1Pos, P2Pos), WalkAndTalk(P1Pos, P2Pos),
         new DecoratorForceStatus(RunStatus.Success,
             new SequenceParallel(DeltreseWalkTo(DeltreseGoTo), ThatDamnDeltrese(P3Pos))),
             CallDeltrese(P1Pos, P2Pos, P3Pos)
         );
 }
开发者ID:CG-F15-26-Rutgers,项目名称:Unity,代码行数:11,代码来源:NewConvo.cs

示例6: throwingBall

 public RunStatus throwingBall(Val<Vector3> direction)
 {
     transform.parent = null;
     rb.velocity = direction.Value * 2f;
     rb.isKinematic = false;
     rb.useGravity = true;
     return RunStatus.Success;
 }
开发者ID:CG-F15-23-Rutgers,项目名称:UnityProjects,代码行数:8,代码来源:Ball.cs

示例7: throwball

    public RunStatus throwball(Val<Vector3> direction)
    {
        transform.parent = null;
        ball.isKinematic = false;
        ball.useGravity = true;
        ball.velocity = -direction.Value * 2.1f;

        return RunStatus.Success;
    }
开发者ID:CG-F15-26-Rutgers,项目名称:B2,代码行数:9,代码来源:BasketBall.cs

示例8: TurnOnLight

 protected Node TurnOnLight(Val<FullBodyBipedEffector> effector, Val<InteractionObject> obj, Transform lightSwitch)
 {
     Val<Vector3> position = Val.V(() => lightSwitch.position);
     return new Sequence(
         participant.GetComponent<BehaviorMecanim>().Node_GoToUpToRadius(position, 2.0f),
         participant.GetComponent<BehaviorMecanim>().Node_StartInteraction(effector, obj));
        // participant.GetComponent<BehaviorMecanim>().Node_WaitForFinish(effector),
        // participant.GetComponent<BehaviorMecanim>().Node_StopInteraction(effector));
 }
开发者ID:shilon,项目名称:UnityProjects,代码行数:9,代码来源:IdleBehavior.cs

示例9: LeafAffordance

 public LeafAffordance(
     Val<string> affordance,
     Val<SmartObject> user, 
     Val<SmartObject> obj)
 {
     this.affordance = affordance.Value;
     this.user = user.Value;
     this.obj = obj.Value;
 }
开发者ID:fgeraci,项目名称:CS195-Core,代码行数:9,代码来源:LeafAffordance.cs

示例10: ApproachAndOrient

 protected Node ApproachAndOrient(
     Val<Vector3> WandererPos, Val<Vector3> FriendPos)
 {
     return new Sequence(
         // Approach at distance 1.0f
         Friend.Node_GoTo(WandererPos, 1.0f),
         new SequenceParallel(
             Friend.Node_OrientTowards(WandererPos),
             Wanderer.Node_OrientTowards(FriendPos)));
 }
开发者ID:alerdenisov,项目名称:ADAPT,代码行数:10,代码来源:TutorialInvokeEventCompleted.cs

示例11: addSlider

 public void addSlider(string name, Val val)
 {
     GameObject sliderGo = Instantiate(Resources.Load("GUISliderPrefab") as GameObject) as GameObject;
     FuzzyGUISlider tmpSlider = sliderGo.GetComponentInChildren<FuzzyGUISlider>();
     sliderGo.transform.parent = transform;
     tmpSlider.setTarget(Vector3.right*200 + (-10)*nSlider*Vector3.up );
     //tmpSlider.setReference(mf);
     tmpSlider.setReference(mf,val);
     nSlider++;
 }
开发者ID:CatmanIta,项目名称:FuzzyTactics,代码行数:10,代码来源:FuzzyGUIMembershipFunction.cs

示例12: EyeContact

    public Node EyeContact(Val<Vector3> WanderPos, Val<Vector3> FriendPos)
    {
        Vector3 height = new Vector3(0.0f, 1.85f, 0.0f);
        Val<Vector3> WanderHead = Val.V(() => WanderPos.Value + height);
        Val<Vector3> Friendhead = Val.V(() => FriendPos.Value + height);

        return new SequenceParallel(
            numberOfParticipants[0].GetComponent<BehaviorMecanim>().Node_HeadLook(Friendhead),
            numberOfParticipants[1].GetComponent<BehaviorMecanim>().Node_HeadLook(WanderHead));
    }
开发者ID:shilon,项目名称:UnityProjects,代码行数:10,代码来源:MyBehaviorTreeWorking.cs

示例13: MappedTranslationFunc

 public static Func<string, string> MappedTranslationFunc(Val val)
 {
     switch (val) {
     case Val.Expiration:
         return x => Pastebin.Expiration.ReverseMap(x).ToString();
     case Val.Visibility:
         return x => Pastebin.Visibility.ReverseMap(x).ToString();
     default:
         return x => x;
     }
 }
开发者ID:Visic,项目名称:Pastebin,代码行数:11,代码来源:ListField.cs

示例14: BodyAnimationButton

 public virtual RunStatus BodyAnimationButton(Val<string> gestureName, Val<bool> isActive)
 {
     if (button_interact)
     {
         this.Body.BodyAnimation(gestureName.Value, isActive.Value);
         button_interact = false;
         return RunStatus.Success;
     }
     this.Body.BodyAnimation(gestureName.Value, false);
     return RunStatus.Success;
 }
开发者ID:CG-F15-2-Rutgers,项目名称:UnityProjects,代码行数:11,代码来源:CharacterMecanim.cs

示例15: CallDeltrese

 protected Node CallDeltrese(Val<Vector3> P1Pos, Val<Vector3> P2Pos, Val<Vector3> P3Pos)
 {
     return new Sequence(
         person2.GetComponent<BehaviorMecanim>().Node_OrientTowards(P3Pos),
         person2.GetComponent<BehaviorMecanim>().ST_PlayHandGesture("Point", 3000),
         deltrese.GetComponent<BehaviorMecanim>().Node_OrientTowards(P1Pos),
         deltrese.GetComponent<BehaviorMecanim>().ST_PlayHandGesture("Wave", 3000),
         deltrese.GetComponent<BehaviorMecanim>().Node_GoToUpToRadius(P2Pos, 3.0f),
         Argue(P1Pos, P2Pos, P3Pos)
         );
 }
开发者ID:CG-F15-26-Rutgers,项目名称:Unity,代码行数:11,代码来源:NewConvo.cs


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