/// <summary> /// さんご礁アウト /// </summary> /// <param name="position"></param> /// <param name="callback"></param> /// <returns></returns> private IEnumerator CoralReefNoticeOUT(CORAL_POSITION position, System.Action callback) { float totalTime = 0; while(totalTime < 2f){ float time = Time.deltaTime; totalTime += time; this.coralReefNoticeAnchor.relativeOffset -= new Vector2(0, time * 0.5f); yield return null; } this.coralReefNoticeAnchor.relativeOffset = new Vector2(0, -1.2f); this.coralReefNoticeAnchor.transform.gameObject.SetActive (false); if(callback != null) callback(); }
/// <summary> /// さんご礁イン /// </summary> /// <param name="position"></param> /// <param name="callback"></param> /// <returns></returns> private IEnumerator CoralReefNoticeIN(CORAL_POSITION position, System.Action callback) { this.coralReefNoticeAnchor.relativeOffset = new Vector2(0, -1.7f); var anchorX = 0f; switch (position) { case CORAL_POSITION.LEFT: anchorX = -0.333f; break; case CORAL_POSITION.CENTER: anchorX = 0f; break; case CORAL_POSITION.RIGHT: anchorX = 0.333f; break; } this.coralReefNoticeAnchor.relativeOffset = new Vector2(anchorX, this.coralReefNoticeAnchor.relativeOffset.y); float totalTime = 0; while(totalTime < 2f){ float time = Time.deltaTime; totalTime += time; this.coralReefNoticeAnchor.relativeOffset += new Vector2(0, time * 0.5f); yield return null; } if(callback != null) callback(); }