| . | |
| using System; |
| |
| using UnityEngine; |
| |
| |
| |
| public class AnimationObjectToggle : MonoBehaviour |
| |
| { |
| |
| private GameObject GetGameObject(string objectName) |
| |
| { |
| |
| if (this.m_parentTransform == null) |
| |
| { |
| |
| return base.transform.Find(objectName).gameObject; |
| |
| } |
| |
| return this.m_parentTransform.Find(objectName).gameObject; |
| |
| } |
| |
| |
| |
| private void HideObject(string objectName) |
| |
| { |
| |
| this.GetGameObject(objectName).SetActive(false); |
| |
| } |
| |
| |
| |
| private void ShowObject(string objectName) |
| |
| { |
| |
| this.GetGameObject(objectName).SetActive(true); |
| |
| } |
| |
| |
| |
| public Transform m_parentTransform; |
| |
| } |
| |
| |