Created
August 7, 2019 17:19
-
-
Save FrankNine/3e33e6264b8aedc2ab857900d2e27964 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class BlockRotation : MonoBehaviour | |
{ | |
private bool _isOverlapped; | |
private void Update() | |
{ | |
if (Input.GetKeyDown(KeyCode.E) && _isOverlapped) | |
{ | |
Debug.Log("Flip"); | |
} | |
} | |
private void OnTriggerEnter(Collider other) | |
{ | |
_isOverlapped = true; | |
} | |
private void OnTriggerExit(Collider other) | |
{ | |
_isOverlapped = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment