Exemple #1
0
 protected override void AddOnToggleChangeMethod(StringBuilder builder, string gameObjectName)
 {
     builder.Append(string.Format(@"        public virtual void TurnOn{0}(int index)
 {{
     Model.TurnOn{0}(index);
 }}", NameConverter.RemoveGroup(gameObjectName)));
 }
Exemple #2
0
 protected override void AddOnToggleChangeMethod(StringBuilder builder, string gameObjectName)
 {
     builder.Append(string.Format(@"        public void TurnOn{0}(int index)
 {{
     throw new System.NotImplementedException();
 }}", NameConverter.RemoveGroup(gameObjectName)));
 }
Exemple #3
0
        protected override void AddAwake(StringBuilder builder, IEnumerable <string> buttonGameObjects,
                                         IEnumerable <string> toggleGameObjects)
        {
            builder.Append(@"        private void Awake()
        {");
            builder.AppendLine();
            foreach (var gameObjectName in buttonGameObjects)
            {
                builder.Append(string.Format(@"            {0}.onClick.AddListener(OnClick{1});",
                                             NameConverter.ConvertPrivateField(gameObjectName), gameObjectName));
                builder.AppendLine();
            }

            foreach (var gameObjectName in toggleGameObjects)
            {
                builder.Append(string.Format(@"            foreach (var {0} in {1})
                {0}.onValueChanged.AddListener(On{2}Change);",
                                             NameConverter.ToCamel(gameObjectName.Replace("Group", "")),
                                             NameConverter.ConvertPrivateField(gameObjectName),
                                             NameConverter.RemoveGroup(gameObjectName)));
                builder.AppendLine();
            }


            builder.Append("        }");
            builder.AppendLine();
        }
Exemple #4
0
 protected override void AddOnToggleChangeMethod(StringBuilder builder, string gameObjectName)
 {
     builder.Append(string.Format(@"        private void On{0}Change(bool isOn)
 {{
     if (isOn == false) return;
     for (var i = 0; i < {1}.Length; i++)
         if ({1}[i].isOn)
             Presenter.TurnOn{0}(i);
 }}", NameConverter.RemoveGroup(gameObjectName), NameConverter.ConvertPrivateField(gameObjectName)));
 }
        protected override void AddOnToggleChangeMethod(StringBuilder builder, string gameObjectName)
        {
            builder.Append(string.Format(@"        [TestCase(0)]
        public void TestTurnOn{0} (int index)
        {{
            // Set

            // Do
            {1}Model.TurnOn{0}(index);

            // Check

            throw new System.NotImplementedException();
        }}", NameConverter.RemoveGroup(gameObjectName), NameConverter.ConvertPrivateField(ModuleName)));
        }