├── .gitattributes ├── .gitignore ├── README.md ├── additional-plugins ├── Assets │ ├── Funapi │ │ ├── FacebookConnector.cs │ │ ├── OAuthHandler.cs │ │ ├── SocialNetwork.cs │ │ └── TwitterConnector.cs │ └── Tester │ │ ├── Facebook.unity │ │ ├── FacebookTest.cs │ │ ├── Twitter.unity │ │ └── TwitterTest.cs └── Packages │ ├── facebook-plugin.unitypackage │ └── twitter-plugin.unitypackage ├── csharp-samples ├── FunMessageSerializer.dll ├── Newtonsoft.Json.dll ├── build.bat ├── libsodium.bundle ├── makefile ├── messages.dll ├── protobuf-net.dll ├── src │ ├── client.cs │ └── main.cs ├── vs2015 │ ├── App.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── funapi-plugin-unity.csproj │ ├── funapi-plugin-unity.sln │ ├── sodium.dll │ ├── z.dll │ └── zstd.dll └── websocket-sharp.dll ├── dedicated-server-plugin ├── Assets │ ├── FunDedicatedServerRpcMessageSerializer.dll │ ├── FunDedicatedServerRpcMessageSerializer.dll.meta │ ├── Funapi.meta │ ├── Funapi │ │ ├── ConcurrentList.cs │ │ ├── ConcurrentList.cs.meta │ │ ├── DebugUtils.cs │ │ ├── DebugUtils.cs.meta │ │ ├── FunapiDSRpcMessage.cs │ │ ├── FunapiDSRpcMessage.cs.meta │ │ ├── FunapiDedicatedServer.cs │ │ ├── FunapiDedicatedServer.cs.meta │ │ ├── FunapiDedicatedServerRpc.cs │ │ ├── FunapiDedicatedServerRpc.cs.meta │ │ ├── FunapiMono.cs │ │ ├── FunapiMono.cs.meta │ │ ├── FunapiTimer.cs │ │ ├── FunapiTimer.cs.meta │ │ ├── FunapiUtils.cs │ │ ├── FunapiUtils.cs.meta │ │ ├── HostAddr.cs │ │ ├── HostAddr.cs.meta │ │ ├── JsonAccessor.cs │ │ ├── JsonAccessor.cs.meta │ │ ├── PostEventList.cs │ │ └── PostEventList.cs.meta │ ├── JsonDotNet.meta │ ├── JsonDotNet │ │ ├── Assemblies.meta │ │ ├── Assemblies │ │ │ ├── Standalone.meta │ │ │ └── Standalone │ │ │ │ ├── Newtonsoft.Json.XML │ │ │ │ ├── Newtonsoft.Json.XML.meta │ │ │ │ ├── Newtonsoft.Json.dll │ │ │ │ └── Newtonsoft.Json.dll.meta │ │ ├── link.xml │ │ └── link.xml.meta │ ├── Plugins.meta │ ├── Plugins │ │ ├── MiniJSON.cs │ │ └── MiniJSON.cs.meta │ ├── Test.meta │ ├── Test │ │ ├── TestBase.cs │ │ ├── TestBase.cs.meta │ │ ├── TestDSRpc.cs │ │ └── TestDSRpc.cs.meta │ ├── dedicated_server_rpc_messages.dll │ ├── dedicated_server_rpc_messages.dll.meta │ ├── protobuf-net.dll │ └── protobuf-net.dll.meta ├── Packages │ └── manifest.json └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── NetworkManager.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ └── XRSettings.asset └── funapi-plugin-unity ├── Assets ├── Editor.meta ├── Editor │ ├── iFunPlugin.cs │ └── iFunPlugin.cs.meta ├── FunMessageSerializer.dll ├── FunMessageSerializer.dll.meta ├── Funapi.meta ├── Funapi │ ├── CommandList.cs │ ├── CommandList.cs.meta │ ├── ConcurrentList.cs │ ├── ConcurrentList.cs.meta │ ├── ConnectList.cs │ ├── ConnectList.cs.meta │ ├── Crypto.cs │ ├── Crypto.cs.meta │ ├── DebugUtils.cs │ ├── DebugUtils.cs.meta │ ├── FunapiAnnouncement.cs │ ├── FunapiAnnouncement.cs.meta │ ├── FunapiChat.cs │ ├── FunapiChat.cs.meta │ ├── FunapiCompression.cs │ ├── FunapiCompression.cs.meta │ ├── FunapiDedicatedServer.cs │ ├── FunapiDedicatedServer.cs.meta │ ├── FunapiDownloader.cs │ ├── FunapiDownloader.cs.meta │ ├── FunapiEncryption.cs │ ├── FunapiEncryption.cs.meta │ ├── FunapiMessage.cs │ ├── FunapiMessage.cs.meta │ ├── FunapiMono.cs │ ├── FunapiMono.cs.meta │ ├── FunapiMonoRT.cs │ ├── FunapiMonoRT.cs.meta │ ├── FunapiMulticasting.cs │ ├── FunapiMulticasting.cs.meta │ ├── FunapiSession.Transport.cs │ ├── FunapiSession.Transport.cs.meta │ ├── FunapiSession.TransportImpl.cs │ ├── FunapiSession.TransportImpl.cs.meta │ ├── FunapiSession.cs │ ├── FunapiSession.cs.meta │ ├── FunapiTimer.cs │ ├── FunapiTimer.cs.meta │ ├── FunapiUtils.cs │ ├── FunapiUtils.cs.meta │ ├── ICSharpCode.SharpZipLib.dll │ ├── ICSharpCode.SharpZipLib.dll.meta │ ├── JsonAccessor.cs │ ├── JsonAccessor.cs.meta │ ├── MD5Async.cs │ ├── MD5Async.cs.meta │ ├── PostEventList.cs │ ├── PostEventList.cs.meta │ ├── ResponseTimeout.cs │ ├── ResponseTimeout.cs.meta │ ├── SessionId.cs │ ├── SessionId.cs.meta │ ├── TrustManager.cs │ └── TrustManager.cs.meta ├── FunapiWebSocket.jslib ├── FunapiWebSocket.jslib.meta ├── JsonDotNet.meta ├── JsonDotNet │ ├── Assemblies.meta │ ├── Assemblies │ │ ├── AOT.meta │ │ ├── AOT │ │ │ ├── Newtonsoft.Json.XML │ │ │ ├── Newtonsoft.Json.XML.meta │ │ │ ├── Newtonsoft.Json.dll │ │ │ └── Newtonsoft.Json.dll.meta │ │ ├── Standalone.meta │ │ └── Standalone │ │ │ ├── Newtonsoft.Json.XML │ │ │ ├── Newtonsoft.Json.XML.meta │ │ │ ├── Newtonsoft.Json.dll │ │ │ └── Newtonsoft.Json.dll.meta │ ├── link.xml │ └── link.xml.meta ├── Plugins.meta ├── Plugins │ ├── MiniJSON.cs │ ├── MiniJSON.cs.meta │ ├── arm64-v8a.meta │ ├── arm64-v8a │ │ ├── libsodium.so │ │ ├── libsodium.so.meta │ │ ├── libz.so │ │ ├── libz.so.meta │ │ ├── libzstd.so │ │ └── libzstd.so.meta │ ├── armeabi-v7a.meta │ ├── armeabi-v7a │ │ ├── libsodium.so │ │ ├── libsodium.so.meta │ │ ├── libz.so │ │ ├── libz.so.meta │ │ ├── libzstd.so │ │ └── libzstd.so.meta │ ├── iOS.meta │ ├── iOS │ │ ├── libsodium.a │ │ ├── libsodium.a.meta │ │ ├── libz.a │ │ ├── libz.a.meta │ │ ├── libzstd.a │ │ └── libzstd.a.meta │ ├── sodium.bundle │ ├── sodium.bundle.meta │ ├── x86.meta │ ├── x86 │ │ ├── sodium.dll │ │ ├── sodium.dll.meta │ │ ├── z.dll │ │ ├── z.dll.meta │ │ ├── zstd.dll │ │ └── zstd.dll.meta │ ├── x86_64.meta │ ├── x86_64 │ │ ├── sodium64.dll │ │ ├── sodium64.dll.meta │ │ ├── z64.dll │ │ ├── z64.dll.meta │ │ ├── zstd64.dll │ │ └── zstd64.dll.meta │ ├── z.bundle │ ├── z.bundle.meta │ ├── zstd.bundle │ └── zstd.bundle.meta ├── README.txt ├── README.txt.meta ├── Resources.meta ├── Resources │ ├── Funapi.meta │ ├── Funapi │ │ ├── MozRoots.bytes │ │ └── MozRoots.bytes.meta │ ├── LogItem.prefab │ └── LogItem.prefab.meta ├── Sample.meta ├── Sample │ ├── Test.cs │ ├── Test.cs.meta │ ├── Test.unity │ ├── Test.unity.meta │ ├── Test2.cs │ ├── Test2.cs.meta │ ├── Test2.unity │ ├── Test2.unity.meta │ ├── UILogContent.cs │ ├── UILogContent.cs.meta │ ├── UILogs.cs │ ├── UILogs.cs.meta │ ├── UIOption.Data.cs │ ├── UIOption.Data.cs.meta │ ├── UIOption.cs │ ├── UIOption.cs.meta │ ├── UIOptionFields.cs │ └── UIOptionFields.cs.meta ├── messages.dll ├── messages.dll.meta ├── protobuf-net.dll ├── protobuf-net.dll.meta ├── websocket-sharp.dll └── websocket-sharp.dll.meta └── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NavMeshLayers.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityAdsSettings.asset └── UnityConnectSettings.asset /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .DS_Store 3 | Library 4 | Data 5 | Temp 6 | UnityVS 7 | output 8 | obj 9 | bin 10 | *.pidb 11 | *.apk 12 | *.exe 13 | *.mdb 14 | *.zip 15 | *.app 16 | *.sln 17 | *.csproj 18 | *.userprefs 19 | *.unityproj 20 | *.unitypackage 21 | funapi-plugin-unity/.vs 22 | -------------------------------------------------------------------------------- /additional-plugins/Assets/Tester/Facebook.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iFunFactory/engine-plugin-unity3d/b471dbd0fc88d280c91571454b16c1d2d47217d6/additional-plugins/Assets/Tester/Facebook.unity -------------------------------------------------------------------------------- /additional-plugins/Assets/Tester/Twitter.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iFunFactory/engine-plugin-unity3d/b471dbd0fc88d280c91571454b16c1d2d47217d6/additional-plugins/Assets/Tester/Twitter.unity -------------------------------------------------------------------------------- /additional-plugins/Assets/Tester/TwitterTest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2013 iFunFactory Inc. All Rights Reserved. 2 | // 3 | // This work is confidential and proprietary to iFunFactory Inc. and 4 | // must not be used, disclosed, copied, or distributed without the prior 5 | // consent of iFunFactory Inc. 6 | 7 | using Fun; 8 | using System.Collections.Generic; 9 | using UnityEngine; 10 | using UnityEngine.UI; 11 | 12 | 13 | public class TwitterTest : MonoBehaviour 14 | { 15 | public void Awake () 16 | { 17 | // Initialize twitter 18 | twitter_ = GameObject.Find("SocialNetwork").GetComponent(); 19 | 20 | // If you don't want to download profile photos with a friend list, 21 | // set this value to false. The default value is ture. 22 | //twitter_.AutoDownloadPicture = false; 23 | 24 | twitter_.OnEventCallback += new SocialNetwork.EventHandler(OnEventHandler); 25 | twitter_.OnPictureDownloaded += delegate(SocialNetwork.UserInfo user) 26 | { 27 | if (image_ != null && user.picture != null) 28 | image_.texture = user.picture; 29 | }; 30 | 31 | // Please pass consumer key and consumer secret of the Twitter apps 32 | twitter_.Init("4RnU4YDXmu8vmwKW5Lgpej3Xc", 33 | "voDDAoaTNXj8VjuWRDhfrnCpa9pnVgpRhBJuKwjJpkg62dtEhd"); 34 | 35 | // Initialize UI 36 | image_ = GameObject.Find("ImgProfile").GetComponent(); 37 | pin_code_ = GameObject.Find("InputPinCode").GetComponent(); 38 | 39 | if (!twitter_.IsLoggedIn) 40 | setButtonState(false); 41 | } 42 | 43 | public void OnStartOAuth () 44 | { 45 | if (twitter_.IsLoggedIn) 46 | return; 47 | 48 | twitter_.Login(); 49 | } 50 | 51 | public void OnAccessToken () 52 | { 53 | if (twitter_.IsLoggedIn) 54 | return; 55 | 56 | twitter_.RequestAccess(pin_code_.text); 57 | } 58 | 59 | public void OnFriendList () 60 | { 61 | twitter_.RequestFriendList(100); 62 | } 63 | 64 | public void OnTweetPost () 65 | { 66 | twitter_.Post("Test post for funapi plugin."); 67 | } 68 | 69 | public void OnRandomPicture () 70 | { 71 | SocialNetwork.UserInfo info = twitter_.FindFriend(Random.Range(0, twitter_.FriendListCount)); 72 | if (info != null && info.picture != null) 73 | { 74 | if (image_ != null) 75 | image_.texture = info.picture; 76 | 77 | FunDebug.Log("Sets {0}'s picture.", info.name); 78 | } 79 | } 80 | 81 | 82 | void OnEventHandler (SNResultCode result) 83 | { 84 | FunDebug.DebugLog1("EVENT: Twitter ({0})", result); 85 | 86 | switch (result) 87 | { 88 | case SNResultCode.kLoggedIn: 89 | FunDebug.Log("Twitter Id: {0}", twitter_.MyId); 90 | setButtonState(true); 91 | break; 92 | 93 | case SNResultCode.kError: 94 | FunDebug.Assert(false); 95 | break; 96 | } 97 | } 98 | 99 | void setButtonState (bool enable) 100 | { 101 | if (buttons_.Count <= 0) 102 | { 103 | // Gets buttons 104 | buttons_["friends"] = GameObject.Find("BtnFriends").GetComponent