Exemplo n.º 1
0
 public StorableStringList(MVRScript script, string prefix)
 {
     for (int i = 0; i < maxCount; i++)
     {
         JSONStorableString store = new JSONStorableString(prefix + i, "");
         storables.Add(store);
         script.RegisterString(store);
     }
 }
Exemplo n.º 2
0
        public void StringTextbox(ref JSONStorableString output, string name, string start,
                                  JSONStorableString.SetStringCallback callback, bool right = false)
        {
            output = new JSONStorableString(name, start, callback);

            script.RegisterString(output);
            var textfield = script.CreateTextField(output, right);
            var input     = textfield.gameObject.AddComponent <InputField>();

            input.textComponent       = textfield.UItext;
            textfield.backgroundColor = Color.white;
            output.inputField         = input;
        }
    private void CreateActionWithParam(string jssName, Action <string> fn)
    {
        var jss = new JSONStorableString(jssName, null)
        {
            isStorable   = false,
            isRestorable = false
        };

        _script.RegisterString(jss);
        jss.setCallbackFunction = val =>
        {
            fn(val);
            jss.valNoCallback = null;
        };
    }