12345678910111213141516171819 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class FollowShowOrHide : MonoBehaviour
- {
- public GameObject Follow;
-
- void Update()
- {
- if(this.transform.localPosition.z>0)
- this.GetComponent<MeshRenderer>().enabled=Follow.activeSelf;
- else
- {
- this.GetComponent<MeshRenderer>().enabled=true;
- }
- }
- }
|