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; }
void Start() { enemyBoatController = GetComponent <EnemyBoatController>(); angleBetweenShipAndWind = GetComponent <AngleBetweenShipAndWind>(); currentShipToWindAngle = angleBetweenShipAndWind.GetCurrentShipToWindAngle(); fastestSailToShipAngle = GetFastestSailsToShipAngle(currentShipToWindAngle); lastShipToWindAngle = currentShipToWindAngle; activeState = state_SetOptimalSailToShipAngle; }