Skip to content
/ Unifty Public

Bridge Swift and Objective-C for Unity native plugins

License

Notifications You must be signed in to change notification settings

dddnuts/Unifty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 🙏

About

Bridge Swift and Objective-C for Unity native plugins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published