Example #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="platform">Contains botch the source- and the targetplatform, in that order</param>
 /// <param name="state">State of the isntruction</param>
 /// <param name="movement">Movement assigned to the instruction</param>
 /// <param name="xPos">The preffered position to execute the instruction</param>
 /// <param name="variableXPos">True if the position to execute the instruction doesn't matter (as long as you're on the correct platform)</param>
 /// <param name="direction">1 - Right, -1 - Left</param>
 public Instruction(Point platform, Enemy.State state, Vector2 movement, int xPos, bool variableXPos, int direction)
 {
     this.platform     = platform;
     this.state        = state;
     this.movement     = movement;
     this.xPos         = xPos;
     this.variableXPos = variableXPos;
 }
Example #2
0
    //状態変化(移動等)の確認(開閉アニメーションの為の措置)
    void StateCheck()
    {
        //一個前の状態と現在の状態が異なる場合
        if (_tmpState != CurrentState)
        {
            switch (_tmpState)
            {
            //待機状態からの変更の場合
            case Enemy.State.IDLE:
                if (CurrentState == Enemy.State.DISCOVERY)
                {
                    _anim.CrossFade("Close", 0.5f);
                    _animName = "Close";
                    _inMotion = true;
                }
                break;

            case Enemy.State.FREE:
                if (CurrentState == Enemy.State.DISCOVERY)
                {
                    _anim.CrossFade("Close", 0.5f);
                    _animName = "Close";
                    _inMotion = true;
                }
                break;

            case Enemy.State.ATTACK:
                if (CurrentState == Enemy.State.DISCOVERY)
                {
                    _anim.CrossFade("Close", 0.5f);
                    _animName = "Close";
                    _inMotion = true;
                }
                break;

            case Enemy.State.DISCOVERY:
                if (CurrentState == Enemy.State.ATTACK)
                {
                    _anim.CrossFade("Open", 0.5f);
                    _animName = "Open";
                    _inMotion = true;
                }

                if (CurrentState == Enemy.State.FREE)
                {
                    _anim.CrossFade("Open", 0.5f);
                    _animName = "Open";
                    _inMotion = true;
                }
                break;

            default:
                break;
            }

            _tmpState = CurrentState;
        }
    }