From 766cdff5ffa72b65d7f106658d1603f47739b2ba Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Fri, 27 Oct 2023 11:05:14 +0800 Subject: + init --- GameCode/DisableIfSimple.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 GameCode/DisableIfSimple.cs (limited to 'GameCode/DisableIfSimple.cs') diff --git a/GameCode/DisableIfSimple.cs b/GameCode/DisableIfSimple.cs new file mode 100644 index 0000000..514da3d --- /dev/null +++ b/GameCode/DisableIfSimple.cs @@ -0,0 +1,17 @@ +using UnityEngine; + +public class DisableIfSimple : MonoBehaviour +{ + private void Start() + { + Unparent componentInParent = GetComponentInParent(); + if ((bool)componentInParent && (bool)componentInParent.parent) + { + base.gameObject.SetActive(!componentInParent.parent.root.GetComponentInChildren().simpleSkin); + } + else + { + base.gameObject.SetActive(!base.transform.root.GetComponentInChildren().simpleSkin); + } + } +} -- cgit v1.1-26-g67d0