public static new void CheckLoadPrefab() { if (prefabBubble == null) { prefabBubble = Resources.Load <TimeBubble>("TimeBubble"); } if (prefabSpawner == null) { prefabSpawner = Resources.Load <TimeBubbleSpawner>("TimeBubbleSpawner"); } }
public void AddTimeBubble(TimeBubble timeBubble) { foreach (TimeBubble tb in AffectingTimeBubbles) { if (tb == timeBubble) { return; } } AffectingTimeBubbles.Add(timeBubble); }
public override void Detonate() { CheckLoadPrefab(); float quality = Quality; TimeBubble bubble = Instantiate(prefabBubble, transform.position, Quaternion.identity) as TimeBubble; bubble.transform.localScale = Vector3.one * Mathf.Lerp(limits.minRadius, limits.maxRadius, quality) * 2; bubble.innerRadiusPercent = Mathf.Lerp(limits.minInnerRadiusPercentage, limits.maxInnerRadiusPercentage, quality); bubble.lifeSpan = Mathf.Lerp(limits.minLifeSpan, limits.maxLifeSpan, quality); if (isSlowBubble) { bubble.timeScaleMultiplier = 1 / Mathf.Lerp(limits.minTimeScaleMultiplier, limits.maxTimeScaleMultiplier, quality); } else { bubble.timeScaleMultiplier = Mathf.Lerp(limits.minTimeScaleMultiplier, limits.maxTimeScaleMultiplier, quality); } Destroy(gameObject); }
public void RemoveTimeBubble(TimeBubble timeBubble) { AffectingTimeBubbles.Remove(timeBubble); }