public IEnumerator Jump() //this is getting back onto the blocks //turning on the windy { WindZoneHard.SetActive(true); WindZoneMed.SetActive(true); WindZoneBleh.SetActive(true); VulnerableParticle.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear); Vector3 potStartPos = this.transform.position; Vector3 potEndPos = BlockPositions[Blocks.Count].position + Vector3.up * -BlockHeight / 2.0f; Vector3 potPeakPos = Utility.CreatePeak(potStartPos, potEndPos, Blocks.Count * 3 + 4); float startTime = Time.time; while (Time.time < startTime + FallTime) { float t = (Time.time - startTime) / FallTime; Vector3 potPos = Interpolation.BezierCurve(potStartPos, potPeakPos, potEndPos, t); this.transform.position = potPos; yield return(null); } this.transform.position = potEndPos; stateMachine.ChangeState("Boss3_Snowball"); }
private IEnumerator Reload() { hasReloaded = false; if (!currRocket) { currRocket = GameObject.Instantiate(RocketPrefab, this.transform); currRocket.transform.position = RocketPos.position; } float startTime = Time.time; while (Time.time < startTime + AttackSpeed) { float t = (Time.time - startTime) / AttackSpeed; Vector3 rocketPos = Interpolation.BezierCurve(RocketPos.position, ChargedRocketPos.position, t); currRocket.transform.position = rocketPos; yield return(null); } Debug.Log(ChargedRocketPos); currRocket.transform.position = ChargedRocketPos.position; hasReloaded = true; AudioManager.Instance.PlaySound("lever", ESoundChannel.SFX); }
public override void Charge() { charge += Time.deltaTime / AttackSpeed; charge = Mathf.Min(charge, 1.0f); float t = Interpolation.CubicOut(charge); Vector3 spearPos = Interpolation.BezierCurve(StartPos, spearChargePos.localPosition, t); spearModel.transform.localPosition = spearPos; this.currentDamage = Mathf.Lerp(MinDamage, Damage, charge);//charge == 1 ? Damage : MinDamage; this.currentKnockback = charge == 1 ? Knockback : MinKnockback; }
// Update is called once per frame void Update() { if (parentCtrl.GetBathing()) { spriteRenderer.sprite = BathingEffectSprite; isBathing = true; effectFrame += parentCtrl.AddFrameToFriedTime(); MaterialColor = Interpolation.BezierCurve(startColor, centerColor, finishColor, effectFrame); } if (isBathing && parentCtrl.GetGrab()) { spriteRenderer.sprite = NormalEffectSprite; } }
public override void Charge() { if (!currArrow) { currArrow = GameObject.Instantiate(ArrowPrefab, this.transform); //currArrow = arrowPool.Create(); //currArrow.transform.SetParent(this.transform); } charge += Time.deltaTime / AttackSpeed; charge = Mathf.Min(charge, 1.0f); float t = Interpolation.CubicOut(charge); Vector3 arrowPos = Interpolation.BezierCurve(this.transform.position, ChargedArrowPos.position, t); currArrow.transform.position = arrowPos; }
// Update is called once per frame void Update() { if (parentCtrl.IsProtect() || parentCtrl.IsHit()) { CreateDestroyTrans(); return; } var add = 1.0f / 60.0f / (float)parentCtrl.GetOilFlyhitTime(); frame += add; MaterialColor = Interpolation.BezierCurve(startColor, centerColor, finishColor, frame); var nowScale = ScaleX; nowScale = Mathf.Max(nowScale - ScaleSpeed, MinScale); //ScaleX = ScaleY = nowScale; }
public void SetLineRenderPoints() { int amo = 11; renderer.positionCount = amo; Vector3[] positions = { Interpolation.BezierCurve((BarrelChargePos.position + BarrelChargePos.forward), Peak.position, Target.position, 0.0f), Interpolation.BezierCurve((BarrelChargePos.position + BarrelChargePos.forward), Peak.position, Target.position, 0.1f), Interpolation.BezierCurve((BarrelChargePos.position + BarrelChargePos.forward), Peak.position, Target.position, 0.2f), Interpolation.BezierCurve((BarrelChargePos.position + BarrelChargePos.forward), Peak.position, Target.position, 0.3f), Interpolation.BezierCurve((BarrelChargePos.position + BarrelChargePos.forward), Peak.position, Target.position, 0.4f), Interpolation.BezierCurve((BarrelChargePos.position + BarrelChargePos.forward), Peak.position, Target.position, 0.5f), Interpolation.BezierCurve((BarrelChargePos.position + BarrelChargePos.forward), Peak.position, Target.position, 0.6f), Interpolation.BezierCurve((BarrelChargePos.position + BarrelChargePos.forward), Peak.position, Target.position, 0.7f), Interpolation.BezierCurve((BarrelChargePos.position + BarrelChargePos.forward), Peak.position, Target.position, 0.8f), Interpolation.BezierCurve((BarrelChargePos.position + BarrelChargePos.forward), Peak.position, Target.position, 0.9f), Interpolation.BezierCurve((BarrelChargePos.position + BarrelChargePos.forward), Peak.position, Target.position, 1.0f) }; renderer.SetPositions(positions); }
private IEnumerator FireAnimation() { if (target == null) { yield break; } Vector3 startPos = this.transform.position; Vector3 peak = Utility.CreatePeak(startPos, target.transform.position, PeakHeight); float startTime = Time.time; float length = (target.transform.position - startPos).magnitude * SpeedOverTime; while (Time.time < startTime + length) { float t = (Time.time - startTime) / length; if (target != null) { Vector3 pos = Interpolation.BezierCurve(startPos, peak, target.transform.position, t); this.transform.position = pos; } else { Dissipate(); yield break; } yield return(null); } Dissipate(); if (target != null) { this.transform.position = target.transform.position; } }
private IEnumerator Reload() { hasReloaded = false; if (!currArrow) { currArrow = GameObject.Instantiate(ArrowPrefab, this.transform); currArrow.transform.position = ArrowPos.position; } float startTime = Time.time; while (Time.time < startTime + AttackSpeed) { float t = (Time.time - startTime) / AttackSpeed; Vector3 arrowPos = Interpolation.BezierCurve(ArrowPos.position, ChargedArrowPos.position, t); currArrow.transform.position = arrowPos; yield return(null); } currArrow.transform.position = ChargedArrowPos.position; hasReloaded = true; }
public void Move(float add) { frame += add; Position = Interpolation.BezierCurve(start, middle, end, frame); }
// Update is called once per frame void Update() { MaterialColor = Interpolation.BezierCurve(Color.cyan, Color.blue, Colors.Navy, sunCtrl.GetFrame()); }
private IEnumerator FallDown() { //Turning off the wind zone WindZoneHard.SetActive(false); WindZoneMed.SetActive(false); WindZoneBleh.SetActive(false); this.transform.rotation = Quaternion.Euler(0, -90, 0); // Variables Vector3[] startPos = new Vector3[Blocks.Count]; Vector3[] endPos = new Vector3[Blocks.Count]; Transform block = Blocks[0].transform; startPos[0] = block.position; endPos[0] = block.position + block.right * BlockMoveDistance; for (int i = 1; i < Blocks.Count; i++) { startPos[i] = Blocks[i].transform.position; endPos[i] = BlockPositions[i - 1].position; } Vector3 potStartPos = this.transform.position; Vector3 potEndPos = BlockPositions[Blocks.Count - 1].position + Vector3.up * -BlockHeight / 2.0f; // Move Pots and Block to new Destination float startTime = Time.time; while (Time.time < startTime + BlockMoveTime) { float t = (Time.time - startTime) / BlockMoveTime; for (int i = 0; i < Blocks.Count; i++) { Vector3 pos = Vector3.Lerp(startPos[i], endPos[i], t); Blocks[i].transform.position = pos; } Vector3 potPos = Vector3.Lerp(potStartPos, potEndPos, t); this.transform.position = potPos; yield return(null); } for (int i = 1; i < Blocks.Count; i++) { Blocks[i].transform.position = endPos[i]; } this.transform.position = potEndPos; Blocks.RemoveAt(0); Destroy(block.gameObject); // Pot Stun Movement potStartPos = this.transform.position; potEndPos = VulnerablePosition.position; Vector3 potPeakPos = Utility.CreatePeak(potStartPos, potEndPos, Blocks.Count * 3 + 4); startTime = Time.time; while (Time.time < startTime + FallTime) { float t = (Time.time - startTime) / FallTime; Vector3 potPos = Interpolation.BezierCurve(potStartPos, potPeakPos, potEndPos, t); this.transform.position = potPos; yield return(null); } this.transform.position = potEndPos; stateMachine.ChangeState("Boss3_Vulnerable"); VulnerableParticle.Play(); StartCoroutine(Teeter()); }