コード例 #1
0
 public static new void CheckLoadPrefab()
 {
     if (prefabBubble == null)
     {
         prefabBubble = Resources.Load <TimeBubble>("TimeBubble");
     }
     if (prefabSpawner == null)
     {
         prefabSpawner = Resources.Load <TimeBubbleSpawner>("TimeBubbleSpawner");
     }
 }
コード例 #2
0
    public void AddTimeBubble(TimeBubble timeBubble)
    {
        foreach (TimeBubble tb in AffectingTimeBubbles)
        {
            if (tb == timeBubble)
            {
                return;
            }
        }

        AffectingTimeBubbles.Add(timeBubble);
    }
コード例 #3
0
    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);
    }
コード例 #4
0
 public void RemoveTimeBubble(TimeBubble timeBubble)
 {
     AffectingTimeBubbles.Remove(timeBubble);
 }