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;
      }
    }
  }
}
