public void EndSwing() { if (currentEffect != null) { currentEffect.EndSwishEffect(); currentEffect = null; } }
public void EndTrail() { CachedRigidbody2D.collisionDetectionMode = CollisionDetectionMode2D.Discrete; if (current_swishEffect != null) { current_swishEffect.EndSwishEffect(); current_swishEffect = null; } }
public void BeginSwing() { if (currentEffect != null) { currentEffect.EndSwishEffect(); } SwishEffect effect = GameObject.Instantiate(prefab_swishEffect) as SwishEffect; effect.CachedLineRenderer.SetWidth(swishStartWidth, swishEndWidth); effect.CachedTransform.SetParent(swish_Bind); effect.CachedTransform.localPosition = Vector3.zero; effect.SetColor(swishColorStart, swishColorEnd); effect.BeginSwishEffect(); currentEffect = effect; }
public void BeginTrail() { CachedRigidbody2D.collisionDetectionMode = CollisionDetectionMode2D.Continuous; bounceCount = 0; if (current_swishEffect != null) { StopAllCoroutines(); current_swishEffect.EndSwishEffect(); current_swishEffect = null; } current_swishEffect = GameObject.Instantiate(prefab_swishEffect) as SwishEffect; current_swishEffect.CachedTransform.SetParent(CachedTransform); current_swishEffect.CachedTransform.localPosition = Vector3.zero; current_swishEffect.CachedLineRenderer.SetWidth(swishStartWidth, swishEndWidth); current_swishEffect.BeginSwishEffect(); StartCoroutine(WaitToKillSwish()); }