private void Trigger() { hoursRemaining = UnityEngine.Random.Range(minimumHoursBetween, maxmumHoursBetween); TriggeredEvent[] components = GetComponents <TriggeredEvent>(); if (components.Length != 0) { TriggeredEvent triggeredEvent = components[UnityEngine.Random.Range(0, components.Length)]; if (!(triggeredEvent == null)) { triggeredEvent.SendMessage("RunEvent", SendMessageOptions.DontRequireReceiver); } } }
private void Trigger() { this.hoursRemaining = UnityEngine.Random.Range(this.minimumHoursBetween, this.maxmumHoursBetween); TriggeredEvent[] components = base.GetComponents <TriggeredEvent>(); if (components.Length == 0) { return; } TriggeredEvent triggeredEvent = components[UnityEngine.Random.Range(0, (int)components.Length)]; if (triggeredEvent == null) { return; } triggeredEvent.SendMessage("RunEvent", SendMessageOptions.DontRequireReceiver); }