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


C# FSM.ChangeState方法代码示例

本文整理汇总了C#中FSM.ChangeState方法的典型用法代码示例。如果您正苦于以下问题:C# FSM.ChangeState方法的具体用法?C# FSM.ChangeState怎么用?C# FSM.ChangeState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FSM的用法示例。


在下文中一共展示了FSM.ChangeState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Awake

    private void Awake()
    {
        Input.multiTouchEnabled = true;
        ControllerFSM = new FSM<MasterController, ControllerState>(this);
        ControllerFSM.RegisterState(null);
        //        ControllerFSM.RegisterState(GetComponent<DoorController>());
        //        ControllerFSM.RegisterState(GetComponent<PickUpController>());
        ControllerFSM.ChangeState(ControllerState.None);

        TargetFSM = new FSM<MasterController, TargetState>(this);
        TargetFSM.RegisterState(new ControllerIdleState());
        TargetFSM.RegisterState(new ControllerTargetState());
        TargetFSM.RegisterState(new ControllerActiveState());
        TargetFSM.ChangeState(TargetState.Idle);
    }
开发者ID:DR9885,项目名称:Possessed,代码行数:15,代码来源:MasterController.cs

示例2: Reset

    public void Reset()
    {
        // Set x position to middle
        var pos = transform.localPosition;
        pos.x = 0.0f;
        transform.localPosition = pos;

        // Reset current speed
        currentSpeed = NormalSpeed;

        // Reset FSM
        fsm = GetComponent<FSM>();
        var idleState = ScriptableObject.CreateInstance<IdleState>();
        idleState.Init(fsm);
        fsm.ChangeState(idleState);

        lastDir = null;

        lives = MaxLives;

        bombs = DefaultBombs;
    }
开发者ID:Ankk4,项目名称:highlyresponsive-forever,代码行数:22,代码来源:Player.cs

示例3: Awake

 private void Awake()
 {
     ActionFSM = new FSM<Door, DoorState>(this);
     ActionFSM.RegisterState(new DoorIdleState());
     ActionFSM.RegisterState(new DoorOpenState());
     ActionFSM.RegisterState(new DoorGhostState());
     ActionFSM.ChangeState(DoorState.Idle);
     TargetCollider.enabled = false;
 }
开发者ID:DR9885,项目名称:Possessed,代码行数:9,代码来源:Door.cs

示例4: Start

    // Use this for initialization
    void Start()
    {
        // Set up shoot timer
        if (!shootTimer)
        {
            shootTimer = ScriptableObject.CreateInstance<Timer>();
        }
        shootTimer.Init(ShootInterval, false);

        // Set up horizontal bound to clamp player's movement
        horizontalBoundSize = ScreenScript.GetScreenSize().x;

        // Set up current speed
        currentSpeed = NormalSpeed;

        // Set up FSM
        fsm = GetComponent<FSM>();
        var idleState = ScriptableObject.CreateInstance<IdleState>();
        idleState.Init(fsm);
        fsm.ChangeState(idleState);

        lastDir = null;

        lives = MaxLives;

        bombs = DefaultBombs = Mathf.Clamp(DefaultBombs, 0, MaxBombs);
    }
开发者ID:Ankk4,项目名称:highlyresponsive-forever,代码行数:28,代码来源:Player.cs


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