• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# InitDelegate类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中InitDelegate的典型用法代码示例。如果您正苦于以下问题:C# InitDelegate类的具体用法?C# InitDelegate怎么用?C# InitDelegate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InitDelegate类属于命名空间,在下文中一共展示了InitDelegate类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
        }
开发者ID:khaerul10056,项目名称:MarkerMetro.Unity.WinIntegration,代码行数:38,代码来源:FBNative.cs


示例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();
     }
 }
开发者ID:MizzKii,项目名称:PuruDash2D,代码行数:27,代码来源:EditorFacebook.cs


示例3: Init

 public virtual void Init(
     HideUnityDelegate hideUnityDelegate,
     InitDelegate onInitComplete)
 {
     this.onHideUnityDelegate = hideUnityDelegate;
     this.onInitCompleteDelegate = onInitComplete;
 }
开发者ID:flicknewb,项目名称:ARG-Zombies-Scaffolding,代码行数:7,代码来源:FacebookBase.cs


示例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;
 }
开发者ID:Bahamutho,项目名称:GJ04-ST.-STELF-EALTH,代码行数:10,代码来源:BT_BehaviorDelegator.cs


示例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());
        }
开发者ID:GlenDC,项目名称:MassiveBullet,代码行数:55,代码来源:AndroidFacebook.cs


示例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);
开发者ID:SoulfulSolutions,项目名称:The_Last_Ranger,代码行数:11,代码来源:AbstractFacebook.cs


示例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);
 }
开发者ID:unit9,项目名称:swip3,代码行数:20,代码来源:FB.cs


示例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));
 }
开发者ID:MizzKii,项目名称:PuruDash2D,代码行数:14,代码来源:EditorFacebook.cs


示例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();
        }
    }
开发者ID:MizzKii,项目名称:PuruDash2D,代码行数:53,代码来源:FB.cs


示例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;
 }
开发者ID:NathanSDunn,项目名称:aws-sdk-unity-samples,代码行数:15,代码来源:FacebookBase.cs


示例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);
 }
开发者ID:facebook,项目名称:facebook-sdk-for-unity,代码行数:16,代码来源:Init.cs


示例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();
     }
 }
开发者ID:SoulfulSolutions,项目名称:The_Last_Ranger,代码行数:18,代码来源:EditorFacebook.cs


示例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;
 }
开发者ID:sanyam5,项目名称:App42-Unity3d-Social-Leaderboard,代码行数:15,代码来源:IOSFacebook.cs


示例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("");
        }
开发者ID:roccolangeweg,项目名称:LumniBenderOfTime,代码行数:20,代码来源:EditorFacebook.cs


示例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));
            }
        }
开发者ID:facebook,项目名称:facebook-sdk-for-unity,代码行数:20,代码来源:ArcadeFacebook.cs


示例16: Init

        /// <summary>
        /// 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.
        /// </summary>
        /// <param name="appId">App identifier.</param>
        /// <param name="cookie">If set to <c>true</c> cookie.</param>
        /// <param name="logging">If set to <c>true</c> logging.</param>
        /// <param name="status">If set to <c>true</c> status.</param>
        /// <param name="xfbml">If set to <c>true</c> xfbml.</param>
        /// <param name="frictionlessRequests">If set to <c>true</c> frictionless requests.</param>
        /// <param name="authResponse">Auth response.</param>
        /// <param name="onHideUnity">
        /// A delegate to invoke when unity is hidden.
        /// </param>
        /// <param name="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.
        /// </param>
        public static void Init(
            string appId,
            bool cookie = true,
            bool logging = true,
            bool status = true,
            bool xfbml = false,
            bool frictionlessRequests = true,
            string authResponse = null,
            HideUnityDelegate onHideUnity = null,
            InitDelegate onInitComplete = null)
        {
            if (string.IsNullOrEmpty(appId))
            {
                throw new ArgumentException("appId cannot be null or empty!");
            }

            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)
            {
                FB.LogVersion();

                #if UNITY_EDITOR
                ComponentFactory.GetComponent<EditorFacebookLoader>();
                #elif UNITY_WEBPLAYER || UNITY_WEBGL
                ComponentFactory.GetComponent<CanvasFacebookLoader>();
                #elif UNITY_IOS
                ComponentFactory.GetComponent<IOSFacebookLoader>();
                #elif UNITY_ANDROID
                ComponentFactory.GetComponent<AndroidFacebookLoader>();
                #else
                throw new NotImplementedException("Facebook API does not yet support this platform");
                #endif
                isInitCalled = true;
                return;
            }

            FacebookLogger.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();
            }
        }
开发者ID:rdenubila,项目名称:Uberland,代码行数:71,代码来源:FB.cs


示例17: Init

	public static void Init(InitDelegate del)
	{
		FB.Init (del, OnHideUnity);
	}
开发者ID:OvertimeStudios,项目名称:CreepyBuster,代码行数:4,代码来源:FacebookHelper.cs


示例18: CallInit

 protected override void CallInit(InitDelegate callback)
 {
     ((EditorFacebook)this.Mock.Facebook).Init(null, callback);
 }
开发者ID:chico-barnstorm,项目名称:facebook-sdk-for-unity,代码行数:4,代码来源:Init.cs


示例19: 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)
 {
     string unityUserAgentSuffix = String.Format("Unity.{0}",
                                                 Facebook.FacebookSdkVersion.Build);
     iosInit(appId,
             cookie,
             logging,
             status,
             frictionlessRequests,
             FBSettings.IosURLSuffix,
             unityUserAgentSuffix);
     this.onInitComplete = onInitComplete;
 }
开发者ID:SoulfulSolutions,项目名称:The_Last_Ranger,代码行数:23,代码来源:IOSFacebook.cs


示例20: Init

        public override void Init(
            HideUnityDelegate hideUnityDelegate,
            InitDelegate onInitComplete)
        {
            // Warn that editor behavior will not match supported platforms
            FacebookLogger.Warn(WarningMessage);

            base.Init(
                hideUnityDelegate,
                onInitComplete);

            this.editorWrapper.Init();
        }
开发者ID:Cube219,项目名称:BlockBuster,代码行数:13,代码来源:EditorFacebook.cs



注:本文中的InitDelegate类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# InitializationEngine类代码示例发布时间:2022-05-24
下一篇:
C# IniFile类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap