public override void notify() { textCollider2d.Text = Mathf.Ceil(time.TimeLeft) + ""; if (wentNegative) { if (time.TimeLeft >= 10) { wentNegative = false; if (!flashEffect.isDone) { flashEffect.isDone = true; } textCollider2d.Color = GameConstantes.instance.currentTheme.instructionColor; textCollider2d.Color = Color.magenta; } } else { if (time.TimeLeft < 10) { wentNegative = true; flashEffect = GameConstantes.instance.currentTheme.createTimeGoingUnder10Gradient(textCollider2d); EffectManager.AddGameEffect(flashEffect); } } }
public void flashCompileEffect() { TextCollider2D instructionTC = this.GetComponent <TextCollider2D> (); Effect effect = GameConstantes.instance.currentTheme.createInstructionFlashEffect(instructionTC, true); EffectManager.AddGameEffect(effect); }
void OnTriggerEnter2D(Collider2D other) { Parameter param = other.GetComponent <Parameter>(); if (param != null && param.canBeChanged) { Effect e = GameConstantes.instance.currentTheme.createParameterHighlightEffect(param); EffectManager.AddGameEffect(e); this.collidedParameter = param; } }
bool IDeletable.Delete(Spike spike) { if (!invulnerable) { int spikeX = (int)spike.transform.position.x; int parentX = (int)this.transform.position.x; int x = spikeX - parentX; EffectManager.AddGameEffect(new SplitTextEffect(this.GetComponent <TextCollider2D>(), x)); } return(!invulnerable); }
public override IEnumerator Initialize() { yield return(new WaitForSeconds(0)); initialized = true; if (spikeManager != null) { transform.position = spikeManager.transform.position + new Vector3(0, 2, 0); colorEffect = new ColorChangeEffect(textCollider2D, textCollider2D.Color, new Color(textCollider2D.Color.r, textCollider2D.Color.g, textCollider2D.Color.b, 1), 2); EffectManager.AddGameEffect(colorEffect); moveEffect = new MoveEffect(textCollider2D, spikeManager.transform.position, 2, true); EffectManager.AddGameEffect(moveEffect); } }
void swap(Parameter hitedParameter, Parameter parameterDragged) { if (!hitedParameter.isSameType(parameterDragged)) { return; } TextCollider2D textColliderHited = hitedParameter.GetComponent <TextCollider2D>(); TextCollider2D textColliderInDrag = parameterDragged.GetComponent <TextCollider2D>(); Color c1t1 = textColliderHited.Color; Color c1t0 = new Color(c1t1.r, c1t1.g, c1t1.b, 0); Color c2t1 = textColliderInDrag.Color; Color c2t0 = new Color(c1t1.r, c1t1.g, c1t1.b, 0); EffectManager.AddGameEffect(new ColorChangeEffect(textColliderHited, c1t0, c1t1, GameConstantes.instance.currentTheme.timeOnInstructionSwap)); EffectManager.AddGameEffect(new ColorChangeEffect(textColliderInDrag, c2t0, c2t1, GameConstantes.instance.currentTheme.timeOnInstructionSwap)); hitedParameter.swapWith(parameterDragged); }
void swap(Parameter hitedParameter, Parameter parameterDragged) { if (!hitedParameter.isSameType(parameterDragged)) { AudioPlayer.Play("Synth_Impact_Static_7"); // Player tries an invalid variable swap return; } AudioPlayer.Play("Voice_Impact_Down_1"); // Player successfuly swaps variables TextCollider2D textColliderHited = hitedParameter.GetComponent <TextCollider2D>(); TextCollider2D textColliderInDrag = parameterDragged.GetComponent <TextCollider2D>(); Color c1t1 = textColliderHited.Color; Color c1t0 = new Color(c1t1.r, c1t1.g, c1t1.b, 0); Color c2t1 = textColliderInDrag.Color; Color c2t0 = new Color(c1t1.r, c1t1.g, c1t1.b, 0); EffectManager.AddGameEffect(new ColorChangeEffect(textColliderHited, c1t0, c1t1, GameConstantes.instance.currentTheme.timeOnInstructionSwap)); EffectManager.AddGameEffect(new ColorChangeEffect(textColliderInDrag, c2t0, c2t1, GameConstantes.instance.currentTheme.timeOnInstructionSwap)); hitedParameter.swapWith(parameterDragged); }