Bridge Swift and Objective-C for Unity native plugins
C# Swift Objective-C
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Assets
.gitignore
LICENSE
README.md
Unifty.unitypackage

README.md

Unifty

Bridge Swift and Objective-C for Unity native plugins.

Unifty provides a little Bridging Header and set it up for you on PostProcessBuild 🚀

Usage

Write plugins in Swift and you are ready to use Unifty.

Plugin.mm

#import <YourProduct-Swift.h>

extern "C" {
    [Messenger echo:@"I'm sending message over Unifty!"];
}

Messenger.swift

public class Messenger: NSObject {
    public class func echo(text: String) {
        Unifty.SendMessage("MessageReceiver", "OnReceiveMessage", text)
    }
}

Methods

Since I support the idea of YAGNI, only few methods are available now.

  • UnitySendMessage >> Unifty.SendMessage
  • UnityGetGLViewController >> Unifty.GetGLViewController

Add other methods when you want to use it. And pull requests are always welcome 🙏