Ejemplo n.º 1
0
    void Start()
    {
        ourShip = this.gameObject;

        enemyBoatController     = GetComponent <EnemyBoatController>();
        angleBetweenShipAndWind = GetComponent <AngleBetweenShipAndWind>();
        windArea = GameObject.Find("Wind Area").GetComponent <WindArea>();

        corner0 = GameObject.Find("Corner 0");
        corner1 = GameObject.Find("Corner 1");
        corner2 = GameObject.Find("Corner 2");
        corner3 = GameObject.Find("Corner 3");

        minDistBetweenParallel = 10;
        maxDistBetweenParallel = 30;

        cannonsTimeOfNextFire = new float[6];
        for (int i = 0; i < cannonsTimeOfNextFire.Length; i++)
        {
            cannonsTimeOfNextFire[i] = Time.time;
        }

        enemyBoatController.SailsDown();
        changeDirectionTime = Time.time + RandomPeriodOfTime();
        activeState         = state_PlayerSearch;
    }
Ejemplo n.º 2
0
    void Start()
    {
        enemyBoatController     = GetComponent <EnemyBoatController>();
        angleBetweenShipAndWind = GetComponent <AngleBetweenShipAndWind>();

        currentShipToWindAngle = angleBetweenShipAndWind.GetCurrentShipToWindAngle();
        fastestSailToShipAngle = GetFastestSailsToShipAngle(currentShipToWindAngle);
        lastShipToWindAngle    = currentShipToWindAngle;

        activeState = state_SetOptimalSailToShipAngle;
    }