• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Val类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: NavTurn

 /// <summary>
 /// Turns to face a desired target point
 /// </summary>
 public virtual RunStatus NavTurn(Val<Vector3> target)
 {
     this.Body.NavSetOrientationBehavior(OrientationBehavior.None);
     this.Body.NavSetDesiredOrientation(target.Value);
     if (this.Body.NavIsFacingDesired() == true)
     {
         this.Body.NavSetOrientationBehavior(
             OrientationBehavior.LookForward);
         return RunStatus.Success;
     }
     return RunStatus.Running;
 }
开发者ID:CG-F15-3-Rutgers,项目名称:UnityProjects,代码行数:15,代码来源:CharacterMecanim.cs


示例17: EyeContact

    /// <summary>
    /// This subtree will cause the two characters to look at each other's
    /// heads. It will run indefinitely until terminated, at which point
    /// the characters will stop gaze tracking
    /// </summary>
    protected Node EyeContact(
        Val<Vector3> WandererPos, Val<Vector3> FriendPos)
    {
        // Estimate the head position based on height
        Vector3 height = new Vector3(0.0f, 1.85f, 0.0f);

        Val<Vector3> WandererHead = Val.Value(() => WandererPos.Value + height);
        Val<Vector3> FriendHead = Val.Value(() => FriendPos.Value + height);

        return new SequenceParallel(
            Friend.Node_HeadLook(WandererHead),
            Wanderer.Node_HeadLook(FriendHead));
    }
开发者ID:alerdenisov,项目名称:ADAPT,代码行数:18,代码来源:TutorialInvokeEventCompleted.cs


示例18: BodyAnimationCriminal

 public virtual RunStatus BodyAnimationCriminal(Val<string> gestureName, Val<bool> isActive)
 {
     if (criminal_interact)
     {
         if(thisCharacter != COP)
         {
             Wait();
         }
         Debug.Log("Criminal action invoked!");
         this.Body.BodyAnimation(gestureName.Value, isActive.Value);
         criminal_interact = false;
         return RunStatus.Success;
     }
     this.Body.BodyAnimation(gestureName.Value, false);
     return RunStatus.Success;
 }
开发者ID:CG-F15-2-Rutgers,项目名称:UnityProjects,代码行数:16,代码来源:CharacterMecanim.cs


示例19: Coerce

    private static Node Coerce(
        SmartCharacter aggressor,
        SmartCharacter target,
        Val<float> distance)
    {
        return new Sequence(
            aggressor.Node_GoToUpToRadius(Val.V(() => target.transform.position), distance),
            aggressor.Node_OrientTowards(Val.V(() => target.transform.position)),
            aggressor.Node_Icon("stickup"),
            new SequenceParallel(
                aggressor.Behavior.ST_PlayHandGesture("pistolaim", 4000),
                new Sequence(
                    new LeafWait(2000),
                    target.Node_OrientTowards(Val.V(() => aggressor.transform.position)))));

    }
开发者ID:fgeraci,项目名称:CS195-Core,代码行数:16,代码来源:ReusableActions.cs


示例20: Argue

 protected Node Argue( Val<Vector3> P1Pos, Val<Vector3> P2Pos, Val<Vector3> P3Pos )
 {
     return new Sequence(
         new SequenceParallel(
             person1.GetComponent<BehaviorMecanim>().Node_OrientTowards(P3Pos) ,
             person2.GetComponent<BehaviorMecanim>().Node_OrientTowards(P3Pos) ,
             deltrese.GetComponent<BehaviorMecanim>().Node_OrientTowards(P1Pos)
             ),
             new SequenceShuffle(
                 deltrese.GetComponent<BehaviorMecanim>().Node_OrientTowards(P1Pos) , new LeafWait(1000) , deltrese.GetComponent<BehaviorMecanim>().Node_OrientTowards(P2Pos)
             ),
             person1.GetComponent<BehaviorMecanim>().ST_PlayHandGesture("dismissinggesture" , 3000),
             person2.GetComponent<BehaviorMecanim>().ST_PlayBodyGesture("shakingheadno" , 3000),
             deltrese.GetComponent<BehaviorMecanim>().ST_PlayBodyGesture("headnodyes" , 3000)
             );
 }
开发者ID:CG-F15-26-Rutgers,项目名称:Unity,代码行数:16,代码来源:NewConvo.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ValidatableArgument类代码示例发布时间:2022-05-24
下一篇:
C# VTableLayout类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap