Skip to content

Commit

Permalink
Exposed the shared property, the scenario is the following: ProjectSe…
Browse files Browse the repository at this point in the history
…ttings is a singleton, and we surface static methods, but without access to this, we can not get access to the Object class methods, which ProjectSettings leverages
  • Loading branch information
migueldeicaza committed Oct 16, 2023
1 parent 676878a commit 5307bd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Generator/Generator/ClassGen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ func processClass (cdef: JGodotExtensionAPIClass, outputDir: String?) async {
p (typeDecl) {
if isSingleton {
p ("/// The shared instance of this class")
p ("static var shared: \(cdef.name) =", suffix: "()") {
p ("public static var shared: \(cdef.name) =", suffix: "()") {
p ("withUnsafePointer (to: &\(cdef.name).className.content)", arg: " ptr in") {
p ("\(cdef.name) (nativeHandle: gi.global_get_singleton (ptr)!)")
}
Expand Down

0 comments on commit 5307bd0

Please sign in to comment.