| 1234567891011121314151617181920212223 |
- using UnityEngine;
- namespace PlatformBlock
- {
- public class PlatformColliderScript : MonoBehaviour
- {
- private void OnTriggerEnter(Collider c)
- {
- if (c.gameObject.layer == 8 && c.GetComponent<NetworkView>().isMine)
- {
- gameObject.transform.parent.GetChild(1).gameObject.GetComponentInChildren<BoxCollider>().enabled = false;
- }
- }
- private void OnTriggerExit(Collider c)
- {
- if (c.gameObject.layer == 8 && c.GetComponent<NetworkView>().isMine)
- {
- gameObject.transform.parent.GetChild(1).gameObject.GetComponentInChildren<BoxCollider>().enabled = true;
- }
- }
- }
- }
|