Skip to content

This project is Unity game deveoper SDK for CloudBread game server engine

License

Notifications You must be signed in to change notification settings

CloudBreadProject/CloudBread-Unity-SDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CloudBread-Unity-SDK

This project is Unity game deveoper SDK for CloudBread game server engine In Unity, you don't need to execute raw code for CloudBread API. CloudBread-Unity-SDK can easily integrate CloudBread API as your code.

CloudBread-Unity-SDK guide wiki doc

Official guide repository in CloudBread wiki.
English : https://github.com/CloudBreadProject/CloudBread/wiki/How-to-use-Unity-SDK
Korean : https://github.com/CloudBreadProject/CloudBread/wiki/How-to-use-Unity-SDK-kor

New release version

  • 2.1.0 oAuth 2.0 Login Service Framework will added (now only Facebook)

How to Install.

1. Just Drag Drop in your Project!

CloudBread-Unity-SDK-master – Asset 폴더 안의 파일 추가하기 ![Unity CloudBread SDK]

Asset/CloudBread
    /CloudBread.meta
    /Editor Default Resources
    /Editor Default Resources.meta

Asset 안의 2 개의 폴더와 2 개의 meta 파일을 추가하면 됩니다.

2. Done.

Unity editor If you can see that menu as this photos, that's all!

How to use CloudBread API Service

1. PostMan File Import

2. Just select, you want to use.

You can search here and Generate Client File button click

3. Modify CloudBread server address to your address

CloudBread – Resources – CB.Settings Click

Unity CloudBread settings

Here, you can set server address and AES256 Encrypt/Decrypt Keys

4. Just call! (Test Call Class)

If you use TestCall class like this, you can use easily.

using UnityEngine;
using System.Collections;

namespace CloudBread
{
    public class Test : TestCall<CBCOMUdtMember.Post, CBCOMUdtMember.Receive>
    {
        void Start()
        {
            CBCOMUdtMember.Request(_postData, Callback, ErrorCallback_);
        }
    }
}

And, you can test like this in Unity Inspector.

inspector

5. Just Call API!

Post Data generate

var post_data = new CBCOMUdtMember.Post ();
post_data.MemberID = "aaa";
post_data.EmailAddress = "[email protected]";

Callback function generate

// success!, CallBack function
void CBCOMUDtMember_Callback(CBCOMUdtMember.Receive receive_data){
  // Todo
  print("Result Data : " + receive_data.result);
}

// Failed, CallBack function
void CBCOMUDtMember_Callback_err(string error){
  // Todo
  print(error);
}

Request to CloudBread Instance

// Error 콜백 함수는 생략 가능
CloudBread.CBCOMUdtMember.Request (post_data, CBCOMUDtMember_Callback, CBCOMUDtMember_Callback_err);

If you want to use Landa function, you cna use like this.

CloudBread.CBCOMUdtMember.Request(
  new CBCOMUdtMember.Post{
    MemberID="aaa",
    EmailAddress = "aaa"
  },
  ((CBCOMUdtMember.Receive receive_data) => {
    print("Result Data : " + receive_data.result);
  })
);

How to use CloudBread Login Service.

1. Configure your Oauth Login services

Facebook oAuth Setting

  • check services you want to uses (Facebook / Google and so on...)
  • fill with Redirect Url

2. Example to use Facebook Login services

1) you have to import Facebook-Unity-SDK in your project

2) Example to use Login services

you can call service like this.

// make Facebook Login Services
FaceBookServices oAuthFacebook =  OAuthManager.GetServices (OAuthManager.OAuthServices.facebook) as FaceBookServices;
oAuthFacebook.RequestToken (accessToken, (BaseOAuth2Services.AzureZumoToken.Receive obj) => {
  Debug.Log(obj.user.userId);
});

// Request Facebook's user data
oAuthFacebook.RequestUser (accessToken, (FaceBookServices.FacebookUserData obj) => {
  Debug.Log(obj.name);
});

About

This project is Unity game deveoper SDK for CloudBread game server engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages