Пример #1
0
    void Awake()
    {
        foreach (string s in Input.GetJoystickNames())
        {
            Debug.Log(s);
        }

        _MaxHealth        = 1000;
        _Damage           = 10;
        MaxSpeed          = 0.06f;
        Acceleration      = 0.015f;
        Deceleration      = 0.03f;
        m_CurrentState    = new AIBattleIdle(this);
        m_ComboState      = new NoInputState(this, new NoInputState(this, null));
        m_FacingRight     = true;
        m_TotalForce      = Vector3.zero;
        m_NGramWindowSize = 2;

        m_MaxHealth     = 100.0f;
        m_CurrentHealth = 100.0f;

        nGramPredictor           = new HierarchicalNGramPredictor(m_NGramWindowSize + 1);
        nGramPredictor.threshold = 1;

        //nGramPredictor = new NGramPredictor();
        //nGramPredictor.nValue = m_NGramWindowSize + 1;

        //nGramPredictor.Init();

        previousActions    = new string[m_NGramWindowSize + 1];
        predictionSequence = new string[m_NGramWindowSize];

        //attackSequence = new string[5];


        if (Root.Instance != null)
        {
            m_GravityForce = Root.Instance.gravity;
        }
        else
        {
            m_GravityForce = -0.01f;
        }

        m_MaxFallSpeed = -0.1f;
    }
    void Awake()
    {
        foreach (string s in Input.GetJoystickNames())
        {
            Debug.Log(s);
        }

        _MaxHealth = 1000;
        _Damage = 10;
        MaxSpeed = 0.06f;
        Acceleration = 0.015f;
        Deceleration = 0.03f;
        m_CurrentState = new AIBattleIdle(this);
        m_ComboState = new NoInputState(this, new NoInputState(this, null));
        m_FacingRight = true;
        m_TotalForce = Vector3.zero;
        m_NGramWindowSize = 2;

        m_MaxHealth = 100.0f;
        m_CurrentHealth = 100.0f;

        nGramPredictor = new HierarchicalNGramPredictor(m_NGramWindowSize +1);
        nGramPredictor.threshold = 1;

        //nGramPredictor = new NGramPredictor();
        //nGramPredictor.nValue = m_NGramWindowSize + 1;

        //nGramPredictor.Init();

        previousActions = new string[m_NGramWindowSize + 1];
        predictionSequence = new string[m_NGramWindowSize];

        //attackSequence = new string[5];

        if (Root.Instance != null)
        {
            m_GravityForce = Root.Instance.gravity;
        }
        else
        {
            m_GravityForce = -0.01f;
        }

        m_MaxFallSpeed = -0.1f;
    }