123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using System.Collections.Generic;
- using UnityEngine;
- public class WFAnimationConnect : MonoBehaviour
- {
- public void Awake()
- {
- if (this.ConnectObj != null && 0 < this.ConnectObj.Count)
- {
- for (int i = 0; i < this.ConnectObj.Count; i++)
- {
- this.SetAllEnabled(this.ConnectObj[i].gameObject, false);
- }
- }
- }
- public void OnEnable()
- {
- if (this.ConnectObj != null && 0 < this.ConnectObj.Count)
- {
- for (int i = 0; i < this.ConnectObj.Count; i++)
- {
- this.SetAllEnabled(this.ConnectObj[i].gameObject, false);
- }
- }
- }
- public void OnFinishAnime()
- {
- if (this.ConnectObj != null && 0 < this.ConnectObj.Count)
- {
- for (int i = 0; i < this.ConnectObj.Count; i++)
- {
- this.ConnectObj[i].gameObject.SetActive(true);
- }
- }
- }
- private void SetAllEnabled(GameObject obj, bool enabled)
- {
- if (obj != null)
- {
- obj.SetActive(enabled);
- WFAnimationConnect component = obj.GetComponent<WFAnimationConnect>();
- if (component != null && 0 < component.ConnectObj.Count)
- {
- for (int i = 0; i < component.ConnectObj.Count; i++)
- {
- this.SetAllEnabled(component.ConnectObj[i].gameObject, enabled);
- }
- }
- }
- }
- public List<Animator> ConnectObj;
- }
|