Exemple #1
0
    float momentum = 0f; //de -0.75 a 0.75

    private void Start()
    {
        scene = GameObject.Find("Scene").transform;

        botPrecision = GetComponent <BotPrecision>();

        cameraAgent = GetComponent <CameraMovement>();

        lastX = new List <float>();
        lastY = new List <float>();


        realX = new List <float>();
        realY = new List <float>();

        for (int i = 0; i < 60; i++)
        {
            lastX.Add(0f);
            lastY.Add(0f);
            realX.Add(0f);
            realY.Add(0f);
        }

        //realImpulse = new Queue<MoveInfo>();
        //agentImpulse = new Queue<MoveInfo>();

        lastAngles     = new List <float>();
        lastMagnitudes = new List <float>();

        for (int i = 0; i < 3; i++)
        {
            lastAngles.Add(0f);
            lastMagnitudes.Add(0f);
        }
    }
Exemple #2
0
    //-------------------------------------


    public void GetDirectionAndHeight(ref bool invertSpawn, ref float maxHeight, ref bool turnOff)
    {
        if (agentType != AgentType.TWO_AXIS)
        {
            turnOff = false;
        }
        else
        {
            turnOff = true;
        }

        if (agentType == AgentType.IMPULSE || agentType == AgentType.RANGE)
        {
            invertSpawn = false;

            maxHeight = 0f;
        }
        else
        {
            botPrecision = GetComponent <BotPrecision>();


            if (botPrecision != null && botPrecision.isActiveAndEnabled && botPrecision.invertIdle)
            {
                invertSpawn = false;
            }
            else
            {
                invertSpawn = true;
            }

            maxHeight = 30f;
        }
    }