using UnityEngine;

namespace PlatformBlock
{
  public class PlatformOnTopScript : MonoBehaviour
  {
    private void OnTriggerEnter(Collider c)
    {
      if (c.gameObject.layer == 8 && c.GetComponent<NetworkView>().isMine)
      {
        var collidereObject = gameObject.transform.parent.GetChild(1).gameObject.GetComponentInChildren<BoxCollider>();
        collidereObject.transform.localScale = new Vector3(12.0f, 1, 5);
      }
    }

    private void OnTriggerExit(Collider c)
    {
      if (c.gameObject.layer == 8 && c.GetComponent<NetworkView>().isMine)
      {
        var collidereObject = gameObject.transform.parent.GetChild(1).gameObject.GetComponentInChildren<BoxCollider>();
        collidereObject.transform.localScale = new Vector3(4.0f, 0, 5);
      }
    }
  }
}
