Beispiel #1
0
    public string GetStateString(CombatantMoveState state, int stateHash)
    {
        StringBuilder result = new StringBuilder(state.ToString());

        result.Append("[");
        if (stateHash == m_attack_hash)
        {
            result.Append("Attack]");
        }
        else if (stateHash == m_reaction_hash)
        {
            result.Append("Hit]");
        }
        else if (stateHash == m_entry_hash)
        {
            result.Append("Block]");
        }
        else if (stateHash == m_death_hash)
        {
            result.Append("Death]");
        }
        else if (stateHash == m_idle_hash)
        {
            result.Append("Idle]");
        }
        else
        {
            result.Append("???]");
        }
        return(result.ToString());
    }
Beispiel #2
0
    public void TransitionTo(CombatantMoveState state)
    {
        if (!m_IsInitialized)
        {
            if (state != CombatantMoveState.kIdle)
            {
                EB.Debug.LogError("TransitionTo: {0} not initialized", state);
            }
            return;
        }

        if ((int)m_CurrentState == (int)state)
        {
            return;
        }
        // don't delete me - i'm awesome for debugging
        //EB.Debug.Log (myName + " " + m_state + " -> " + state);
        MoveEditor.Move nextMove = GetMoveByState(state);
        if (nextMove == null)
        {
            EB.Debug.LogError("TransitionTo: move not found for state {0}", state);
            return;
        }

        SetMove(nextMove);
        m_Animator.SetInteger("State", (int)state);

        CurrentState = state;

        if (m_AvatarComponent != null)
        {
            m_AvatarComponent.FullPathHash = GetCurrentAnimHash();
        }
    }
Beispiel #3
0
 public MoveEditor.Move GetMoveByState(CombatantMoveState state)
 {
     for (int i = 0; i < m_Moves.Length; i++)
     {
         if (state == m_Moves[i]._moveState)
         {
             return(m_Moves[i]);
         }
     }
     return(null);
 }
Beispiel #4
0
    public int GetStateAnimHash(CombatantMoveState state)
    {
        switch (state)
        {
        case CombatantMoveState.kIdle:
            return(m_idle_hash);

        case CombatantMoveState.kReady:
            return(m_ready_hash);

        case CombatantMoveState.kLaunch:
            return(m_launch_hash);

        case CombatantMoveState.kLocomotion:
            return(m_locomotion_hash);

        case CombatantMoveState.kDeath:
            return(m_death_hash);

        case CombatantMoveState.kForward:
            return(m_forward_hash);

        case CombatantMoveState.kBackward:
            return(m_backward_hash);

        case CombatantMoveState.kAttackTarget:
            return(m_attack_hash);

        case CombatantMoveState.kHitReaction:
            return(m_reaction_hash);

        case CombatantMoveState.kRevive:
            return(m_revive_hash);

        case CombatantMoveState.kEntry:
            return(m_entry_hash);

        case CombatantMoveState.kVictoryDance:
            return(m_dance_hash);

        case CombatantMoveState.kLobby:
            return(m_lobby_hash);

        case CombatantMoveState.kSpecial:
            return(m_entry_hash);

        default:
            break;
        }
        return(-1);
    }
Beispiel #5
0
 public MoveEditor.Move[] GetMovesByState(CombatantMoveState state)
 {
     return(m_Moves.Where(s => s._moveState == state).ToArray());
 }
Beispiel #6
0
 private void OnDisable()
 {
     m_CurrentState = CombatantMoveState.kIdle;
 }