/// <summary> /// Release the coroutine. /// </summary> /// <returns>The coroutine.</returns> private IEnumerator ReleaseCoroutine() { Image image = TR_CommonUtil.FindChildByTag(transform, "Fill").GetComponent <Image> (); while (image.fillAmount > 0) { image.fillAmount -= 0.02f; yield return(new WaitForSeconds(0.005f)); } }
/// <summary> /// On the start hit collider event. /// </summary> /// <param name="hit2d">Hit2d.</param> private void OnStartHitCollider(RaycastHit2D hit2d) { path = hit2d.transform.GetComponentInParent <TR_Path> (); pathFillImage = TR_CommonUtil.FindChildByTag(path.transform, "Fill").GetComponent <Image> (); if (path.completed || !shape.IsCurrentPath(path)) { ReleasePath(); } else { path.StopAllCoroutines(); TR_CommonUtil.FindChildByTag(path.transform, "Fill").GetComponent <Image> ().color = currentPencilColor; } }