private bool destIsValidTile(int nextI, int nextJ) { if (!onGrid(nextI, nextJ)) { return(false); } tileStuff tileScript = tiles [nextI, nextJ].GetComponent <tileStuff> (); if (!usingElevator) { if (tileScript.getIsPlatform()) { return(false); } if (tileScript.getHasElevCat()) { return(true); } int checkIsPlatJ = nextJ - 1; if (onGrid(nextI, checkIsPlatJ)) { tileScript = tiles [nextI, checkIsPlatJ].GetComponent <tileStuff> (); if (!tileScript.getIsPlatform()) { dest = new Vector3(nextI, nextJ, 0f); // setFallingDest (nextI, checkIsPlatJ); floating = true; return(true); } } else { return(false); } return(true); } else { if (nextJ > elevCatMaxJ || nextJ < elevCatMinJ) { return(false); } //fixme use an elev cat counter? if (tileScript.getIsPlatform()) { return(false); } return(true); } }
private void checkSpawningCats() { int nextI = boyTileI; // - 1; int nextJ = boyTileJ; // if (facingRight) { // nextI = boyTileI + 1; // } //a platform cat? if (Input.GetKeyUp("1") || Input.GetMouseButtonUp(1)) { // nextJ--; if (onGrid(nextI, nextJ - 1)) { tileStuff tileScript = tiles [nextI, nextJ].GetComponent <tileStuff> (); tileStuff belowTile = tiles [nextI, nextJ - 1].GetComponent <tileStuff> (); if (reachedDestination() && !belowTile.getHasElevCat() && !tileScript.getIsPlatform() && !tileScript.getHasElevCat()) { tileScript.placeCat(elevCat, elevCatPrefab, gridCont.tileSize); } } } }