Created
April 8, 2018 14:32
-
-
Save am1tanaka/5e3680376a2835b5355dc1baebe2ac88 to your computer and use it in GitHub Desktop.
頭がぶつかったら即落ちてくるようにするコード
This file contains hidden or 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
| private void OnCollisionEnter2D(Collision2D collision) | |
| { | |
| if ((m_MoveVector.y > 0f) && (collision.gameObject.GetComponent<PlatformEffector2D>() == null)) | |
| { | |
| m_MoveVector.y = 0f; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment