Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     quests    = this.gameObject.GetComponent <QuestMaster> ();
     master    = this.gameObject.GetComponent <GameMaster> ();
     buildings = this.gameObject.GetComponent <BuildManager> ();
     GameMaster.playerEvent += setQuestsForActiveHeros;
 }
Ejemplo n.º 2
0
            public override string Execute(string original)
            {
                original = original.Replace("${Gs2::Weave::QuestNamespaceName}", _installer.questNamespaceName);
                original = original.Replace("${Gs2::Weave::QuestGroupName}", _installer.questGroupName);
                original = original.Replace("${Gs2::Weave::QuestKeyNamespaceName}", _installer.keyNamespaceName);
                original = original.Replace("${Gs2::Weave::QuestKeyName}", _installer.keyName);

                {
                    var master = new QuestMaster
                    {
                        groups = new List <QuestGroupModel>
                        {
                            new QuestGroupModel
                            {
                                name   = _installer.questGroupName,
                                quests = _installer.quests.Select(
                                    quest => quest.ToModel(
                                        _installer.staminaInstaller.staminaNamespaceName,
                                        _installer.staminaInstaller.staminaModelName,
                                        _installer.goldInstaller.inventoryNamespaceName,
                                        _installer.goldInstaller.inventoryModelName,
                                        _installer.goldInstaller.itemModelName
                                        )
                                    ).ToList(),
                            }
                        }
                    };

                    var stringBuilder = new StringBuilder();
                    var jsonWriter    = new JsonWriter(stringBuilder);
                    master.WriteJson(jsonWriter);

                    var json = JsonMapper.ToObject(original);
                    json["Resources"]["QuestSettings"]["Properties"]["Settings"] = stringBuilder.ToString();
                    original = json.ToJson();
                }

                return(original);
            }