private void Awake() { ship = GameObject.FindWithTag(ShipDriver.Tag).GetComponent <ShipDriver>(); laneLength = GameObject.FindWithTag(TrackBuilder.Tag).GetComponent <SectionBuilder>().laneLength; obstacleLength = obstacle.GetComponent <MeshRenderer>().bounds.size.z; maximumNudgeDistance = laneLength - obstacleLength; }
public CustomShipInitializerModel(string model, ShipDriver driver) { var cs = new CompactSerializer(); this.model = cs.Deserialize <ShipSystemModel>(model); this.driver = driver; }
public ShipController SetShip(ShipSystemModel model, ShipDriver driver) { this.ship = gameObject.AddComponent <ShipController>(); this.ship.SetShip(shipClass, model, driver); SetHull(model.hull, this.ship.shipSystem.system, driver); this.ship.SetComponents(tackles.Select(t => t.GetComponent <ShipComponentBehaviour>()).Where(c => c != null).ToArray()); return(this.ship); }
public FirePoints(int maxPoints, ShipDriver driver) { maxPoints = maxPoints < 1 ? 1 : maxPoints; points = new Vector3[maxPoints]; this.driver = driver; }
private void Awake() { StartPoint = transform.Find("StartPoint"); EndPoint = transform.Find("EndPoint"); Threshold = transform.Find("Threshold"); ship = GameObject.FindWithTag("Player").GetComponent <ShipDriver>(); track = GameObject.FindWithTag("Track").GetComponent <TrackBuilder>(); }
public BirdsState() { birdSpawner = (GameObject)Resources.Load("BirdSpawner"); birdTightSpawner = (GameObject)Resources.Load("BirdTightSpawner"); birdBomberSpawner = (GameObject)Resources.Load("BirdBomberSpawner"); hpSpawner = (GameObject)Resources.Load("HpSpawner"); spawnerOffset = new Vector3(57, 5, 0); sd = ShipDriver.Get(); }
void Start() { sd = GetComponent <ShipDriver>(); sd.HPChanged.AddListener(OnHpChanged); lastHP = 5; cd = transform.GetComponentInChildren <CaptainDriver>(); crankSource.volume = 0; crankSource.Play(); }
public LearnEngineState(int ram, int shoot) { ramCount = ram; shootCount = shoot; engineTrainingSpawner = (GameObject)Resources.Load("EngineTrainingSpawner"); shootTrainingSpawner = (GameObject)Resources.Load("ShootTrainingSpawner"); spawnerOffset = new Vector3(57, 5, 0); sd = ShipDriver.Get(); cd = CaptainDriver.Get(); }
public DropoffState() { dockingShip = (GameObject)Resources.Load("DockingShip"); //birdSpawner = (GameObject)Resources.Load("BirdSpawner"); //birdTightSpawner = (GameObject)Resources.Load("BirdTightSpawner"); //birdBomberSpawner = (GameObject)Resources.Load("BirdBomberSpawner"); //hpSpawner = (GameObject)Resources.Load("HpSpawner"); spawnerOffset = new Vector3(50, 5, 0); sd = ShipDriver.Get(); }
public void SetShip(int shipClass, ShipSystemModel model, ShipDriver driver) { GetComponent <Rigidbody>().mass = Mathf.Pow(2, shipClass); shipDriver = driver; shipSystem = new ShipSystem(model); this.shipClass = shipClass; maxHealth = new float[] { 1f, 4f, 12f, 36f, 250f * ((BattleConfig)GameState.sharedData["BattleConfig"]).battleDurationMultipier }[shipClass];// Mathf.Pow(maxHealth, shipClass + 1); health = maxHealth; shipDriver.SetShip(this); //turn enabled true gameObject.AddComponent <ShipIdentification>().ship = this; }
public void SetHull(HullModel model, Forest <SystemLink> link, ShipDriver driver) { var t = model.GetTackles(link); foreach (var e in t) { SetTackle(e.Key, e.Value) .SetDriver(driver); } foreach (var l in link.ByElements()) { l.enabled = true; } }
void Start() { ss = GetComponent <StraightSpin>(); ShipDriver.Get().EnginePowerChanged.AddListener(OnEngineChanged); }
public LearnMovementState() { sd = ShipDriver.Get(); cd = CaptainDriver.Get(); }
public IntroState() { sd = ShipDriver.Get(); cd = CaptainDriver.Get(); }
public void AddToDead(ShipDriver driver, ShipController killer) { shipsLost[driver.shipClass]++; casualties.Add(killer); _deadDrivers.Add(driver); }
public void SetDriver(ShipDriver driver) { this.driver = driver; }
public static void EndChange(ShipDriver shipDriver) { shipDriver.EndChange(); }
public static void StartChange(ShipDriver shipDriver, LaneChangeType type) { shipDriver.StartChange(type); }
public CustomShipInitializerModel(ShipSystemModel model, ShipDriver driver) { this.model = model; this.driver = driver; }