Skip to content

dddnuts/Unifty

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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