本文整理汇总了C#中ActionState类的典型用法代码示例。如果您正苦于以下问题:C# ActionState类的具体用法?C# ActionState怎么用?C# ActionState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActionState类属于命名空间,在下文中一共展示了ActionState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Press
public void Press()
{
if (state != ActionState.WaitingForReleased) {
state = ActionState.Pressed;
amount++;
}
}
示例2: Character
public Character(WorldMap worldMap, Vector2 coordinates)
{
mCoordinates = coordinates;
mState = ActionState.Idle;
mDirection = FacingDirection.Down;
mWorldMap = worldMap;
}
示例3: ActionStateRuleAttribute
public ActionStateRuleAttribute(string id, string actionId, Nesting targetViewNesting, string normalCriteria,
string emptyCriteria, ViewType viewType, string module, ActionState actionState,
string viewId)
: base(id, targetViewNesting, normalCriteria, emptyCriteria, viewType, module, viewId) {
this.actionId = actionId;
ActionState = actionState;
}
示例4: Collect
public bool Collect()
{
GetComponent<NPCFidget>().StopWalking();
foundObject = false;
leftHand = findLeftHandRecursive(transform);
rightHand = findRightHandRecursive(transform);
if(leftHand != null && rightHand != null)
{
armsUp = true;
if(objToCollect == null)
currentState = ActionState.Find;
objToCollect.transform.rotation = transform.rotation;
objToCollect.transform.position = transform.position + transform.forward*2;
objToCollect.transform.position = new Vector3(objToCollect.transform.position.x, objToCollect.transform.position.y+1, objToCollect.transform.position.z);
objToCollect.transform.parent = transform;
if(objToCollect.GetComponent("Evolvable") != null)
{
(objToCollect.GetComponent("Evolvable") as Evolvable).enabled = false;
}
if(objToCollect.GetComponent<PickUpableItem>() != null)
{
objToCollect.GetComponent<PickUpableItem>().enabled = false;
}
return true;
}
return false;
}
示例5: update
public void update()
{
if (actionState == ActionState.Idle)
{
if (Constants.bRandom.Next() % 12 == 0)
actionState = ActionState.Playing;
else
return;
}
else
{
// Random idle
if (Constants.bRandom.Next() % 50 == 0)
{
curA = curB = curUp = curDown = curLeft = curRight = false;
actionState = ActionState.Idle;
return;
}
}
bool prevA = curA;
bool prevB = curB;
bool prevUp = curUp;
bool prevDown = curDown;
bool prevLeft = curLeft;
bool prevRight = curRight;
curA = Constants.bRandom.Next() % 12 == 0 ? true : false;
curB = Constants.bRandom.Next() % 12 == 0 ? true : false;
curUp = Constants.bRandom.Next() % 15 == 0 ? !prevUp : prevUp;
curDown = Constants.bRandom.Next() % 15 == 0 ? !prevDown : prevDown;
curLeft = Constants.bRandom.Next() % 15 == 0 ? !prevLeft : prevLeft;
curRight = Constants.bRandom.Next() % 15 == 0 ? !prevRight : prevRight;
}
示例6: BuildCharge
private StateWrapper BuildCharge()
{
StateWrapper stateWrapper = new StateWrapper();
FSMState state = new ActionState(this.chargeStateName);
state.WithDefaultBehaviours(this.gameObject);
if (this.animationBehaviour != null) {
state.AddStartBehaviour(this.animationBehaviour);
}
state.AddStartBehaviour(new SetAnimationSpeedBehaviour(this.gameObject, 0f));
state.AddStartBehaviour(new SetVariableBehaviour(this.gameObject, this.chargeVariable, this.initialChargeMultiplier));
foreach (FSMBehaviour behaviour in this.customStartBehaviours) {
state.AddStartBehaviour(behaviour);
}
state.AddUpdateBehaviour(new ChargeBehaviour(this.gameObject, this.chargeVariable, this.maxChargeMultiplier, this.maxChargeSeconds));
state.AddExitBehaviour(new SetAnimationSpeedBehaviour(this.gameObject, 1f));
stateWrapper.state = state;
FSMTransition transition = null;
foreach (string startingState in this.startingStates) {
transition = new FSMTransition(startingState, this.chargeStateName);
transition.AddConditions(
new VarConditionsBuilder()
.IgnoringInputs().IgnoringAttributes().IgnoringDirections().IgnoringPositions().IgnoringFlags().IgnoringCombat()
.WithVar(CharVars.FromInputMode(this.input), new InputCondition(CharVars.FromInputMode(this.input).ToS(), Operators.EQUAL, InputModes.PRESS, InputModes.DOUBLE_TAP))
.Build()
);
stateWrapper.transitions.Add(transition);
}
return stateWrapper;
}
示例7: ActionStateX
public ActionStateX(ActionState action, int timeDelay, bool isOnceOnly, int specifer = -1)
{
this.TimeDelay = timeDelay;
IsOnceOnly = isOnceOnly;
Action = action;
Specifer = specifer;
}
示例8: Update
public void Update() {
inventory.AddToInventory(harvestable.Harvest(), harvestable.amountPerCollection);
if (harvestable.remainingAmount <= 0) {
Object.Destroy(harvestable);
}
state = ActionState.Done;
}
示例9: Drawer
protected Drawer()
{
CellCoors = new PointF[Consts.MAP_WIDTH, Consts.MAP_HEIGHT];
_state = ActionState.None;
LightenedCell = Consts.MAP_START_POS;
ShipsInfo = new Dictionary<int, ShipAttributes>();
}
示例10: Begin
public void Begin()
{
if (state != ActionState.None)
throw new InvalidOperationException("Begin should only be called once.");
state = ActionState.InProgress;
ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadProcess));
}
示例11: ActionChangeDialog
public ActionChangeDialog(ActionState currentState)
{
InitializeComponent();
ExistingState = currentState;
NewState = currentState;
ExtraInfo = "";
}
示例12: UpdateActionState
protected override void UpdateActionState(ActionState state)
{
base.UpdateActionState(state);
if (this.FComponentCheckedProperty != null)
{
this.FComponentCheckedProperty.SetValue(base.Component, (state & ActionState.Checked) > ActionState.None, null);
}
}
示例13: RuntimeLumberjack
public RuntimeLumberjack(ActionState state, Lumberjack prototype)
: base(state)
{
Prototype = prototype;
var size = new Vector2(8, 8);
Hitbox = new Bounds(-size, size);
Occupy(state.Building<RuntimeAdminBuilding>());
}
示例14: SetActionState
private void SetActionState(ActionState state, bool value)
{
if (value)
{
this.FState |= state;
}
else
{
this.FState &= ~state;
}
}
示例15: NextAction
public static ActionState NextAction(List<int> pinFalls)
{
ActionMaster actionMaster = new ActionMaster();
ActionState currentAction = new ActionState();
foreach (int pinFall in pinFalls) {
currentAction = actionMaster.Bowl (pinFall);
}
return currentAction;
}