IEnumerator OtherThingsChange() { yield return(NextClick()); yield return(NextClick()); tutoStar.GetComponent <TutoStar> ().StartCoroutine("MakeMove"); yield return(NextClick()); yield return(NextClick()); tutoStar.SetActive(false); checkMark.SetActive(true); checkMark.transform.position = board.getNodePos(checkmarkSpot1.x, checkmarkSpot1.y); yield return(NextClick()); pathDisplay.GetComponent <PathDisplay> ().DisplayPath(path1.ToArray()); yield return(NextClick()); yield return(NextClick()); board.MarkNodes(nodesToMark.ToArray()); pathDisplay.GetComponent <PathDisplay> ().DisplayPath(path2.ToArray()); checkMark.SetActive(false); yield return(NextClick()); checkMark.SetActive(true); checkMark.transform.position = (board.getNodePos(checkmarkSpot2.x, checkmarkSpot2.y)); yield return(NextClick()); }
public IEnumerator MakeMove() { foreach (Vector2Int spot in moveSpots) { rigid.velocity = (board.getNodePos(spot.x, spot.y) - transform.position) / moveTime; yield return(new WaitForSeconds(moveTime)); rigid.velocity = Vector2.zero; yield return(new WaitForSeconds(waitTime)); } }
void Start() { board = boardObject.GetComponent <TutorialBoard> (); rigid = GetComponent <Rigidbody2D> (); transform.position = board.getNodePos(0, 2); }