public void selectMainFlippableShape() { flippable = transform.GetChild(0).gameObject; flippableScript = transform.GetChild(0).GetComponent <Flippable>(); flippableScript.initializeFlippableShape(); colorFlippableScript = flippable.GetComponent <ColorFlippable>(); }
public void createAndFlipGhostKeyboard(Vector3 direction) { // Create ghost of player in same location, with this as parent GameObject ghost = Instantiate(flippable, transform); // Initialize Flippable ghostFlippableScript = ghost.GetComponent <Flippable>(); ghostFlippableScript.initializeFlippableShape(); // Make FlippableShape into Ghost ghostFlippableScript.makeIntoGhost(); // Disable ghost mesh ghostFlippableScript.disableMeshRenderer(); // Flip ghost towards click to check for collisions. Should be destroyed if it hits barrier object. ghostFlippableScript.flip180DegGhostKeyboard(direction); }