| | |
| | | private SkinnedMeshRenderer treasureSkin;
|
| | | private Transform bottom;
|
| | | private Transform name;
|
| | | private TextMesh condition;
|
| | |
|
| | | #region 红点
|
| | | private Transform potentialRed;
|
| | |
| | |
|
| | | static Dictionary<TreasureCategory, GameObjectPoolManager.GameObjectPool> m_BottomPoolDict = new Dictionary<TreasureCategory, GameObjectPoolManager.GameObjectPool>();
|
| | | static Dictionary<TreasureState, GameObjectPoolManager.GameObjectPool> m_StatePoolDict = new Dictionary<TreasureState, GameObjectPoolManager.GameObjectPool>();
|
| | | static GameObjectPoolManager.GameObjectPool m_ConditionPool;
|
| | | static Vector3 m_CacheBottomScale = Vector3.zero;
|
| | |
|
| | | TreasureModel m_Model;
|
| | |
| | | return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<TreasureModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | AchievementModel achievementModel { get { return ModelCenter.Instance.GetModel<AchievementModel>(); } }
|
| | |
|
| | | public void SetActive(bool _active)
|
| | | {
|
| | |
| | | RecycleLockEffect();
|
| | | RecycleCollectingSfx();
|
| | | RecycleRedpoint();
|
| | | RecycleCondition();
|
| | | RedpointCenter.Instance.redpointValueChangeEvent -= RedpointValueChangeEvent;
|
| | | }
|
| | | interactProcessor.SetActive(_active);
|
| | |
| | | RecycleCollectingSfx();
|
| | | RequestTreasureEffect();
|
| | | RecycleLockEffect();
|
| | | RecycleCondition();
|
| | | break;
|
| | | case TreasureState.Collecting:
|
| | | RequestTreasureEffect();
|
| | | RequestCollectingSfx();
|
| | | RecycleLockEffect();
|
| | | RecycleCondition();
|
| | | break;
|
| | | case TreasureState.Locked:
|
| | | RecycleCollectingSfx();
|
| | | RecycleTreasureEffect();
|
| | | RequestLockEffect();
|
| | | RequestCondition();
|
| | | break;
|
| | | }
|
| | | if (model.GetTreasureUnlockShow(UI3DTreasureSelectStage.Instance.currentCategory) == _treasure.id)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | void RequestCondition()
|
| | | {
|
| | | RecycleCondition();
|
| | |
|
| | | if (category != TreasureCategory.Human)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | string displayStr = string.Empty;
|
| | | if (model.IsVersionUnOpenTreasure(treasureId))
|
| | | {
|
| | | displayStr = "=";
|
| | | }
|
| | | else
|
| | | {
|
| | | Achievement achievement = null;
|
| | | var achievementId = 0;
|
| | | var unlock = false;
|
| | | if (model.TryGetTreasureUnlockAchievement(treasureId, out achievementId))
|
| | | {
|
| | | if (achievementModel.TryGetAchievement(achievementId, out achievement))
|
| | | {
|
| | | unlock = true;
|
| | | }
|
| | | }
|
| | | if (unlock && !achievement.completed)
|
| | | {
|
| | | var _achievementConfig = Config.Instance.Get<SuccessConfig>(achievementId);
|
| | | var _missionId = _achievementConfig.Condition[0];
|
| | | var _taskConfig = Config.Instance.Get<PyTaskConfig>(_missionId);
|
| | | if (_taskConfig == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (_achievementConfig.Type == 3)
|
| | | {
|
| | | displayStr = StringUtility.Contact(_taskConfig.lv, "+");
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (string.IsNullOrEmpty(displayStr))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (m_ConditionPool == null)
|
| | | {
|
| | | var _prefab = UILoader.LoadPrefab("TreasureCondition");
|
| | | m_ConditionPool = GameObjectPoolManager.Instance.RequestPool(_prefab);
|
| | | }
|
| | | condition = m_ConditionPool.Request().GetComponent<TextMesh>();
|
| | | condition.gameObject.SetActive(true);
|
| | | condition.transform.SetParent(root);
|
| | | condition.transform.localPosition = Vector3.zero;
|
| | | condition.transform.LookAt(UI3DTreasureSelectStage.Instance.center);
|
| | | condition.transform.localPosition = new Vector3(0, -1.75f, 0f);
|
| | | condition.transform.localScale = new Vector3(-1, 1, 1);
|
| | | condition.text = displayStr;
|
| | | LayerUtility.SetLayer(condition.gameObject, LayerUtility.UILayer, true);
|
| | | }
|
| | |
|
| | | void RecycleCondition()
|
| | | {
|
| | | if (m_ConditionPool != null && condition != null)
|
| | | {
|
| | | m_ConditionPool.Release(condition.gameObject);
|
| | | condition = null;
|
| | | }
|
| | | }
|
| | |
|
| | | public Vector3 GetAdaptiveDistance(Vector3 _distance)
|
| | | {
|
| | | var normal = Constants.DESIGN_RESOLUTION.x / Constants.DESIGN_RESOLUTION.y;
|
| | |
| | | RecycleBackLight();
|
| | | RecycleLockEffect();
|
| | | RecycleRedpoint();
|
| | | RecycleCondition();
|
| | | RequestSpecialEffect();
|
| | |
|
| | | Treasure _treasure;
|
| | |
| | | public void PlayUnlockShow()
|
| | | {
|
| | | RecycleLockEffect();
|
| | | RecycleCondition();
|
| | | try
|
| | | {
|
| | | var _effect = SFXPlayUtility.Instance.Play(category == TreasureCategory.Demon ? 5157 : 5132, treasureRoot);
|