Exemplo n.º 1
0
    private void Awake()
    {
        bulletPooler.InitializePool();
        laserPooler.InitializePool();
        rocketPooler.InitializePool();

        float theta = 360f / spokes;

        turretPositions = new TurretPositions();

        for (int i = 0; i < spokes; i++)
        {
            TurretPosition pos = new TurretPosition();
            pos.turrets             = new List <Turret>();
            pos.positionObject      = Instantiate(turretPositionPrefab, planet.transform);
            pos.positionObject.name = string.Format("Turret Position {0}", i);
            pos.positionObject.transform.localPosition = Vector3.zero;
            pos.positionObject.transform.Rotate(Vector3.forward * theta * -i);
            pos.positionObject.transform.Translate(Vector3.up * turretDropPosition.position.y);
            if (i > 0)
            {
                turretPositions[turretPositions.Count - 1].rightPosition = pos;
                pos.leftPosition = turretPositions[turretPositions.Count - 1];
            }
            turretPositions.Add(pos);
        }

        turretPositions[0].leftPosition = turretPositions[turretPositions.Count - 1];
        turretPositions[turretPositions.Count - 1].rightPosition = turretPositions[0];

        ghostTurretInstance      = Instantiate(ghostTurret, transform).GetComponent <GhostTurret>();
        ghostTurretInstance.name = "Ghost Turret";
        ghostTurretInstance.gameObject.SetActive(false);

        ghostTurretInstance.targetPosition     = turretPositions[0];
        ghostTurretInstance.topPosition        = turretDropPosition;
        ghostTurretInstance.turretHeightOffset = turretHeightOffset;

        List <int> biomeTesting = new List <int>();

        for (int i = 0; i < 20; i++)
        {
            biomeTesting.Add(i % 4);
        }

        //SetBiomeData(biomeTesting.ToArray());
    }