// Start is called before the first frame update void Start() { instance = GameManager.instance; Assert.IsNotNull(instance, "Could not find Game Manager."); setter = FindObjectOfType <RuleSetter>(); Assert.IsNotNull(setter, "Could not find Rule Setter."); ui = FindObjectOfType <RuleUI>(); Assert.IsNotNull(ui, "Could not find Rule UI."); }
/// <summary> /// Initializes a new instance of the <see cref="Grammar"/> class that contains rules copied from the specified grammar. /// </summary> /// <param name="rules">The rules whose elements are copied to the new grammar.</param> public Grammar(IDictionary <RuleKey, Lazy <Parser <Char, YacqExpression> > > rules) { this._rules = #if SILVERLIGHT new Dictionary <RuleKey, Lazy <Parser <Char, YacqExpression> > > #else new SortedDictionary <RuleKey, Lazy <Parser <Char, YacqExpression> > > #endif (rules ?? new Dictionary <RuleKey, Lazy <Parser <Char, YacqExpression> > >()); this.Get = new RuleGetter(this); this.Set = new RuleSetter(this); }
// Use this for initialization void Start() { instance = GameManager.instance; Assert.IsNotNull(instance, "Can not find Game Manger."); loader = FindObjectOfType <RuleLoader>(); Assert.IsNotNull(loader, "Can not find Rule Loader."); setter = FindObjectOfType <RuleSetter>(); Assert.IsNotNull(setter, "Can not find Rule Setter."); ui = FindObjectOfType <RuleUI>(); Assert.IsNotNull(ui, "Can not find Rule UI."); GetComponent <Button>().onClick.AddListener(LoadRule); }
// Start is called before the first frame update void Start() { instance = GameManager.instance; Assert.IsNotNull(instance, "Could not find Game Manager."); loader = GetComponent <RuleLoader>(); Assert.IsNotNull(loader, "Could not find Rule Loader."); messenger = FindObjectOfType <RuleMessenger>(); if (messenger == null) { Debug.Log("Could not find RuleMessenger."); } setter = GetComponent <RuleSetter>(); Assert.IsNotNull(setter, "Could not find Rule Setter."); ui = GetComponent <RuleUI>(); Assert.IsNotNull(ui, "Could not find Rule UI."); }
// Use this for initialization void Start() { instance = GameManager.instance; Assert.IsNotNull(instance, "Could not find Game Manager."); setter = GetComponent <RuleSetter>(); Assert.IsNotNull(setter, "Could not find Rule Setter."); loader = panelLoad.GetComponent <RuleLoader>(); Assert.IsNotNull(loader, "Could not find Rule Loader."); defaultColor = textRange.color; panelColor1 = panelRuleUse.GetComponent <Image>().color; panelColor2 = panelActivation.GetComponent <Image>().color; messenger = ruleMessenger.GetComponent <RuleMessenger>(); if (instance.Rules.Count > 0) { buttonLoad.interactable = true; } }