本文整理汇总了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;
}
示例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));
}
示例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));
}
示例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));
}
示例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)
);
}
示例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;
}
示例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;
}
示例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));
}
示例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;
}
示例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)));
}
示例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++;
}
示例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));
}
示例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;
}
}
示例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;
}
示例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)
);
}