void Update() { if (this.OrbitCam != null) { float maxOrbitalDistance = Orbiter.GetLargestOrbitalDistance(); float zoom = maxOrbitalDistance + ZoomBaseline; this.OrbitCam.SetZoom(zoom); } }
void OnTriggerEnter(Collider other) { Orbiter ob = other.gameObject.GetComponent <Orbiter>(); if (ob != null) { if (!HasTriggered(ob)) { this.Triggered.Add(ob); } } }
public static float GetLargestOrbitalDistance() { float largestDistance = 0; for (int i = 0; i < Orbiters.Count; i++) { Orbiter o = Orbiters[i]; if (o.isActiveAndEnabled && (o.GravitySource != null)) { if (o.OrbitalDistance > largestDistance) { largestDistance = o.OrbitalDistance; } } } return(largestDistance); }
public override bool IsCompleted() { if ((this.Triggers == null) || (this.Triggers.Length == 0)) { return(false); } ObjectiveTrigger firstTrigger = this.Triggers[0]; for (int i = 0; i < firstTrigger.Triggered.Count; i++) { Orbiter ob = firstTrigger.Triggered[i]; for (int j = 0; j < this.Triggers.Length; j++) { if (!this.Triggers[j].HasTriggered(ob)) { return(false); } } } return(true); }
public bool HasTriggered(Orbiter ob) { return(this.Triggered.Contains(ob)); }