Files
BH3/Assets/Scripts/Assembly-CSharp/MoleMole/MonoTestWeapon.cs
2025-08-13 09:26:42 +08:00

34 lines
936 B
C#

using UnityEngine;
namespace MoleMole
{
public class MonoTestWeapon : MonoBehaviour
{
public void Awake()
{
Transform child = base.transform.GetChild(0);
if (!child.gameObject.activeSelf)
{
child = base.transform.GetChild(1);
}
SetupWeaponView(child.gameObject);
}
private void SetupWeaponView(GameObject weaponGo)
{
if ((bool)weaponGo.transform.Find("TransformCopy"))
{
Transform transform = weaponGo.transform.Find("TransformCopy");
weaponGo.transform.localPosition = transform.localPosition;
weaponGo.transform.localEulerAngles = transform.localEulerAngles;
weaponGo.transform.localScale = transform.localScale;
}
if (weaponGo.transform.Find("ShortSword") != null && weaponGo.transform.Find("LongSword") != null)
{
weaponGo.transform.Find("ShortSword").gameObject.SetActive(false);
weaponGo.transform.Find("LongSword").gameObject.SetActive(true);
}
}
}
}