public IEnumerator FlashCombo(CardArrow.Type arrow, Action <QuadMistCardUI> actionThis) { Action action = delegate { actionThis(this); }; return(this.cardEffect.Flash2Combo(arrow, new Action[] { action })); }
public static Vector3 ToOffset(CardArrow.Type arrow) { Int32 num = 0; Int32 num2 = 0; switch (arrow) { case CardArrow.Type.UP: num2 = -1; break; case CardArrow.Type.RIGHT_UP: num2 = -1; num = 1; break; case CardArrow.Type.RIGHT: num = 1; break; case CardArrow.Type.RIGHT_DOWN: num = 1; num2 = 1; break; case CardArrow.Type.DOWN: num2 = 1; break; case CardArrow.Type.LEFT_DOWN: num = -1; num2 = 1; break; case CardArrow.Type.LEFT: num = -1; break; case CardArrow.Type.LEFT_UP: num = -1; num2 = -1; break; } return(new Vector3((Single)num, (Single)num2, 0f)); }
public static Int32 CheckDirection(Byte arrow1, Byte arrow2, CardArrow.Type direction) { Boolean flag = CardArrow.HasDirection(arrow1, direction); Boolean flag2 = CardArrow.HasDirection(CardArrow.Reverse(arrow2), direction); if (flag && flag2) { return(2); } if (flag) { return(1); } if (flag2) { return(-1); } return(0); }
public IEnumerator Flash2Combo(CardArrow.Type arrow, params Action[] action) { Single duration = 28f / (Single)Anim.VSYNC; Single thickness = 0.04f; Single width = QuadMistCardUI.SIZE_W; Single height = QuadMistCardUI.SIZE_H; Vector3 pos = Vector3.zero; Vector3 pos2 = Vector3.zero; Vector3 pos1f = Vector3.zero; Vector3 pos2f = Vector3.zero; Vector3 sca = Vector3.zero; Vector3 sca2 = Vector3.zero; Vector3 sca1f = Vector3.zero; Vector3 sca2f = Vector3.zero; Vector3 offset = CardArrow.ToOffset(arrow); offset.y *= -1f; offset *= -1f; pos = new Vector3(offset.x * width / 2f + width / 2f, offset.y * height / 2f - height / 2f, 0f); pos2 = new Vector3(offset.x * width / 2f + width / 2f, offset.y * height / 2f - height / 2f, 0f); pos1f = pos; pos2f = pos2; offset *= -1f; switch (arrow) { case CardArrow.Type.UP: pos += new Vector3(0f, thickness / 2f * offset.y, 0f); sca = new Vector3(width, thickness, 0f); pos1f += new Vector3(0f, (height - thickness / 2f) * offset.y, 0f); sca1f = sca; break; case CardArrow.Type.RIGHT_UP: pos += new Vector3(thickness / 2f * offset.x, thickness / 2f * offset.y, 0f); sca = new Vector3(thickness, thickness, 1f); pos2 += new Vector3(thickness / 2f * offset.x, thickness / 2f * offset.y, 0f); sca2 = new Vector3(thickness, thickness, 1f); pos1f += new Vector3((width - thickness / 2f) * offset.x, height / 2f * offset.y, 0f); sca1f = new Vector3(thickness, height, 0f); pos2f += new Vector3(width / 2f * offset.x, (height - thickness / 2f) * offset.y, 0f); sca2f = new Vector3(width, thickness, 0f); break; case CardArrow.Type.RIGHT: pos2 += new Vector3(thickness / 2f * offset.x, 0f, 0f); sca2 = new Vector3(thickness, height, 0f); pos2f += new Vector3((width - thickness / 2f) * offset.x, 0f, 0f); sca2f = sca2; break; case CardArrow.Type.RIGHT_DOWN: pos += new Vector3(thickness / 2f * offset.x, thickness / 2f * offset.y, 0f); sca = new Vector3(thickness, thickness, 1f); pos2 += new Vector3(thickness / 2f * offset.x, thickness / 2f * offset.y, 0f); sca2 = new Vector3(thickness, thickness, 1f); pos1f += new Vector3((width - thickness / 2f) * offset.x, height / 2f * offset.y, 0f); sca1f = new Vector3(thickness, height, 0f); pos2f += new Vector3(width / 2f * offset.x, (height - thickness / 2f) * offset.y, 0f); sca2f = new Vector3(width, thickness, 0f); break; case CardArrow.Type.DOWN: pos += new Vector3(0f, thickness / 2f * offset.y, 0f); sca = new Vector3(width, thickness, 0f); pos1f += new Vector3(0f, (height - thickness / 2f) * offset.y, 0f); sca1f = sca; break; case CardArrow.Type.LEFT_DOWN: pos += new Vector3(thickness / 2f * offset.x, thickness / 2f * offset.y, 0f); sca = new Vector3(thickness, thickness, 1f); pos2 += new Vector3(thickness / 2f * offset.x, thickness / 2f * offset.y, 0f); sca2 = new Vector3(thickness, thickness, 1f); pos1f += new Vector3((width - thickness / 2f) * offset.x, height / 2f * offset.y, 0f); sca1f = new Vector3(thickness, height, 0f); pos2f += new Vector3(width / 2f * offset.x, (height - thickness / 2f) * offset.y, 0f); sca2f = new Vector3(width, thickness, 0f); break; case CardArrow.Type.LEFT: pos2 += new Vector3(thickness / 2f * offset.x, 0f, 0f); sca2 = new Vector3(thickness, height, 0f); pos2f += new Vector3((width - thickness / 2f) * offset.x, 0f, 0f); sca2f = sca2; break; case CardArrow.Type.LEFT_UP: pos += new Vector3(thickness / 2f * offset.x, thickness / 2f * offset.y, 0f); sca = new Vector3(thickness, thickness, 1f); pos2 += new Vector3(thickness / 2f * offset.x, thickness / 2f * offset.y, 0f); sca2 = new Vector3(thickness, thickness, 1f); pos1f += new Vector3((width - thickness / 2f) * offset.x, height / 2f * offset.y, 0f); sca1f = new Vector3(thickness, height, 0f); pos2f += new Vector3(width / 2f * offset.x, (height - thickness / 2f) * offset.y, 0f); sca2f = new Vector3(width, thickness, 0f); break; } this.combo[0].gameObject.SetActive(true); this.combo[1].gameObject.SetActive(true); Single brightness = 0f; Boolean dir = false; this.combo[0].sharedMaterial.color = new Color(1f, 1f, 1f, 1f); this.combo[1].sharedMaterial.color = new Color(1f, 1f, 1f, 1f); for (Single time = 0f; time < duration; time += Time.deltaTime) { this.Flash1BrightnessFormula(time, ref dir); if (dir && action != null) { Action[] array = action; for (Int32 i = 0; i < (Int32)array.Length; i++) { Action item = array[i]; item(); } action = null; } brightness = this.Flash2BrightnessFormula(time); this.combo[0].transform.localPosition = Vector3.Lerp(pos, pos1f, time / duration); this.combo[0].transform.localScale = Vector3.Lerp(sca, sca1f, time / duration); this.combo[1].transform.localPosition = Vector3.Lerp(pos2, pos2f, time / duration); this.combo[1].transform.localScale = Vector3.Lerp(sca2, sca2f, time / duration); this.combo[0].sharedMaterial.color = new Color(1f, 1f, 1f, brightness); this.combo[1].sharedMaterial.color = new Color(1f, 1f, 1f, brightness); yield return(0); } this.combo[0].gameObject.SetActive(false); this.combo[1].gameObject.SetActive(false); yield break; }
public static Boolean HasDirection(Byte arrow, CardArrow.Type direction) { return(((Int32)arrow & 1 << (Int32)direction) > 0); }