void ProcessBullet(Bullet lastBullet) { splitterColor = lastBullet.GetColor(); isCharged = (splitterColor != GameColor.COLOR_WHITE); SetEmitterColor(ColorDefs.GetColor(splitterColor)); Destroy(lastBullet.gameObject); }
void ProcessBullet(Bullet bulletHit) { if (chargeToggle) { emitterCharge_1 = bulletHit.GetColor(); chargeToggle = !chargeToggle; } else { emitterCharge_2 = bulletHit.GetColor(); chargeToggle = !chargeToggle; } if (emitterCharge_1 != GameColor.COLOR_WHITE && emitterCharge_2 != GameColor.COLOR_WHITE) { GameColor color = ColorDefs.CombineColors(emitterCharge_1, emitterCharge_2); emitterColor = color; SetEmitterColor(ColorDefs.GetColor(emitterColor)); isCharged = (emitterColor != GameColor.COLOR_WHITE); emitterCharge_1 = GameColor.COLOR_WHITE; emitterCharge_2 = GameColor.COLOR_WHITE; } bulletHit.RemoveBullet(); }
public void SetColor(GameColor newColor) { if (sprite == null) { sprite = GetComponent <SpriteRenderer>(); } if (trail == null) { trail = GetComponent <TrailRenderer>(); } if (particle == null) { particle = GetComponent <ParticleSystem>(); } bulletColor = newColor; Color color = ColorDefs.GetColor(bulletColor); sprite.color = color; trail.startColor = color; trail.endColor = new Color(color.r, color.g, color.b, 0.0f); ParticleSystem.MainModule settings = particle.main; settings.startColor = new ParticleSystem.MinMaxGradient(color); }
bool IsWeakTo(ColorDefs.DefiniteColor incomingType) { switch (absColor) { case ColorDefs.DefiniteColor.CO_RED: return (incomingType == ColorDefs.DefiniteColor.CO_GREEN); case ColorDefs.DefiniteColor.CO_BLUE: return (incomingType == ColorDefs.DefiniteColor.CO_ORANGE); case ColorDefs.DefiniteColor.CO_YELLOW: return (incomingType == ColorDefs.DefiniteColor.CO_PURPLE); case ColorDefs.DefiniteColor.CO_PURPLE: return (incomingType == ColorDefs.DefiniteColor.CO_YELLOW); case ColorDefs.DefiniteColor.CO_GREEN: return (incomingType == ColorDefs.DefiniteColor.CO_RED); case ColorDefs.DefiniteColor.CO_ORANGE: return (incomingType == ColorDefs.DefiniteColor.CO_BLUE); default: return false; } }
public void ChangeColor(ColorDefs.DefiniteColor parentColor) { if (mySprite == null) { Start(); } AbsColor = parentColor; switch(parentColor) { case ColorDefs.DefiniteColor.CO_RED: mySprite.color = Color.red; break; case ColorDefs.DefiniteColor.CO_BLUE: mySprite.color = Color.blue; break; case ColorDefs.DefiniteColor.CO_YELLOW: mySprite.color = Color.yellow; break; case ColorDefs.DefiniteColor.CO_PURPLE: mySprite.color = new Color(0.5f, 0.0f, 0.5f, 1.0f); break; case ColorDefs.DefiniteColor.CO_GREEN: mySprite.color = Color.green; break; case ColorDefs.DefiniteColor.CO_ORANGE: mySprite.color = Color.red + (Color.green * 0.5f); break; case ColorDefs.DefiniteColor.CO_WHITE: mySprite.color = Color.white; break; case ColorDefs.DefiniteColor.CO_BLACK: mySprite.color = Color.black; break; case ColorDefs.DefiniteColor.CO_GREY: mySprite.color = Color.gray; break; } }
public static void EnemyKilled(ColorDefs.DefiniteColor killedColor) { switch (killedColor) { case ColorDefs.DefiniteColor.CO_RED: redVal += bulletCost * 5; break; case ColorDefs.DefiniteColor.CO_BLUE: blueVal += bulletCost * 5; break; case ColorDefs.DefiniteColor.CO_YELLOW: yellowVal += bulletCost * 5; break; case ColorDefs.DefiniteColor.CO_PURPLE: redVal += bulletCost * 3; blueVal += bulletCost * 3; break; case ColorDefs.DefiniteColor.CO_GREEN: blueVal += bulletCost * 3; yellowVal += bulletCost * 3; break; case ColorDefs.DefiniteColor.CO_ORANGE: redVal += bulletCost * 3; yellowVal += bulletCost * 3; break; default: redVal += bulletCost * 2; blueVal += bulletCost * 2; yellowVal += bulletCost * 2; break; } redVal = Mathf.Min(redVal, maxColorVal); blueVal = Mathf.Min(blueVal, maxColorVal); yellowVal = Mathf.Min(yellowVal, maxColorVal); }
public ColorNode(ColorDefs.DefiniteColor _selectedColor) { selectedColor = _selectedColor; }
// Use this for initialization void Start() { SetEmitterColor(ColorDefs.GetColor(emitterColor)); }
void SetColor() { sprite.color = ColorDefs.GetColor(playerColor); }