Created
September 19, 2019 09:32
-
-
Save IshidaGames/fa5a989beeb5cb2610f8d7d07e9b16a1 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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Collision : MonoBehaviour { | |
Camera cam; | |
GameObject mainCamObj; | |
void Start() | |
{ | |
cam = Camera.main; | |
mainCamObj = Camera.main.gameObject; | |
} | |
//OnTrigger,OnCollisionだと衝突している間 | |
//Enterだと衝突した瞬間 | |
//Stayだと衝突している間 | |
//Exitだと衝突が終わった瞬間 | |
private void OnTriggerEnter(Collider other) | |
{ | |
if(other.gameObject.tag == "Right") | |
{ | |
} | |
} | |
private void OnCollisionEnter(UnityEngine.Collision collision) | |
{ | |
if(collision.gameObject.tag == "Left") | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment