コード例 #1
0
        private void MakeRuleEntry(TTRule rule)
        {
            TTRuleEntry newEntry = Instantiate(_ruleEntryPrefab, _entryParent);

            newEntry.SetWithRule(rule);
            _ruleEntries.Add(newEntry);
        }
コード例 #2
0
        public void InitializeUI()
        {
            gameObject.SetActive(true);

            TTRule[] rules = { new TTReverseRule(), new TTFallenAceRule() };

            var entries = _entryParent.GetComponentsInChildren <TTRuleEntry>();

            for (int i = 0; i < rules.Length; i++)
            {
                TTRuleEntry entry = null;
                if (i < entries.Length)
                {
                    entry = entries[i];
                }
                else
                {
                    entry = Instantiate(_ruleEntryPrefab, _entryParent);
                }

                entry.SetWithRule(rules[i]);
                _ruleEntries.Add(entry);
            }
        }