Exemple #1
0
    public ConfigUseCase()
    {
        SerializedConfig config = new SerializedConfig();
        var cc = config.Get("(c).gameObject").AsGameObject.ToTransform();

        cc.Move(Vector3.back, Vector3.back);
        //        config.AsTranform.Position();
        //        config.Properties.Add(new ReflectedConfigProperty<Vector3>()
        //        {
        //            To = Vector3.one,
        //            Path = "transform.position"
        //        }
        //        );
        //        config.Properties.Add(new ReflectedConfigProperty<Color>()
        //        {
        //            To = Color.black,
        //            Path = "[Renderer]Material.Color"
        //        });
        //        config.Properties.Add(new ReflectedConfigProperty<Vector3>()
        //        {
        //            To = Vector3.zero,
        //            Path = "(child)transform.position"
        //        });
        //        config.Properties.Add(new MaterialConfigProperty<Color>()
        //        {
        //            To = Color.black,
        //            Path = "(c/c((x)))[Renderer].material._color"
        //        });
    }
Exemple #2
0
        /// <summary>
        /// saves configuration into the default XML file.
        /// </summary>
        public static void Save()
        {
            SerializedConfig serializedConfig = new SerializedConfig()
            {
                Language = Language, LogRetention = LogRetention, Tasks = Tasks.Values.ToArray()
            };

            using (StreamWriter writer = new StreamWriter(_configFile)) {
                _xmlSerializer.Serialize(writer, serializedConfig);
            }
        }
        public static void SaveConfig(string path)
        {
            var config = new SerializedConfig()
            {
                FilePattern = string.Join("\n", FilePatterns),
                SearchPath  = string.Join("\n", SearchPaths)
            };

            var xms    = new XmlSerializer(typeof(SerializedConfig));
            var writer = new StringWriter();

            xms.Serialize(writer, config);
            File.WriteAllText(path, writer.ToString(), Encoding.UTF8);
        }
Exemple #4
0
 /// <summary>
 /// Loads configuration from the default XML file.
 /// </summary>
 public static void Load()
 {
     Logger.LogConfigLoad();
     if (File.Exists(_configFile))
     {
         using (StreamReader reader = new StreamReader(_configFile)) {
             SerializedConfig serializedConfig = (SerializedConfig)_xmlSerializer.Deserialize(reader);
             Language     = serializedConfig.Language;
             LogRetention = serializedConfig.LogRetention;
             Tasks        = serializedConfig.Tasks.ToDictionary(task => task.Guid, task => task);
         }
     }
     Logger.LogConfig();
 }
Exemple #5
0
    void Start()
    {
        //        Log("Method");
        //        Log("Getter");
        //        Log("Field");
        //        Log("transform");
        Debug.Log(UnityPathResolver.Resolve(this, "(c)(c2((x))/Sphere)[Renderer].material.color"));
        //        Debug.Log(UnityPathResolver.Resolve(this, "(((x))/Sphere)"));
        var c = new SerializedConfig();

        c.AsTransform.MoveTo(Vector3.down, EasingType.BackIn);

        YieldBase.Get <WaitTimeOrCondition>().Override(onUpdated: (me) =>
        {
            transform.position = Vector3.Lerp(Vector3.zero, Vector3.down, me.EasedValue);
        });
    }
Exemple #6
0
 public ConfigExtension(SerializedConfig owner)
 {
     Owner = owner;
 }
Exemple #7
0
 public AsRenderer(SerializedConfig owner) : base(owner)
 {
 }
Exemple #8
0
 public AsTransform(SerializedConfig owner) : base(owner)
 {
 }
Exemple #9
0
 public AsGameObject(SerializedConfig owner) : base(owner)
 {
 }
Exemple #10
0
 private SerializedConfig(SerializedConfig owner)
 {
     _owner = owner;
     InitializeExtensions();
 }
Exemple #11
0
 public SerializedConfig()
 {
     _owner = this;
     InitializeExtensions();
 }