IEnumerator WaitSendArea() { yield return(new WaitForSeconds(0.05f)); foreach (i_AreaListener AL in myListeners) { AL.ChangeArea(NowArea); } }
IEnumerator CheckPlayerInArea() { if (AreaCode != NowArea) { if (playerTR.position.x > myBorder [2] && playerTR.position.x < myBorder [3] && playerTR.position.y <myBorder [0] && playerTR.position.y> myBorder[1]) { NowArea = AreaCode; AI.camLeftX = myBorder [4]; AI.camRightX = myBorder [5]; foreach (i_AreaListener AL in myListeners) { AL.ChangeArea(NowArea); } } } else if (!nowForceMove && (playerTR.position.x < myBorder [2] || playerTR.position.x > myBorder [3])) { StartCoroutine(IE_ForcePlayerMove()); } yield return(checkTime); StartCoroutine(CheckPlayerInArea()); }