當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。