private IEnumerator playCoroutine() { BoxScript g = null; bool canPlay = true; while (canPlay) { g = PlanMove(); if (g != null) { canPlay = true; yield return(new WaitForSeconds(1)); Vector3 destination = g.gameObject.transform.position; destination = new Vector3(destination.x, destination.y + 10, destination.z + 5); while (CameraScript.instance.gameObject.transform.position != destination) { CameraScript.instance.gameObject.transform.position = Vector3.MoveTowards( CameraScript.instance.gameObject.transform.position, destination, 5.0f * Time.deltaTime); yield return(new WaitForEndOfFrame()); } yield return(new WaitForSeconds(0.5f)); enemyState.BoxAction(g); yield return(new WaitForSeconds(0.5f)); } else { canPlay = false; yield return(new WaitForSeconds(1)); } } enemyState.ConfirmAction(); }
public void PlayBox(BoxScript box) { controlstate.BoxAction(box); }