mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-16 16:34:41 +01:00
34 lines
936 B
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|