Exemplo n.º 1
0
	public void ResetQuestManager()
	{
		foreach (ArkQuest quest in dicQuests.Values)
			GameObject.DestroyImmediate(quest.gameObject);

		dicQuestObjects.Clear();
		dicQuests.Clear();
		dicQuestContainQuestItem.Clear();
		dicQuestContainGoldAchieve.Clear();
		dicUseItemToTarget.Clear();
		dicKillMonKindSkillItem.Clear();
		dicGetItemFromMonKindSkillItem.Clear();
		dicQuestCollectSkillItem.Clear();
		dicGetItemFromMonKind.Clear();
		listMetaQuest.Clear();
		dicUseItemToTargetAch.Clear();
		dicKillMonsterKindAch.Clear();
		listDailyQuestIndex.Clear();
		listCompleteQuestIdx.Clear();
		listDailyQuest.Clear();
		dicGetQuestCollection.Clear();
		listUseNpcDailyGroup.Clear();
		ArkQuestmanager.instance.ResetNpcDailyQuestList();
        listMonInfoConnectionQuest.Clear();

		if (questTime != null)
		{
			GameObject.DestroyImmediate(questTime.gameObject);
			questTime = null;
			Debug.LogWarning("quest mgr reset & quest time destory");
		}

		AsUseItemToMonTriggerManager.instance.RemaveUseItemToMonTriggerAll();

		AsTableManager.Instance.ResetTbl_Quests();

		QuestTutorialMgr.Instance.Reset();
	}
Exemplo n.º 2
0
	void CheckTimeAchievement(ArkQuest _quest, bool _isDrop)
	{
		if (_quest == null)
		{
			Debug.LogError("(checkTimeAchievement) ArkQeust is null");
			return;
		}

		if (_quest.NowQuestProgressState != QuestProgressState.QUEST_PROGRESS_IN)
			return;

		// check time achievement
		List<AchTimeLimit> listTimeLimit = _quest.GetQuestData().Achievement.GetDatas<AchTimeLimit>();
		List<AchTimeSurvival> listTimeSruvival = _quest.GetQuestData().Achievement.GetDatas<AchTimeSurvival>();


		if (_isDrop == true && (listTimeLimit.Count > 0 || listTimeSruvival.Count > 0))
		{
			if (questTime != null)
				GameObject.DestroyImmediate(questTime.gameObject);

			return;
		}

		if (listTimeLimit.Count > 0 || listTimeSruvival.Count > 0)
		{
			if (_quest.NowQuestProgressState != QuestProgressState.QUEST_PROGRESS_FAIL)
			{
				if (questTime == null)
				{
					GameObject questTimeObj = GameObject.Instantiate(Resources.Load("UI/Optimization/Prefab/QuestTimeDlg")) as GameObject;
					questTime = questTimeObj.GetComponent<QuestTimeDlg>();
				}
				else
					questTime.gameObject.SetActiveRecursively(true);


				if (questTime != null)
					_quest.TimeSpriteText = questTime.questTimeText;

				if (AsGameMain.s_gameState != GAME_STATE.STATE_INGAME)
					questTime.questTimeText.gameObject.layer = LayerMask.NameToLayer("Default");

				visibleTimeUI = true;
			}
			else
			{
				if (questTime != null)
				{
					GameObject.DestroyImmediate(questTime.gameObject);
					questTime = null;
				}

				visibleTimeUI = false;
			}
		}
	}