示例#1
0
        private void AddMutableItem(string absoluteKey, SchemaSource schemaSource, bool isValid, object value)
        {
            var itemGo = Instantiate(MutableItemPrefab, ItemsRoot);

            itemGo.transform.localScale = Vector3.one;
            var item = itemGo.GetComponent <MutableBoxMutableItemBehaviour>();

            item.SchemaSource = schemaSource;

            item.AbsoluteKey = absoluteKey;

            if (value != null)
            {
                item.Type = value.GetType();
            }
            else
            {
                item.Type = null;
            }

            item.IsValidType = isValid;

            item.Selected += HandleMutableItemSelected;

            MutableDropDownItems.Add(item);
        }
示例#2
0
        private void AddMutableItem(string absoluteKey, bool isValid, object value)
        {
            var itemGo = Instantiate(MutableItemPrefab);
            var item   = itemGo.GetComponent <MutableBoxMutableItemBehaviour>();

            item.SchemaSource = SchemaSource.Mutable;

            item.AbsoluteKey = absoluteKey;

            if (value != null)
            {
                item.Type = value.GetType();
            }
            else
            {
                item.Type = null;
            }

            item.IsValidType = isValid;

            item.Selected += HandleMutableItemSelected;

            item.transform.SetParent(ItemsRoot, false);

            MutableDropDownItems.Add(item);
        }
示例#3
0
        private void SetInitialMutableValue()
        {
            //SwitchDisplayToMutableValue();

            IndicateError = false;

            var itemGo = Instantiate(MutableItemPrefab);
            var item   = itemGo.GetComponent <MutableBoxMutableItemBehaviour>();

            item.IsGlobalParameter = false;

            item.AbsoluteKey = Scope.AbsoluteKey;

            item.IsValidType = true;

            MutableDropDownItems.Add(item);

            IndicateMutableValue(item);
        }
示例#4
0
        private void SetInitialMutableValue()
        {
            var itemGo = Instantiate(MutableItemPrefab);
            var item   = itemGo.GetComponent <MutableBoxMutableItemBehaviour>();

            var initialKeyTokens = GetInitialDisplayString(null, MutableTarget.AbsoluteKey).Reverse();

            item.SchemaSource = SchemaSource.Mutable;

            item.AbsoluteKey = string.Join(".", initialKeyTokens.WithoutLast().ToArray());

            item.IsValidType = true;

            MutableDropDownItems.Add(item);

            IndicateError = false;

            IndicateMutableValue(item);

            NewFieldValueInputFieldComponent.text = initialKeyTokens.Last();
        }