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

C# ActionState类代码示例

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

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



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


示例16: RunAction

    public ActionState RunAction()
    {
        if (this.CachedFunc != null) {
            this.CurrentState = this.CachedFunc();
        }
        else {
            Debug.LogWarning("Action has no OnAction set");
            this.CurrentState = ActionState.ACTION_CANCELLED;
        }

        return this.CurrentState;
    }
开发者ID:RamiAhmed,项目名称:Foundations_MiniProject_Test1,代码行数:12,代码来源:Action.cs


示例17: SecretAnnouncement

        public SecretAnnouncement(string name, Dictionary<string, Agent> allAgents, Dictionary<string, Agent> audience, Formula announcement)
            : base(name , allAgents , audience , announcement)
        {
            ActionState trueState = new ActionState("TrueState");
            SecretState = new ActionState("Secret");
            SecretState.Precondition = announcement;
            ActionStates.Add(trueState);
            ActionStates.Add(SecretState);

            Relation = new ActionIndecisionPair(SecretState, trueState);
            Relation.TagedAgents = GetSubtractionOfAgentDics(allAgents, audience);
            TransitionRelation.Add(Relation);
        }
开发者ID:ashkanalinejad,项目名称:KLab,代码行数:13,代码来源:SecretAnnouncement.cs


示例18: ActionDoneOverride

        protected override JobStatus ActionDoneOverride(ActionState actionStatus)
        {
            switch (actionStatus)
            {
                case ActionState.Done:
                case ActionState.Fail:
                case ActionState.Abort:
                    return JobStatus.Ok;

                default:
                    throw new Exception();
            }
        }
开发者ID:Fulborg,项目名称:dwarrowdelf,代码行数:13,代码来源:GrazeMoveAssignment.cs


示例19: Attack

    protected virtual void Attack(int attackWeight = 1)
    {

        ACC = level - PlayerState._instance.level > 0 ? 0.7f :
                   (0.7 - (PlayerState._instance.level - level) * 0.15f <= 0 ? 0.05f :
                           ((0.7f - (PlayerState._instance.level - level) * 0.15f + 0.05f)));
        PlayerController._instance.TakeDamage(ATK, ACC);
        if (!PlayerState._instance.PlayerAliveNow)
        {
            nowState = ActionState.notFoundPlayer;
        }

    }
开发者ID:tsss-t,项目名称:SimpleStory,代码行数:13,代码来源:Enemy.cs


示例20: Entity

        // высота объекта над землей

        public Entity(string url, string id) : base(url) {
            Id = id;
            IsAntialiased = false;
            Direction = 0;
            Speed = 0;
            Tag = Tags.Unknown;
            Hp = new Stat(0);
            AttackDamage = 0;
            ActionState = ActionState.Idle;
            Scale = Settings.Scale;
            MaskW = (int) (Texture.PixelsWide*ScaleX) - MaskLesser;
            MaskH = (int) (Texture.PixelsHigh*ScaleY) - MaskLesser;
        }
开发者ID:Insality,项目名称:essence-of-shadows,代码行数:15,代码来源:Entity.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ActionType类代码示例发布时间:2022-05-24
下一篇:
C# ActionService类代码示例发布时间: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