本文整理汇总了C#中InitDelegate类的典型用法代码示例。如果您正苦于以下问题:C# InitDelegate类的具体用法?C# InitDelegate怎么用?C# InitDelegate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InitDelegate类属于命名空间,在下文中一共展示了InitDelegate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
/// <summary>
/// FB.Init as per Unity SDK
/// </summary>
/// <remarks>
/// https://developers.facebook.com/docs/unity/reference/current/FB.Init
/// </remarks>
public static void Init(InitDelegate onInitComplete, string appId, HideUnityDelegate onHideUnity)
{
#if WINDOWS_PHONE_APP
Dispatcher.InvokeOnUIThread(() =>
{
_onHideUnity = onHideUnity;
_fbSessionClient = Session.ActiveSession;
Session.AppId = appId;
Task.Run(async () =>
{
// check and extend token if required
await Session.CheckAndExtendTokenIfNeeded();
if (IsLoggedIn)
{
UserId = Settings.GetString(FBID_KEY);
UserName = Settings.GetString(FBNAME_KEY);
}
if (onInitComplete != null)
{
Dispatcher.InvokeOnAppThread(() => { onInitComplete(); });
}
});
if (onHideUnity != null)
throw new NotSupportedException("onHideUnity is not currently supported at this time.");
});
#else
throw new PlatformNotSupportedException("");
#endif
}
示例2: OnInit
private IEnumerator OnInit(
InitDelegate onInitComplete,
string appId,
bool cookie = false,
bool logging = true,
bool status = true,
bool xfbml = false,
string channelUrl = "",
string authResponse = null,
bool frictionlessRequests = false,
Facebook.HideUnityDelegate hideUnityDelegate = null)
{
// wait until the native dialogs are loaded
while (fb == null)
{
yield return null;
}
fb.Init(onInitComplete, appId, cookie, logging, status, xfbml, channelUrl, authResponse, frictionlessRequests, hideUnityDelegate);
if (status || cookie)
{
isLoggedIn = true;
}
if (onInitComplete != null)
{
onInitComplete();
}
}
示例3: Init
public virtual void Init(
HideUnityDelegate hideUnityDelegate,
InitDelegate onInitComplete)
{
this.onHideUnityDelegate = hideUnityDelegate;
this.onInitCompleteDelegate = onInitComplete;
}
示例4: BT_BehaviorDelegator
public BT_BehaviorDelegator(NodeDescription.BT_NodeType type, UpdateDelegate onUpdate, InitDelegate onInit = null, EnterDelegate onEnter = null, ExitDelegate onExit = null, TerminateDelegate onTerm = null)
{
Description.Type = type;
initDel = onInit;
enterDel = onEnter;
updateDel = onUpdate;
exitDel = onExit;
terminateDel = onTerm;
}
示例5: Init
public override void Init(
InitDelegate onInitComplete,
string appId,
bool cookie = false,
bool logging = true,
bool status = true,
bool xfbml = false,
string channelUrl = "",
string authResponse = null,
bool frictionlessRequests = false,
HideUnityDelegate hideUnityDelegate = null)
{
if (string.IsNullOrEmpty(appId))
{
throw new ArgumentException("appId cannot be null or empty!");
}
var parameters = new Dictionary<string, object>();
parameters.Add("appId", appId);
if (cookie != false)
{
parameters.Add("cookie", true);
}
if (logging != true)
{
parameters.Add("logging", false);
}
if (status != true)
{
parameters.Add("status", false);
}
if (xfbml != false)
{
parameters.Add("xfbml", true);
}
if (!string.IsNullOrEmpty(channelUrl))
{
parameters.Add("channelUrl", channelUrl);
}
if (!string.IsNullOrEmpty(authResponse))
{
parameters.Add("authResponse", authResponse);
}
if (frictionlessRequests != false)
{
parameters.Add("frictionlessRequests", true);
}
var paramJson = MiniJSON.Json.Serialize(parameters);
this.onInitComplete = onInitComplete;
this.CallFB("Init", paramJson.ToString());
}
示例6: Init
public abstract void Init(
InitDelegate onInitComplete,
string appId,
bool cookie = false,
bool logging = true,
bool status = true,
bool xfbml = false,
string channelUrl = "",
string authResponse = null,
bool frictionlessRequests = false,
HideUnityDelegate hideUnityDelegate = null);
示例7: Init
/**
* This is the preferred way to call FB.Init(). It will take the facebook app id specified in your
* "Facebook" => "Edit Settings" menu when it is called.
*
* onInitComplete - Delegate is called when FB.Init() finished initializing everything.
* By passing in a delegate you can find out when you can safely call the other methods.
*/
public static void Init(InitDelegate onInitComplete, HideUnityDelegate onHideUnity = null, string authResponse = null)
{
Init(
onInitComplete,
FBSettings.AppId,
FBSettings.Cookie,
FBSettings.Logging,
FBSettings.Status,
FBSettings.Xfbml,
FBSettings.FrictionlessRequests,
onHideUnity,
authResponse);
}
示例8: Init
public override void Init(
InitDelegate onInitComplete,
string appId,
bool cookie = false,
bool logging = true,
bool status = true,
bool xfbml = false,
string channelUrl = "",
string authResponse = null,
bool frictionlessRequests = false,
Facebook.HideUnityDelegate hideUnityDelegate = null)
{
StartCoroutine(OnInit(onInitComplete, appId, cookie, logging, status, xfbml, channelUrl, authResponse, frictionlessRequests, hideUnityDelegate));
}
示例9: Init
/**
* If you need a more programmatic way to set the facebook app id and other setting call this function.
* Useful for a build pipeline that requires no human input.
*/
public static void Init(
InitDelegate onInitComplete,
string appId,
bool cookie = true,
bool logging = true,
bool status = true,
bool xfbml = false,
bool frictionlessRequests = true,
HideUnityDelegate onHideUnity = null,
string authResponse = null)
{
FB.appId = appId;
FB.cookie = cookie;
FB.logging = logging;
FB.status = status;
FB.xfbml = xfbml;
FB.frictionlessRequests = frictionlessRequests;
FB.authResponse = authResponse;
FB.OnInitComplete = onInitComplete;
FB.OnHideUnity = onHideUnity;
if (!isInitCalled)
{
var versionInfo = FBBuildVersionAttribute.GetVersionAttributeOfType(typeof (IFacebook));
FbDebug.Info(String.Format("Using SDK {0}, Build {1}", versionInfo.Version, versionInfo.ToString()));
#if UNITY_EDITOR
FBComponentFactory.GetComponent<EditorFacebookLoader>();
#elif UNITY_WEBPLAYER
FBComponentFactory.GetComponent<CanvasFacebookLoader>();
#elif UNITY_IOS
FBComponentFactory.GetComponent<IOSFacebookLoader>();
#elif UNITY_ANDROID
FBComponentFactory.GetComponent<AndroidFacebookLoader>();
#else
throw new NotImplementedException("Facebook API does not yet support this platform");
#endif
isInitCalled = true;
return;
}
FbDebug.Warn("FB.Init() has already been called. You only need to call this once and only once.");
// Init again if possible just in case something bad actually happened.
if (FacebookImpl != null)
{
OnDllLoaded();
}
}
示例10: Init
public virtual void Init(
string appId,
bool cookie,
bool logging,
bool status,
bool xfbml,
string channelUrl,
string authResponse,
bool frictionlessRequests,
HideUnityDelegate hideUnityDelegate,
InitDelegate onInitComplete)
{
this.onHideUnityDelegate = hideUnityDelegate;
this.onInitCompleteDelegate = onInitComplete;
}
示例11: CallInit
protected override void CallInit(InitDelegate callback)
{
((CanvasFacebook)this.Mock.Facebook).Init(
"123456789",
true,
true,
true,
false,
null,
null,
false,
"en_US",
false,
null,
callback);
}
示例12: Init
public override void Init(
InitDelegate onInitComplete,
string appId,
bool cookie = false,
bool logging = true,
bool status = true,
bool xfbml = false,
string channelUrl = "",
string authResponse = null,
bool frictionlessRequests = false,
Facebook.HideUnityDelegate hideUnityDelegate = null)
{
this.isInitialized = true;
if (onInitComplete != null)
{
onInitComplete();
}
}
示例13: Init
public void Init(
InitDelegate onInitComplete,
string appId,
bool cookie = false,
bool logging = true,
bool status = true,
bool xfbml = false,
string channelUrl = "",
string authResponse = null,
bool frictionlessRequests = false,
Facebook.HideUnityDelegate hideUnityDelegate = null)
{
iosInit(cookie, logging, status, frictionlessRequests);
externalInitDelegate = onInitComplete;
}
示例14: Init
public override void Init(
InitDelegate onInitComplete,
string appId,
bool cookie,
bool logging,
bool status,
bool xfbml,
string channelUrl,
string authResponse,
bool frictionlessRequests,
HideUnityDelegate hideUnityDelegate)
{
if (onInitComplete != null)
{
onInitComplete();
}
var editorFB = ComponentFactory.GetComponent<EditorFacebookGameObject>();
editorFB.OnInitComplete("");
}
示例15: Init
public void Init(
string appId,
HideUnityDelegate hideUnityDelegate,
InitDelegate onInitComplete)
{
base.Init(onInitComplete);
this.appId = appId;
string accessTokenInfo;
Utilities.CommandLineArguments.TryGetValue("/access_token", out accessTokenInfo);
if (accessTokenInfo != null)
{
accessTokenInfo = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(accessTokenInfo));
this.OnInitComplete(new ResultContainer(accessTokenInfo));
}
else
{
this.OnInitComplete(new ResultContainer(string.Empty));
}
}