void Start() { _beacon = transform.parent.GetComponent<Nights2Beacon>(); }
public EightNightsMgr.GroupID GetGroupForBeacon(Nights2Beacon beacon) { foreach (GroupStateData d in _groupState) { if (Nights2Mgr.Instance.GetBeacon(d.CandleIdx) == beacon) return d.Group; } Debug.LogWarning("Couldn't find group for beacon '" + beacon.gameObject.name + "'. Defaulting to 'Candle1'. Probably a bug!"); return EightNightsMgr.GroupID.Candle1; }
public ScrollColorParams(float holdDuration, float fadeDuration, float scrollSpeed, Nights2Beacon[] lightOrder) { HoldDuration = holdDuration; FadeDuration = fadeDuration; ScrollSpeed = scrollSpeed; LightOrder = lightOrder; }
void PickNextBeacon() { if (_unlitBeacons.Count == 0) { Debug.LogError("Can't pick next beacon, there are no unlit ones left!"); return; } Nights2Beacon b = null; //first beacon, just use the one we're configured for if (_litBeacons.Count < CandlePathOrderLength()) { b = GetPath(_litBeacons.Count).LeadsToBeacon; } //pick randomly if (b == null) { int idxToPick = UnityEngine.Random.Range(0, _unlitBeacons.Count); b = _unlitBeacons[idxToPick]; } //old one no longer next if (_nextBeacon != null) _nextBeacon.SetIsNext(false); //new one is b.SetIsNext(true); _nextBeacon = b; }
//paths register here so mgr knows which paths lead to which beacons public void RegisterPath(Nights2Path path, Nights2Beacon leadsToBeacon) { if ((path == null) || (leadsToBeacon == null)) return; //ignore if not in the current progression //we allow multiple progressions, make sure we have the right one bool found = false; for (int i = 0; i < CandlePathOrderLength(); i++) { if (GetPath(i) == path) { found = true; break; } } if (!found) return; _beaconToPathMap[leadsToBeacon] = path; }
public TurnOnInSequenceParams(float holdDuration, float fadeDuration, float nextLightInterval, Nights2Beacon[] lightOrder) { HoldDuration = holdDuration; NextLightInterval = nextLightInterval; FadeDuration = fadeDuration; LightOrder = lightOrder; }