Пример #1
0
    // Update is called once per frame
    void Update()
    {
        float direction = 0.0f;

        if (m_Target.position.y > transform.position.y)
        {
            direction = 1.0f;
        }
        else if (m_Target.position.y < transform.position.y)
        {
            direction = -1.0f;
        }

        m_PadMovement.Move(direction);
    }
Пример #2
0
    public override void AgentAction(float[] vectorAction, string textAction)
    {
        // Time penalty
        AddReward(-0.05f);

        // Add all other rewards
        float reward = m_Rewards.Reward;

        AddReward(reward);

        // Actions, size = 1
        float direction = Mathf.Clamp(vectorAction[0], -1, 1);

        m_InputParser.AddInput(direction);
        m_Movement.Move(direction);
    }