public void Init(Vector2Int startPlace) { mainCamera = Camera.main; moveHandler = GetComponent <MoveHandler>(); animHandler = GetComponent <PacManAnimationHandler>(); moveHandler.Init(moveSpeed, SetNextPlace); this.startPlace = startPlace; CurrentDir = Direction.Empty; reservDir = Direction.Empty; SetPlace(startPlace); }
public void Init(Vector2Int homePlace, Vector2Int stageMin, Vector2Int stageMax, Ghost partner = null) { moveHandler = GetComponent <MoveHandler>(); animHandler = GetComponent <GhostAnimationHandler>(); moveHandler.Init(moveSpeed, SetNextPlace); moveHandler.SetDestination(homePlace, homePlace); this.partner = partner; this.homePlace = homePlace; this.stageMin = stageMin; this.stageMax = stageMax; currentState = EState.Prepare; SetPlace(homePlace); PrepareAtHome(); }