当前位置: 首页>>代码示例>>C#>>正文


C# InitDelegate类代码示例

本文整理汇总了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
        }
开发者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


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