本文整理汇总了C#中Quest类的典型用法代码示例。如果您正苦于以下问题:C# Quest类的具体用法?C# Quest怎么用?C# Quest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Quest类属于命名空间,在下文中一共展示了Quest类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Init
//Инициализация задания
public void Init(Quest parentQuest)
{
_parentQuest = parentQuest;
//Если задание было загружено с диска, то необходима проверка на его завершенность. Если задание завешенное, то вызываем событие о выполнение данного задания.
if (_taskTargetsAmountCounter >= _taskTargetsAmount && TaskTargetsAmount > 0)
{
_status = true;
_taskTargetsAmountCounter = _taskTargetsAmount;
_parentQuest.OnTaskChange();
return;
}
switch(EventType)
{
case "UnitDied":
EventHub<EntityDiedEventArgs>.EventHappened += OnEventDiedHandler;
break;
case "ItemPicked":
EventHub<EntityItemPickedUpEventArgs>.EventHappened += OnEventPick;
break;
case "PositionMoved":
EventHub<EntityIsCloseToPlayer>.EventHappened += OnPositionMoved;
break;
}
}
开发者ID:neozman,项目名称:JunctionBox,代码行数:27,代码来源:Task.cs
示例2: LoadQuests
public List<Quest> LoadQuests()
{
if (PlayerPrefs.HasKey("PlayerQuests")) {
_quest = new Quest (null, null, null, -1, null);
List<Quest> quests = new List<Quest> ();
JSONNode loadedQuests = JSONClass.Parse (PlayerPrefs.GetString ("PlayerQuests"));
for (int i = 0; i < loadedQuests["Quests"].Count; i++) {
int[] progress = new int[loadedQuests ["Quests"] [i].Count];
for (int j = 0; j < loadedQuests["Quests"][i].Count; j++) {
progress [j] = loadedQuests ["Quests"] [i] [j].AsInt;
}
Quest newQuest = _quest.AddQuestFromSave (loadedQuests ["Quests"] [i].AsInt, progress);
quests.Add (newQuest);
}
return quests;
}
return null;
}
开发者ID:chicostategamestudios,项目名称:qk-pop,代码行数:25,代码来源:QuestSaveManager.cs
示例3: Initialize
public void Initialize(Quest quest)
{
if(objectivesHeader != null)
{
objectivesHeader.text = "OBJECTIVES";
}
if(questName != null)
{
questName.text = quest.questName.ToUpper();
}
if(description != null)
{
description.text = quest.description;
}
// Destroy all children
for (int i = 0; i < objectivesListTransform.childCount; i++)
{
Destroy(objectivesListTransform.GetChild(i).gameObject);
}
// Add objectives to list
foreach (Objective obj in quest.objectives)
{
ObjectiveDisplay display = Instantiate(objectiveDisplayPrefab) as ObjectiveDisplay;
display.transform.SetParent(objectivesListTransform, false);
display.Initialize(obj);
}
}
开发者ID:markdion,项目名称:Unity-Projects,代码行数:29,代码来源:QuestDetailsScreen.cs
示例4: Start
public void Start()
{
Quest q = new Quest("Q01");
q.title = "Carte SD de AI";
q.objective = "AI a perdu des documents précieux. Je dois retrouver la carte SD.";
quests.Add(q);
}
开发者ID:tof31320,项目名称:OfficeStoriesV2,代码行数:7,代码来源:QuestsManager.cs
示例5: Start
void Start()
{
shoot_first = new Quest();
Objective first_objective = new EliminationObjective("Hover Droid", 3);
shoot_first.objectives.Add(first_objective);
shoot_first.startQuest();
}
开发者ID:thyagobr,项目名称:unity_studies,代码行数:7,代码来源:QuestManager.cs
示例6: QuestDetailsScreen
/// <summary>
/// Creates a new QuestDetailsScreen object.
/// </summary>
public QuestDetailsScreen(Quest quest)
: base()
{
// check the parameter
if (quest == null)
{
throw new ArgumentNullException("quest");
}
if (quest.AssetName.Contains("SaveMercadia") && !AudioManager.TitlePlayed)
{
AudioManager.TitlePlayed = false;
//TEMP COMMENT
//AudioManager.PlaySong(quest.AssetName.Replace("Quests\\", "") + "Begin");
}
this.quest = quest;
this.IsPopup = true;
currentDialogue = new List<Line>();
maxLines = 13;
textPosition.X = 261f;
quest.Name = CheckAdult.parseContent(quest.Name);
quest.Description = CheckAdult.parseContent(quest.Description);
quest.ObjectiveMessage = CheckAdult.parseContent(quest.ObjectiveMessage);
quest.CompletionMessage = CheckAdult.parseContent(quest.CompletionMessage);
AddStrings(this.quest.Name,
Fonts.BreakTextIntoList(this.quest.Description,
Fonts.DescriptionFont, 715), GetRequirements(this.quest));
}
开发者ID:patrickdenglerhobbisoft,项目名称:PimpIOs,代码行数:34,代码来源:QuestDetailsScreen.cs
示例7: QuestRealtimeProgressViewModel
public QuestRealtimeProgressViewModel(Quest rpQuest)
{
r_Quest = rpQuest;
DecreaseCommand = new DelegatedCommand(Decrease, CanDecrease);
IncreaseCommand = new DelegatedCommand(Increase, CanIncrease);
}
开发者ID:amatukaze,项目名称:IntelligentNavalGun-Fx4,代码行数:7,代码来源:QuestRealtimeProgressViewModel.cs
示例8: tsbRefresh_Click
private void tsbRefresh_Click(object sender, EventArgs e) {
lvl.Items.Clear();
foreach (String ips in IPList) {
String ip = ips.Trim();
if (ip.Length == 0) continue;
ListViewItem lvi = new ListViewItem(ip);
lvi.SubItems.Add("調査中");
lvi.SubItems.Add("");
lvl.Items.Add(lvi);
lvi.Name = Guid.NewGuid().ToString("N");
IPAddress addr = IPAddress.Parse(ip);
Quest a = new Quest(addr, lvi.Name);
BackgroundWorker bwStat = new BackgroundWorker();
bwStat.DoWork += new DoWorkEventHandler(bwStat_DoWork);
bwStat.RunWorkerAsync(a);
BackgroundWorker bwName = new BackgroundWorker();
bwName.DoWork += new DoWorkEventHandler(bwName_DoWork);
bwName.RunWorkerAsync(a);
}
}
开发者ID:windrobin,项目名称:kumpro,代码行数:26,代码来源:NForm.cs
示例9: SerializeQuest
internal static void SerializeQuest(ServerMessage Message, GameClient Session, Quest Quest, string Category)
{
if (Message == null || Session == null)
{
return;
}
int amountOfQuestsInCategory = MercuryEnvironment.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(Category);
checked
{
int num = (Quest == null) ? amountOfQuestsInCategory : (Quest.Number - 1);
int num2 = (Quest == null) ? 0 : Session.GetHabbo().GetQuestProgress(Quest.Id);
if (Quest != null && Quest.IsCompleted(num2))
{
num++;
}
Message.AppendString(Category);
Message.AppendInt32((Quest == null) ? 0 : (Quest.Category.Contains("xmas2012") ? 0 : num));
Message.AppendInt32((Quest == null) ? 0 : (Quest.Category.Contains("xmas2012") ? 0 : amountOfQuestsInCategory));
Message.AppendInt32((Quest == null) ? 3 : Quest.RewardType);
Message.AppendUInt((Quest == null) ? 0u : Quest.Id);
Message.AppendBoolean(Quest != null && Session.GetHabbo().CurrentQuestId == Quest.Id);
Message.AppendString((Quest == null) ? string.Empty : Quest.ActionName);
Message.AppendString((Quest == null) ? string.Empty : Quest.DataBit);
Message.AppendInt32((Quest == null) ? 0 : Quest.Reward);
Message.AppendString((Quest == null) ? string.Empty : Quest.Name);
Message.AppendInt32(num2);
Message.AppendUInt((Quest == null) ? 0u : Quest.GoalData);
Message.AppendInt32((Quest == null) ? 0 : Quest.TimeUnlock);
Message.AppendString("");
Message.AppendString("");
Message.AppendBoolean(true);
}
}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:33,代码来源:QuestListComposer.cs
示例10: IsPassRequirements
public static bool IsPassRequirements(Quest quest)
{
if (QuestsController.reference.CheckRequirements(quest))
return true;
return false;
}
开发者ID:Gogeen,项目名称:GhostTrainAssets,代码行数:7,代码来源:QuestsController.cs
示例11: AddQuest
//When we need to add a quest to the Quest list, we do it here.
public void AddQuest(int OverallID)
{
if (CurrentQuest == null)
{
//Sets a current quest if we don't have one.
for (int i = 0; i < QList.Count; i++)
{
if (QList [i].OverallID == OverallID)
{
CurrentQuest = QList [i];
CurrentQuest.CurrentQuest = true;
if (OnQuestGet != null)
{
OnQuestGet ();
}
UpdateQuest (OverallID);
return;
}
}
}
else
{
//Else just add the quest to the list/quest log.
for (int i = 0; i < QList.Count; i++)
{
if (QList [i].OverallID == OverallID)
{
QuestList.Add (QList [i]);
return;
}
}
}
}
开发者ID:dhurst22,项目名称:_80sActionHero,代码行数:34,代码来源:QuestManager.cs
示例12: Start
// Use this for initialization
void Start () {
var q0 = new Quest("bed", "Wakey wakey eggs and bakey. Rise and shine!", true);
q0.AddObjective(new Objective("leaveBed"));
quests.Add(q0);
var q1 = new Quest("wakeup", "Clock is ringing, you should do something about that", true);
q1.AddObjective(new Objective("shootAlarm"));
quests.Add(q1);
var q2 = new Quest("shower", "Shower without your dad", false);
q2.AddObjective(new Objective("shower"));
quests.Add(q2);
var q4 = new Quest("bacon", "Bakin' bacon pancakes", false);
q4.AddObjective(new Objective("shootFridge"));
q4.AddObjective(new Objective("getBacon"));
q4.AddObjective(new Objective("putBaconOnOven"));
q4.AddObjective(new Objective("heatOven"));
q4.AddObjective(new Objective("fryBacon"));
quests.Add(q4);
var q5 = new Quest("car", "Get to work", false);
q5.completesLevel = true;
q5.AddObjective(new Objective("getInCar"));
quests.Add(q5);
player = FindObjectOfType<Player>();
TrapPlayer();
}
开发者ID:SlothfulDesigns,项目名称:BaconGameJam10,代码行数:31,代码来源:Level1.cs
示例13: UpdateQuest
void UpdateQuest()
{
selectQuest = null;
playerQuest = PlayerState._instance.GetPlayerQuest();
for (int i = 0; i < questShowList.Count; i++)
{
NGUITools.Destroy(questShowList[i]);
}
questShowList.Clear();
foreach (KeyValuePair<int, Quest> item in playerQuest.GetAcceptQuestList())
{
if (selectQuest == null)
{
selectQuest = item.Value;
}
if (!item.Value.isOver)
{
goQuest = NGUITools.AddChild(containQuestGrid, prefabQuestButton);
goQuest.transform.Find("Title").GetComponent<UILabel>().text = string.Format("Quest:{0}", item.Value.info.name);
goQuest.transform.Find("Doing").GetComponent<UILabel>().text = string.Format("Doing : Step {0}", item.Value.stepNow);
goQuest.name = item.Key.ToString();
questShowList.Add(goQuest);
}
}
containQuestGrid.GetComponent<UIGrid>().enabled = true;
UpdateStep();
}
开发者ID:tsss-t,项目名称:SimpleStory,代码行数:30,代码来源:UIQuestManager.cs
示例14: CallOnNode
protected override void CallOnNode (ref string name, List<ParserValue> pairs) {
if (name == "Quests/Quest") {
quest = Quest.Create (pairs [0].value);
QuestArchive.Add(quest);
}
if (name == "Quests/Quest/Task") {
if (pairs.Count <= 3) {
quest.AddTask (pairs [0].value, pairs [1].value, int.Parse(pairs [2].value));
} else {
quest.AddTask (pairs [0].value, pairs [1].value, int.Parse(pairs [3].value), pairs[2].value);
}
}
if (name == "Quests/Quest/Activates") {
foreach (ParserValue pair in pairs) {
quest.toActivateIds.Add(pair.value);
}
}
if (name == "Quests/Quest/Adventure/Call") {
quest.AddCall(pairs [0].value);
}
if (name == "Quests/Quest/Adventure/Call/ActivateParams") {
for (int i = 0; i < pairs.Count; i++) {
quest.calls [quest.calls.Count - 1].activateParams.Add (pairs [i].value);
}
}
}
开发者ID:Darthoul,项目名称:cena_gamejam,代码行数:27,代码来源:QuestParser.cs
示例15: FindQuest_RewardAssociatedToItem_ItemShouldMatch
public void FindQuest_RewardAssociatedToItem_ItemShouldMatch()
{
var quest = new Quest { Name = "Test Quest #1" };
var item = new Item { Name = "Item #1" };
using (var db = new QuestManagerContext())
{
quest.Name = "Test Quest #1";
quest.Rewards = new List<Reward>
{
new Reward{Type = "item", Quantity = 1, Item = item },
};
db.Quests.Add(quest);
db.SaveChanges();
}
using (var db = new QuestManagerContext())
{
var actualQuest = db.Quests.Find(quest.QuestId);
Assert.AreEqual(1, actualQuest.Rewards.Count);
Assert.AreEqual(item.ItemId, actualQuest.Rewards.ElementAt(0).Item.ItemId);
Assert.AreEqual(item.Name, actualQuest.Rewards.ElementAt(0).Item.Name);
}
}
开发者ID:huddlestuff,项目名称:quest-manager,代码行数:25,代码来源:QuestManagerContextTests.cs
示例16: StartQuest
public static bool StartQuest(Quest quest, bool ignoreRequirements = false)
{
if (!ignoreRequirements && (GetCurrentQuest() != null || !quest.Check())) return false;
quest.Status = QuestStatus.Started;
return true;
}
开发者ID:Elringus,项目名称:BreachedUnity,代码行数:7,代码来源:QuestController.cs
示例17: CreateClaimButton
//Создаем кнопку "Забрать лут"
private void CreateClaimButton(Quest q)
{
GameObject claimButton = Instantiate(UIClaimRewardButtonPrefab) as GameObject;
claimButton.transform.parent = UIQuestLootPanel.transform;
claimButton.GetComponent<RectTransform>().anchoredPosition = UIClaimRewardButtonPrefab.GetComponent<RectTransform>().anchoredPosition;
claimButton.GetComponent<Button>().onClick.AddListener(() => Debug.Log(q.Loot + " gold is claimed!"));
}
开发者ID:neozman,项目名称:JunctionBox,代码行数:8,代码来源:QuestGraphicsManager.cs
示例18: SerializeQuest
/// <summary>
/// Serializes the quest.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="session">The session.</param>
/// <param name="quest">The quest.</param>
/// <param name="category">The category.</param>
internal static void SerializeQuest(ServerMessage message, GameClient session, Quest quest, string category)
{
if (message == null || session == null)
{
return;
}
var amountOfQuestsInCategory = Yupi.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(category);
{
var num = quest == null ? amountOfQuestsInCategory : quest.Number - 1;
var num2 = quest == null ? 0 : session.GetHabbo().GetQuestProgress(quest.Id);
if (quest != null && quest.IsCompleted(num2))
{
num++;
}
message.AppendString(category);
message.AppendInteger(quest == null ? 0 : (quest.Category.Contains("xmas2012") ? 0 : num));
message.AppendInteger(quest == null
? 0
: (quest.Category.Contains("xmas2012") ? 0 : amountOfQuestsInCategory));
message.AppendInteger(quest?.RewardType ?? 3);
message.AppendInteger(quest?.Id ?? 0);
message.AppendBool(quest != null && session.GetHabbo().CurrentQuestId == quest.Id);
message.AppendString(quest == null ? string.Empty : quest.ActionName);
message.AppendString(quest == null ? string.Empty : quest.DataBit);
message.AppendInteger(quest?.Reward ?? 0);
message.AppendString(quest == null ? string.Empty : quest.Name);
message.AppendInteger(num2);
message.AppendInteger(quest?.GoalData ?? 0u);
message.AppendInteger(quest?.TimeUnlock ?? 0);
message.AppendString(string.Empty);
message.AppendString(string.Empty);
message.AppendBool(true);
}
}
开发者ID:sgf,项目名称:Yupi,代码行数:42,代码来源:QuestListComposer.cs
示例19: Start
new void Start(){
inventoryPanel = GameObject.Find(panel_name);
slotPanel = GameObject.Find("NPC_Slot_Panel");
openText = GameObject.Find("NPC_Text").GetComponent<Text>();
openText.transform.gameObject.SetActive(false);
playerInventory = GameConstants.findPlayerInProject().GetComponent<ToonCharacter_Inventory>();
inventoryPanel.SetActive(false);
if (slots == null) {
slots = new List<GameObject>();
}
for (int i = 0; i < npcInventoryAmount; i++) {
slots.Add(Instantiate(inventorySlot));
slots[i].transform.SetParent(slotPanel.transform);
}
lootIDs = GameObject.Find("RolePlayItems").GetComponent<ListWeapons>().getWeapons().Count;
for (int i = 0; i < npcInventoryAmount; i++) {
AddWeaponWithID(randomizer.Next(lootIDs), i);
}
NPC_Quest = new KillQuest(KillType.Skeleton,
3,
"Hallo, ein paar Skelette haben mich vermöbelt und ich brauche dringend eure Hilfe um mich an Ihnen zu rächen. Bitte Töte ein paar Skelette für mich \n\n Töte " + 3 + " Skelette",
1000,
1000,
null);
}
开发者ID:VtheunforgivenV,项目名称:DigitaleSpiele,代码行数:31,代码来源:ToonCharakter_NPCRayCast.cs
示例20: CheckOrStartQuest
public void CheckOrStartQuest(bool isComplete)
{
if (isComplete)
{
currentQuest = quests[0];
quests.RemoveAt(0);
if (quests.Count > 0) {
if (questnum > 0)
{
txtComponent.text = "Quest complete!";
questStorytxt.text = currentQuest.EndDescription;
waitForConfirm = true;
GameManager.main.Player.GetComponent<PCMovement>().DisallowConfirm();
}
else
{
NextQuest();
}
}
else
{
questTitletxt.text = "The End";
questStorytxt.text = "You have mastered the art of voodoo. Now go, my apprentice, and make the world yours!";
txtComponent.text = "The end. You're now the voodoo master!";
}
questnum++;
}
else
{
txtComponent.text = "Your quest is not yet complete!";
}
}
开发者ID:bradur,项目名称:FGJ-2016,代码行数:33,代码来源:HomeScreen.cs
注:本文中的Quest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论