// Start is called before the first frame update void Start() { aspectRatio = (wingSpan * wingSpan) / wingArea; rigidBody = this.GetComponent <Rigidbody>(); if (debugCube) { debugCubeInitialPosition = debugCube.transform.localPosition; debugCubeInitialScale = debugCube.transform.localScale; } if (forceDebugBaloons.Length > 0) { debugBaloonInitialPosition = new Vector3[forceDebugBaloons.Length]; for (int i = 0; i < forceDebugBaloons.Length; i++) { debugBaloonInitialPosition[i] = forceDebugBaloons[i].transform.localPosition; } } // if (showForceDebug) { // //forceDebugVism // Destroy(forceDebugVisual.GetComponent<Collider>()); // forceDebugVisual.transform.parent = rigidBody.transform; // //forceDebugVisual.transform.position = new Vector3(2, 1, 0); // } airplaneController = FindAirplaneController(); }
// Use this for initialization void Start() { label = GetComponent <Text> (); script = airplaneGameObject.GetComponent <AirplaneController> (); _scoreAdd = script.scoreAdd; }
public bool RequestToLandForAirplane(AirplaneController airplane) { if (IsOccupiedForAirplane) { return(false); } airplane.SetNextPoint(LandingPointForAirplane, 0, 1); IsOccupiedForAirplane = true; return(true); }
// ScoreKeeping scoreKeeping; // Use this for initialization void Start() { script = airplaneGameObject.GetComponent <AirplaneController> (); label = GetComponent <Text> (); _score = script.score; Camera cam = Camera.main; this.height = 2f * cam.orthographicSize; this.width = height * cam.aspect; }
private void Awake() { //setup PID PID = new PIDController(); PID.SetConstants(PGain, IGain, DGain, MinOutput, MaxOutput); //get other references controller = GetComponent <AirplaneController>(); aircraft = GetComponent <Rigidbody>(); //disable enabled = false; }
void Awake() { if (instance == null) { instance = this; //DontDestroyOnLoad(this.gameObject); } else { Destroy(gameObject); } //SceneManager.sceneLoaded += Carrega; }
private AirplaneController FindAirplaneController() { AirplaneController result = null; foreach (var go in UnityEngine.SceneManagement.SceneManager.GetActiveScene().GetRootGameObjects()) { result = go.GetComponent <AirplaneController>(); if (result) { return(result); } } Debug.LogError("Expected to find a AirplaneController on one of the Root Objects."); return(null); }
// Use this for initialization private void Start() { _controller = gameObject.GetComponent <AirplaneController>(); // Find target _target = GameObject.Find("Player"); LookNearTarget(); _currentAngle = transform.rotation.eulerAngles.z; if (Random.Range(0, 3) == 0) { _chaseTarget = false; } // Set random rotate timer _rotateTimer = Random.Range(1F, 4F); }
public FlyState(AirplaneController Controller) { _plane = Controller; mUndeadTimer = new Timer(); mUndeadTimer.Duration = 0.25f; mUndeadTimer.OnTick += OnTick; mUndeadTimer.Run(); _sharpTurnTimer = new Timer(); _sharpTurnTimer.Duration = 1.3f; _sharpTurnTimer.OnTick += OnSharpTurnEnd; _planeMaxRotation = _plane.MaxRotation; _planeAccelRotation = _plane.AccelRotation; _planeBreakRotation = _plane.BreakRotation; _prevBreaking = _plane.Breaking; EventController.Instance.Subscribe("MakeSharpTurn", this); }
public bool TryLaunch(Vector3 startPosition, Vector3 direction, IAirplaneTarget ship) { var airplane = pool.Get(); if (airplane) { var airplaneController = airplane.GetComponent <AirplaneController>(); var target = lastLaunched == null || !lastLaunched.IsActive ? ship : lastLaunched; airplaneController.Launch(target, ship, pool); airplane.transform.position = startPosition; airplane.transform.up = direction; lastLaunched = airplaneController; return(true); } else { return(false); } }
public AirplaneControllerTest() { _service = new AirplaneServiceFake(); _controller = new AirplaneController(_service); }
void Start() { Plane = AirplaneController.Instance; Input.gyro.enabled = true; EventController.Instance.SubscribeToAllEvents(this); }
public Area(AreaOptions options) { _areaOptions = options; _createZoneInfoFinder = () => new ZoneInfoFinder( queryObject => _zoneInfoGrid .GetZoneInfoFor(queryObject)); _zoneInfoGrid = new ZoneInfoGrid(options.GetZoneWidthAndHeight(), options.GetLandValueCalculator()); options.WithTerraformingOptions(terraFormingOptions => { var randomTerraformer = new RandomTerraformer(CreateWaterZone, CreateWoodlandZone); randomTerraformer.ApplyWith(_zoneInfoGrid, terraFormingOptions); }); options.WithPersistedArea(persistedArea => { var factoriesAndNames = GetSupportedZoneConsumptionFactoriesPrivate() .ToDictionary(x => x().Name, x => x); if (persistedArea .PersistedSingleZoneConsumptions .Select( x => ConsumeZoneAt(_zoneInfoGrid.ZoneInfos[new ZonePoint { X = x.X, Y = x.Y }], factoriesAndNames[x.Name]())) .Concat(persistedArea .PersistedStaticZoneClusterCentralMemberConsumptions .Select( x => ConsumeZoneAt(_zoneInfoGrid.ZoneInfos[new ZonePoint { X = x.X, Y = x.Y }], factoriesAndNames[x.Name]()) ) ) .Any(result => !result.Success) ) { throw new InvalidOperationException(); } if (persistedArea .PersistedIntersectingZoneConsumptions .Select( x => ConsumeZoneAt(_zoneInfoGrid.ZoneInfos[new ZonePoint { X = x.X, Y = x.Y }], new IntersectingZoneConsumption(_createZoneInfoFinder(), factoriesAndNames[x.EastWestName]() as BaseInfrastructureNetworkZoneConsumption, factoriesAndNames[x.NorthSouthName]() as BaseInfrastructureNetworkZoneConsumption) )) .Any(result => !result.Success)) { throw new InvalidOperationException(); } if (persistedArea .PersistedGrowthZoneClusterCentralMemberConsumptions .Select(x => { var consumption = factoriesAndNames[x.Name]() as IBaseGrowthZoneClusterConsumptionInLoadContext; consumption.Set(x.Id, x.Population); return(ConsumeZoneAt(_zoneInfoGrid.ZoneInfos[new ZonePoint { X = x.X, Y = x.Y }], consumption )); }) .Any(result => !result.Success)) { throw new InvalidOperationException(); } if (persistedArea.PersistedTrafficStates != null) { foreach (var trafficState in persistedArea.PersistedTrafficStates) { var localTrafficState = trafficState; _zoneInfoGrid.ZoneInfos[new ZonePoint { X = trafficState.X, Y = trafficState.Y }] .WithNetworkConsumptionIf( (RoadZoneConsumption x) => { x.SetTrafficDensity(trafficState.Traffic); }); } } }); var zoneInfos = new HashSet <IZoneInfo>(_zoneInfoGrid.ZoneInfos.Values); TrainController = new TrainController(() => zoneInfos); AirplaneController = new AirplaneController(() => zoneInfos); ShipController = new ShipController(this, () => zoneInfos); }
void InitializeGameObjects() { airplaneController = GameObject.Find("Plane").GetComponent <AirplaneController> (); }
public RideState(AirplaneController Controller) { _plane = Controller; }
void InitializeGameObjects() { airplaneController = GameObject.Find("Plane").GetComponent <AirplaneController>(); follower = GameObject.Find("Main Camera").GetComponent <LerpFollower>(); }
private void Start() { airplane = GetComponent <AirplaneController>(); rb = GetComponent <Rigidbody>(); }
private void Start() { _controller = gameObject.GetComponent <AirplaneController>(); }
void Start() { airplaneController = GetComponent <AirplaneController>(); functionBank = gameObject.AddComponent <FunctionBank>(); }
public void FindAirplaneTest() { AIRPLANE data = new AirplaneController().FindAirplane(5006); }
public void GetAllAirplaneTest() { List <AIRPLANE> data = new AirplaneController().GetAllAirplane(); }
public void AttachFlightToPanel(GameObject newPlane) { linkedPlaneController = newPlane.GetComponent <AirplaneController>(); flightNumText.text = linkedPlaneController.flightNumber; statusText.text = linkedPlaneController.statusText; }
void Awake() { myController = GetComponent <AirplaneController>(); myCameraController = GetComponent <CameraController>(); myPlayerGUI = GetComponent <PlayerGUI>(); }