示例#1
0
    public override void Invoke()
    {
        FieldInfo  toInfo   = CopyAction.Unravel(copyTo, pathTo);
        MethodInfo fromInfo = UnravelMethod(copyFrom, pathFrom);

        toInfo.SetValue(copyTo, fromInfo.Invoke(copyFrom, unravel.Select(x => x.Unravel()).ToArray()));
    }
示例#2
0
    MethodInfo UnravelMethod(Component objec, string path)
    {
        var       obj      = objec;
        FieldInfo info     = CopyAction.Unravel(obj, String.Join(".", path.Split('.').Take(path.Split('.').Length - 1).ToArray()));
        string    lastProp = path.Split('.').Last();

        return(info.GetType().GetMethod(lastProp));
    }
示例#3
0
    public override void Invoke()
    {
        float  val   = (float)CopyAction.Unravel(script, property).GetValue(script);
        string exp   = ((string)expression.Clone()).Replace("x", val.ToString());
        float  toSet = (float)new System.Xml.XPath.XPathDocument
                           (new System.IO.StringReader("< r />")).CreateNavigator().Evaluate
                           (string.Format("number({0})", new
                                          System.Text.RegularExpressions.Regex(@"([\+\-\*])").Replace(exp, " ${1} ").Replace("/", " div ").Replace("%", " mod ")));

        CopyAction.Unravel(script, property).SetValue(script, toSet);
    }
示例#4
0
    IEnumerator Wri()
    {
        FieldInfo info = CopyAction.Unravel(writeTo, path);

        info.SetValue(writeTo, "");
        finished = false;
        foreach (var item in toWrite)
        {
            info.SetValue(writeTo, (string)info.GetValue(writeTo) + item);
            yield return(new WaitForSeconds(delay));
        }
        finished = true;
    }
示例#5
0
    public override bool Fulfilled()
    {
        switch (sign)
        {
        case Sign.less:
            return((float)CopyAction.Unravel(comp, path).GetValue(comp) < (float)CopyAction.Unravel(equal, equalTo).GetValue(equal));

        case Sign.equal:
            return(CopyAction.Unravel(comp, path).GetValue(comp).Equals(CopyAction.Unravel(equal, equalTo).GetValue(equal)));

        case Sign.more:
            return((float)CopyAction.Unravel(comp, path).GetValue(comp) > (float)CopyAction.Unravel(equal, equalTo).GetValue(equal));
        }
        return(false);
    }
示例#6
0
 public FieldInfo Unravel()
 {
     return(CopyAction.Unravel(x, path));
 }