示例#1
0
    // Update is called once per frame
    void Update()
    {
        switch (state)
        {
        case PrimaryState.Pop:
            state = PrimaryState.Dead;
            break;
        }

        transform.rotation = Quaternion.Euler(new Vector3(0, 0, transform.rotation.eulerAngles.z));
        transform.position = new Vector3(transform.position.x, transform.position.y, originalLocation.z);
    }
示例#2
0
        public bool IsActiveState(TerrainType type, ref IState successorState)
        {
            switch (type)
            {
            case TerrainType.Standard:
                throw new Exception("Illegal Terrain");

            case TerrainType.Convex:
                successorState = new PrimaryState();
                return(true);

            case TerrainType.Wall:
                return(true);

            case TerrainType.Concave:
                successorState = new SecondaryState();
                return(true);
            }
            return(false);
        }
示例#3
0
 public State(State oldState, State newState)
 {
     FreshOrderbooksState = newState.FreshOrderbooksState ?? oldState.FreshOrderbooksState;
     PrimaryState         = newState.PrimaryState ?? oldState.PrimaryState;
 }
示例#4
0
 public State(FreshOrderbooksState freshOrderbooksState = null, PrimaryState primaryState = null)
 {
     FreshOrderbooksState = freshOrderbooksState;
     PrimaryState         = primaryState;
 }
示例#5
0
 /// <summary>
 /// Given a PrimaryState pState, this function will set the primary state to pState.
 /// </summary>
 /// <param name="pState">The new PrimaryState.</param>
 public void setPrimaryState(PrimaryState pState)
 {
     this.primary = pState;
 }
示例#6
0
        /// <summary>
        /// Creates a new State with the primary state being set to Idle and the secondary state list being empty.
        /// </summary>
        public State()
        {
            this.primary = PrimaryState.Idle;

            secondaryStates = new List <SecondaryState>();
        }
示例#7
0
 /// <summary>
 /// </summary>
 /// <param name="state"></param>
 /// <returns>Returns true if the PrimaryState state of State is equal to "state"</returns>
 public bool inState(PrimaryState state)
 {
     return(this.primary == state);
 }
        /// <summary>
        /// Creates a new State with the primary state being set to Idle and the secondary state list being empty.
        /// </summary>
        public State()
        {
            this.primary = PrimaryState.Idle;

            secondaryStates = new List<SecondaryState>();
        }
 /// <summary>
 /// Given a PrimaryState pState, this function will set the primary state to pState.
 /// </summary>
 /// <param name="pState">The new PrimaryState.</param>
 public void setPrimaryState(PrimaryState pState)
 {
     this.primary = pState;
 }
 /// <summary>
 /// </summary>
 /// <param name="state"></param>
 /// <returns>Returns true if the PrimaryState state of State is equal to "state"</returns>
 public bool inState(PrimaryState state)
 {
     return this.primary == state;
 }
示例#11
0
 public void Pop()
 {
     state = PrimaryState.Dead;
 }