2023-09-12 07:41:11 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
|
|
namespace BlueWaterProject
|
|
|
|
{
|
2023-09-13 03:23:27 +00:00
|
|
|
public class HumanAi : BaseAi
|
2023-09-12 07:41:11 +00:00
|
|
|
{
|
|
|
|
#region Properties and variables
|
|
|
|
|
|
|
|
// 모델링 관련 변수
|
|
|
|
protected Transform backpackContainer;
|
|
|
|
protected Transform leftWeaponContainer;
|
|
|
|
protected Transform leftShieldContainer;
|
|
|
|
protected Transform headContainer;
|
|
|
|
protected Transform rightWeaponContainer;
|
|
|
|
protected Transform bodyContainer;
|
|
|
|
protected Transform flagContainer;
|
|
|
|
|
2023-09-12 14:46:57 +00:00
|
|
|
#endregion
|
|
|
|
|
2023-09-12 07:41:11 +00:00
|
|
|
#region Unity built-in methods
|
|
|
|
|
|
|
|
protected virtual void Awake()
|
|
|
|
{
|
|
|
|
InitComponent();
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region Custom methods
|
|
|
|
|
2023-09-13 03:23:27 +00:00
|
|
|
protected virtual void InitComponent()
|
2023-09-12 07:41:11 +00:00
|
|
|
{
|
|
|
|
backpackContainer = Utils.GetComponentAndAssert<Transform>(transform.
|
|
|
|
Find("Bip001/Bip001 Pelvis/Bip001 Spine/Backpack_container"));
|
|
|
|
leftWeaponContainer = Utils.GetComponentAndAssert<Transform>(transform.
|
|
|
|
Find("Bip001/Bip001 Pelvis/Bip001 Spine/Bip001 L Clavicle/Bip001 L UpperArm/Bip001 L Forearm/Bip001 L Hand/L_hand_container"));
|
|
|
|
leftShieldContainer = Utils.GetComponentAndAssert<Transform>(transform.
|
|
|
|
Find("Bip001/Bip001 Pelvis/Bip001 Spine/Bip001 L Clavicle/Bip001 L UpperArm/Bip001 L Forearm/Bip001 L Hand/L_shield_container"));
|
|
|
|
headContainer = Utils.GetComponentAndAssert<Transform>(transform.
|
|
|
|
Find("Bip001/Bip001 Pelvis/Bip001 Spine/Bip001 Neck/Bip001 Head/Head_container"));
|
|
|
|
rightWeaponContainer = Utils.GetComponentAndAssert<Transform>(transform.
|
|
|
|
Find("Bip001/Bip001 Pelvis/Bip001 Spine/Bip001 R Clavicle/Bip001 R UpperArm/Bip001 R Forearm/Bip001 R Hand/R_hand_container"));
|
|
|
|
bodyContainer = Utils.GetComponentAndAssert<Transform>(transform.
|
|
|
|
Find("Body_container"));
|
|
|
|
flagContainer = Utils.GetComponentAndAssert<Transform>(transform.
|
|
|
|
Find("Flag_container"));
|
|
|
|
}
|
2023-09-12 14:46:57 +00:00
|
|
|
|
|
|
|
protected void SetActiveViewModel(Transform container, int model)
|
|
|
|
{
|
|
|
|
foreach (Transform item in container)
|
|
|
|
{
|
|
|
|
if (!item.gameObject.activeSelf) continue;
|
|
|
|
|
|
|
|
item.gameObject.SetActive(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (model != -1)
|
|
|
|
{
|
|
|
|
container.GetChild(model).gameObject.SetActive(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-12 07:41:11 +00:00
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|