| | |
| | | this.m_Index = index;
|
| | | this.m_Instance = instanceid;
|
| | |
|
| | | m_NpcCfg = NPCConfig.Get(npcID);
|
| | | Appear(index, _actorShowConfig);
|
| | | if (npcId == 1)
|
| | | {
|
| | | Appear(index, _actorShowConfig);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_NpcCfg = NPCConfig.Get(npcID);
|
| | | Appear(index, _actorShowConfig);
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | public void Appear(int index, ActorShowConfig _actorShowConfig)
|
| | |
| | | this.actorShowModel = _actorShowConfig;
|
| | | if (m_Model == null)
|
| | | {
|
| | | m_Model = GameObjectPoolManager.Instance.RequestNpcGameObject(m_NpcId);
|
| | | m_Animator = m_Model.AddMissingComponent<Animator>();
|
| | | m_CacheLayer = m_Model.layer;
|
| | | m_Model.gameObject.SetLayer(LayerUtility.BossShow, true);
|
| | | if (npcId != 1)
|
| | | {
|
| | | m_Model = GameObjectPoolManager.Instance.RequestNpcGameObject(m_NpcId);
|
| | | m_Animator = m_Model.AddMissingComponent<Animator>();
|
| | | m_CacheLayer = m_Model.layer;
|
| | | m_Model.gameObject.SetLayer(LayerUtility.BossShow, true);
|
| | | }
|
| | | else
|
| | | {
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | m_Model = GameObject.Instantiate(hero.ClothedModel) as GameObject;
|
| | | m_Animator = m_Model.AddMissingComponent<Animator>();
|
| | | m_CacheLayer = m_Model.layer;
|
| | | m_Model.gameObject.SetLayer(LayerUtility.BossShow, true);
|
| | | }
|
| | | }
|
| | | m_Model.SetActive(true);
|
| | | m_Model.transform.position = new Vector3((float)actorShowModel.PosX[m_Index] / 200, 0, (float)actorShowModel.PosY[m_Index] / 200);
|
| | |
| | | }
|
| | |
|
| | | m_Model.transform.rotation = MathUtility.GetClientRotationFromAngle(actorShowModel.NpcFace[m_Index]);
|
| | | var controller = AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerShowSuffix, actorShowModel.mob[m_Index]);
|
| | | RuntimeAnimatorController controller = null;
|
| | | if (npcId == 1)
|
| | | {
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | var _controllerName = "A_Zs";
|
| | | if (job == 2)
|
| | | {
|
| | | _controllerName = "A_Fs";
|
| | | }
|
| | | controller = AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerShowSuffix, _controllerName);
|
| | | }
|
| | | else
|
| | | {
|
| | | controller = AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerShowSuffix, actorShowModel.mob[m_Index]);
|
| | | }
|
| | | if (controller != null)
|
| | | {
|
| | | m_CacheAnimator = m_Animator.runtimeAnimatorController;
|
| | |
| | | }
|
| | | }
|
| | | RequestCircleShadow();
|
| | | if (shadow)
|
| | | if (shadow && m_NpcId != 1)
|
| | | {
|
| | | shadow.transform.localScale = m_NpcCfg.IsBoss == 1 ? Vector3.one * 3 : Vector3.one;
|
| | | shadow.gameObject.SetLayer(LayerUtility.BossShow, true);
|
| | |
| | |
|
| | | RecyleCircleShadow();
|
| | | }
|
| | |
|
| | | public void Destroy()
|
| | | {
|
| | | if (m_Model != null)
|
| | | {
|
| | | GameObject.Destroy(m_Model);
|
| | | m_Model = null;
|
| | | }
|
| | | if (sfxController != null)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(sfxController);
|
| | | sfxController = null;
|
| | | }
|
| | | RecyleCircleShadow();
|
| | | }
|
| | | }
|