Ejemplo n.º 1
0
 public static bool  obj_equal(long L, long R)
 {
     UnityEngine.Component left  = FCGetObj.GetObj <UnityEngine.Component>(L);
     UnityEngine.Component right = FCGetObj.GetObj <UnityEngine.Component>(R);
     if (left != null)
     {
         return(left.Equals(right));
     }
     if (right != null)
     {
         return(right.Equals(left));
     }
     return(true);
 }
        public static bool AddMatchMethod(string source, Component calledComponent, string patterm, List<CallbackCallObject> callbackCallObjectList)
        {
            var match = Regex.Match (source, patterm);
            if (! match.Success)
                return false;

            var method = match.Groups ["call"].ToString ().Replace ("\"", "");
            CallbackCallObject item = callbackCallObjectList.Find ((name) => { return name.method.Equals (method); });

            if (item == null) {
                item = new CallbackCallObject ();
                item.method = method;
                callbackCallObjectList.Add (item);
            }

            if (!item.callComponent.Exists ((comp) => { return calledComponent.Equals (comp); })) {
                item.callComponent.Add (calledComponent);
            }
            return true;
        }