Ejemplo n.º 1
0
    // Update is called once per frame
    //FIRST PLAYER MODEL
    void FixedUpdate()
    {
        if (playerCharacter == null)
        {
            return;
        }
        playerSpeed = playerCharacter.GetComponent <playerScript>().currentSpeed;
        float moveUnit = playerSpeed * Time.fixedDeltaTime;

        MOVE[1] = new Vector3(moveUnit, 0, 0);
        MOVE[2] = new Vector3(-moveUnit, 0, 0);
        MOVE[3] = new Vector3(0, moveUnit, 0);
        MOVE[4] = new Vector3(0, -moveUnit, 0);
        MOVE[5] = new Vector3(1, 1, 0).normalized *playerSpeed *Time.fixedDeltaTime;
        MOVE[6] = new Vector3(-1, 1, 0).normalized *playerSpeed *Time.fixedDeltaTime;
        MOVE[7] = new Vector3(1, -1, 0).normalized *playerSpeed *Time.fixedDeltaTime;
        MOVE[8] = new Vector3(-1, -1, 0).normalized *playerSpeed *Time.fixedDeltaTime;
        simulateAI(searchDepth, delayFrame);
        if (fireMode)
        {
            playerCont.Fire();
        }
        // AvoidantAI();
        // Debug.Log(playerSpeed);
    }