Example #1
0
    void FixedUpdate()
    {
        MapGeneratorScript.FixedUpdate();
        if (player == null)
        {
            player = GameObject.FindGameObjectWithTag("Player");
            return;
        }

        index++;
        if (index % 50 == 0)
        {
            this.reloadBases();
        }

        isNearBase = false;
        foreach (float xPos in baseCoordinates)
        {
            if (Mathf.Abs(player.transform.position.x - xPos) < 5 && player.transform.position.y > 0)
            {
                isNearBase = true;
            }
            if (player.transform.position.x < 10)
            {
                isNearBase = true;
            }
        }
    }