public override bool GameUpdate() { age += Time.deltaTime; Vector3 p = launchPoint + launchVelocity * age; p.y -= 0.5f * 9.81f * age * age; if (p.y <= 0f) { Game.SpawnExplosion().Initialize(targetPoint, blastRadius, damage); OriginWarFactory.ReClanim(this); return(false); } transform.localPosition = p; Vector3 d = launchVelocity; d.y -= 9.8f * age; transform.localRotation = Quaternion.LookRotation(d); Game.SpawnExplosion().Initialize(p, 0.1f); return(true); }
public override bool GameUpdate() { age += Time.deltaTime; if (age >= duration) { OriginWarFactory.ReClanim(this); return(false); } if (propertyBlock == null) { propertyBlock = new MaterialPropertyBlock(); } float t = age / duration; Color c = Color.clear; c.a = opacityCurve.Evaluate(t); propertyBlock.SetColor(colorPropetyID, c); meshRender.SetPropertyBlock(propertyBlock); transform.localScale = Vector3.one * (scale * scaleCurve.Evaluate(t)); return(true); }