public void OnQRCode(string content) { if (qr != null) { return; } bool blackList = QRPromptEffect.SelectionType == QRPromptEffect.ListType.BlackList; bool contained = QRPromptEffect.ValidIds.Contains(content); if ((blackList && !contained) || (!blackList && contained)) { qr = Game.Instance.GameState.FindElement <QR>(content); if (qr != null && ConditionChecker.check(qr.Conditions)) {// Si existe y además cumple las condiciones // Mostramos el contenido y el resto de efectos var effects = new Effects(); if (qr.Content != "") { effects.add(new SpeakPlayerEffect(qr.Content)); } foreach (var effect in qr.Effects.getEffects()) { effects.add(effect); } effectHolder = new EffectHolder(effects); this.transform.GetChild(0).gameObject.SetActive(false); } } }
protected override void OnReorder(ReorderableList r) { string idToMove = r.list [r.index] as string; var temp = Controller.Instance.SelectedChapterDataControl.getObjects <QR> (); QR toMove = temp.Find(qr => qr.getId() == idToMove); temp.Remove(toMove); temp.Insert(r.index, toMove); }
public object DOMParse(XmlElement element, params object[] parameters) { var qr = new QR(element.Attributes["id"].Value) { Content = element.SelectSingleNode("content").InnerText, Documentation = element.SelectSingleNode("documentation").InnerText }; qr.Conditions = DOMParserUtility.DOMParse(element.SelectSingleNode("condition"), parameters) as Conditions ?? new Conditions(); qr.Effects = DOMParserUtility.DOMParse(element.SelectSingleNode("effect"), parameters) as Effects ?? new Effects(); return(qr); }
protected override void OnSelect(ReorderableList r) { if (r.index == -1) { selectedQR = null; return; } var newSelection = Controller.Instance.SelectedChapterDataControl.getObjects <QR>()[r.index]; if (newSelection != null && newSelection != selectedQR) { selectedQR = newSelection; RegenerateQR(); } }
protected override void OnButton() { selectedQR = null; reorderableList.index = -1; }
public QRCodeDataControl(QR qr) { this.qr = qr; this.conditionsController = new ConditionsController(qr.Conditions); this.effectsController = new EffectsController(qr.Effects); }