thautwarm / Traffy.UnityPython

An efficient Python implementation in C#, running on every platform via Unity IL2CPP.
MIT License
44 stars 0 forks source link

Attribute [PyBind] to automatically and statically generate a method for specific class #14

Closed thautwarm closed 2 years ago

thautwarm commented 2 years ago
public class TrList : TrObject
{
    ...
     [PyBind]
     void append(TrObject element)
      {
              container.Add(element);
      }

     [PyBind(Name = "extend")]
     void AddMany(TrObject element)
      {
              container.AddRange(element.__iter__());
      }

      [PyBind]
      public string __class__ => Class.Name;
}

Argument type conversions are statically resolved.