public static int Compare(VariableDecorator decorator1, VariableDecorator decorator2)
 {
     if (decorator1.priority > decorator2.priority)
     {
         return(1);
     }
     if (decorator1.priority == decorator2.priority)
     {
         return(0);
     }
     return(-1);
 }
Beispiel #2
0
 public void RemoveDecorator(string key, VariableDecorator decorator)
 {
     if (decorator is IntDecorator)
     {
         intData[key]?.Remove((IntDecorator)decorator);
     }
     else if (decorator is LongDecorator)
     {
         longData[key]?.Remove((LongDecorator)decorator);
     }
     else if (decorator is FloatDecorator)
     {
         floatData[key]?.Remove((FloatDecorator)decorator);
     }
     else
     {
         throw new UnityException("Type " + decorator.GetType() + " is not supported !");
     }
 }