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" // }); }
/// <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); }
/// <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(); }
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); }); }
public ConfigExtension(SerializedConfig owner) { Owner = owner; }
public AsRenderer(SerializedConfig owner) : base(owner) { }
public AsTransform(SerializedConfig owner) : base(owner) { }
public AsGameObject(SerializedConfig owner) : base(owner) { }
private SerializedConfig(SerializedConfig owner) { _owner = owner; InitializeExtensions(); }
public SerializedConfig() { _owner = this; InitializeExtensions(); }