Esempio n. 1
0
        void Update()
        {
            if (this.OrbitCam != null)
            {
                float maxOrbitalDistance = Orbiter.GetLargestOrbitalDistance();

                float zoom = maxOrbitalDistance + ZoomBaseline;
                this.OrbitCam.SetZoom(zoom);
            }
        }
Esempio n. 2
0
        void OnTriggerEnter(Collider other)
        {
            Orbiter ob = other.gameObject.GetComponent <Orbiter>();

            if (ob != null)
            {
                if (!HasTriggered(ob))
                {
                    this.Triggered.Add(ob);
                }
            }
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 public bool HasTriggered(Orbiter ob)
 {
     return(this.Triggered.Contains(ob));
 }