private static DoshikExternalApiType GetOrCreateApiType(DoshikExternalApi api, string externalName) { // Не сохраняем Ref типы как отдельные типы - окончание Ref добавляется когда это параметр с ref / out модификатором if (externalName.EndsWith("Ref")) { externalName = externalName.Remove(externalName.Length - "Ref".Length, "Ref".Length); } // хз почему так, но видимо так надо (по другому не работает). В коде графов видел похожие замены switch (externalName) { case "VRCUdonCommonInterfacesIUdonEventReceiver": externalName = "VRCUdonUdonBehaviour"; break; case "VRCUdonCommonInterfacesIUdonEventReceiverArray": externalName = "VRCUdonUdonBehaviourArray"; break; } var apiType = api.Types.Find(x => x.ExternalName == externalName); if (apiType == null) { apiType = new DoshikExternalApiType { ExternalName = externalName, Methods = new List <DoshikExternalApiTypeMethod>() }; api.Types.Add(apiType); } return(apiType); }
private static string GetDotnetTypeAsString(DoshikExternalApiType apiType, DoshikNodeDefinition node) { if (apiType.ExternalName == "VRCUdonUdonBehaviour") { return("VRC.Udon.UdonBehaviour, VRC.Udon"); } else if (apiType.ExternalName == "VRCUdonUdonBehaviourArray") { return("VRC.Udon.UdonBehaviour[], VRC.Udon"); } return(GetDotnetTypeAsString(node.Type)); }
private static DoshikExternalApiTypeMethod GetOrCreateMethod(DoshikExternalApiType apiType, string externalName) { var apiMethod = apiType.Methods.Find(x => x.ExternalName == externalName); if (apiMethod == null) { apiMethod = new DoshikExternalApiTypeMethod { Type = apiType, ExternalName = externalName, Overloads = new List <DoshikExternalApiTypeMethodOverload>() }; apiType.Methods.Add(apiMethod); } return(apiMethod); }