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


C# ActionState类代码示例

本文整理汇总了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++;
     }
 }
开发者ID:alenkacz,项目名称:Expanze,代码行数:7,代码来源:GameAction.cs

示例2: Character

 public Character(WorldMap worldMap, Vector2 coordinates)
 {
     mCoordinates = coordinates;
     mState = ActionState.Idle;
     mDirection = FacingDirection.Down;
     mWorldMap = worldMap;
 }
开发者ID:jmrboosties,项目名称:Walk-and-Talk,代码行数:7,代码来源:Character.cs

示例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;
 }
开发者ID:akingunes,项目名称:eXpand,代码行数:7,代码来源:ActionStateRuleAttribute.cs

示例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;
    }
开发者ID:srfoster,项目名称:CodeSpells,代码行数:29,代码来源:GnomeAI.cs

示例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;
        }
开发者ID:GameDevelopmentStudio,项目名称:ringo-allstars,代码行数:34,代码来源:AIPlayer.cs

示例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;
 }
开发者ID:BrunoRomes,项目名称:UnityTests,代码行数:29,代码来源:ChargedMeleeAttackBuilder.cs

示例7: ActionStateX

 public ActionStateX(ActionState action, int timeDelay, bool isOnceOnly, int specifer = -1)
 {
     this.TimeDelay = timeDelay;
     IsOnceOnly = isOnceOnly;
     Action = action;
     Specifer = specifer;
 }
开发者ID:ggrrin,项目名称:DungeonMaster,代码行数:7,代码来源:ActionStateX.cs

示例8: Update

	public void Update() {
		inventory.AddToInventory(harvestable.Harvest(), harvestable.amountPerCollection);
		if (harvestable.remainingAmount <= 0) {
			Object.Destroy(harvestable);
		}
		state = ActionState.Done;
	}
开发者ID:NotYours180,项目名称:Survival,代码行数:7,代码来源:HarvestAction.cs

示例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>();
 }
开发者ID:CSF-VSU,项目名称:SpacePewPew,代码行数:7,代码来源:Drawer.cs

示例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));
        }
开发者ID:stukalin,项目名称:ImageResizer,代码行数:8,代码来源:BackgroundAction.cs

示例11: ActionChangeDialog

        public ActionChangeDialog(ActionState currentState)
        {
            InitializeComponent();

            ExistingState = currentState;
            NewState = currentState;
            ExtraInfo = "";
        }
开发者ID:pkmnfrk,项目名称:busy,代码行数:8,代码来源:ActionChangeDialog.cs

示例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);
     }
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:8,代码来源:CustomBindActionLink.cs

示例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>());
        }
开发者ID:kg,项目名称:rlms2013,代码行数:10,代码来源:Lumberjack.cs

示例14: SetActionState

 private void SetActionState(ActionState state, bool value)
 {
     if (value)
     {
         this.FState |= state;
     }
     else
     {
         this.FState &= ~state;
     }
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:11,代码来源:UpdateActionEventArgs.cs

示例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;
    }
开发者ID:a-suniala,项目名称:BowlMaster,代码行数:11,代码来源:ActionMaster.cs


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