Esempio n. 1
0
 private void Start()
 {
     if (Singleton <PlayFabManager> .Instance.Initialized)
     {
         this.FetchRandomSeed();
     }
     else
     {
         PlayFabManager instance = Singleton <PlayFabManager> .Instance;
         instance.OnLogin = (Action <string, string>)Delegate.Combine(instance.OnLogin, new Action <string, string>(this.OnPlayFabLogin));
     }
     base.SetAsPersistant();
 }
Esempio n. 2
0
    void Awake()
    {
        Application.targetFrameRate = 60;
        if (PlayFabManager.instanse != null)
        {
            Debug.Log("A few PlayFab instances found on scene! Please remove it.");
        }
        if (instanse == null)
        {
            instanse = this;
        }

        DontDestroyOnLoad(gameObject);
    }
 private void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     // 인스턴스가 존재하는 경우 새로생기는 인스턴스를 삭제한다.
     else if (_instance != this)
     {
         Destroy(gameObject);
     }
     // 아래의 함수를 사용하여 씬이 전환되더라도 선언되었던 인스턴스가 파괴되지 않는다.
     DontDestroyOnLoad(gameObject);
 }
Esempio n. 4
0
    private void Awake()
    {
        debug.text = "asdasdasd";
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        instance = this;
        DontDestroyOnLoad(this.gameObject);
        PlayFabSettings.TitleId = TitleIdGame;

        debug.text = PlayFabSettings.TitleId.ToString();
        Login();
        StartCoroutine(Retry());
    }
Esempio n. 5
0
 void Awake()
 {
     JUMPConnection.gameObject.SetActive(false);
     if (Debug.isDebugBuild && !DebugManager.DebugInitialized)
     {
         Logger.LogLevel = Logger.LogLevels.Verbose;
         // Load Debug Screen to do optional pre-login with Facebook
         DebugManager.LoadDebugIntroScreen();
     }
     else
     {
         ProfileManager.Init();
         PlayFabManager.Init();
         FacebookManager.Init();
     }
 }
Esempio n. 6
0
 public void AutoLogin()
 {
     Logger.Verbose("LoginManager.AutoLogin");
     // If you are logged in with Facebook already
     if (FacebookManager.IsUserLoggedIn)
     {
         // Sign in to PlayFab using your Facebook Identity (auto create the account)
         PlayFabManager.LoginUsingFacebookId();
     }
     // Otherwise
     else
     {
         // Sign In to PlayFab using the local device identifier (auto create the account)
         PlayFabManager.LoginUsingDeviceId();
     }
 }
    void Awake()
    {
        //Singleton
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(gameObject);


        panel      = transform.Find("CanvasLoading").Find("Panel").gameObject;
        txtMessage = panel.GetComponentInChildren <Text>();
    }
    public void SaveOptions()
    {
        // Write the current values to the service
        if (CurrentStyle != PreviousStyle || CurrentColor != PreviousColor)
        {
            PlayFabManager.StoreUserData(CurrentStyle, CurrentColor);
            PreviousColor = CurrentColor;
            PreviousStyle = CurrentStyle;
        }

        if (PreviousName != CurrentInput.text)
        {
            PlayFabManager.SetUserDisplayName(CurrentInput.text);
            PreviousName = CurrentInput.text;
        }

        GameObject.Find("GameManager").GetComponent <GameManager>().HaveSetUserName = false;
    }
Esempio n. 9
0
    public void RequestLeaderboard(string leaderboardName)
    {
        informationText.text = loadingString;

        if (!PlayFabManager.IsLoggedIn)
        {
            PlayFabManager.Login(OnSuccessLoginIn, OnFailedLoginIn);
            return;
        }

        ClearLeaderboard();

        var request = new GetLeaderboardRequest {
            StatisticName = leaderboardName, MaxResultsCount = 50
        };

        PlayFabClientAPI.GetLeaderboard(request, OnGetLeaderboardSuccess, OnGetLeaderboardFailed);
    }
Esempio n. 10
0
    private void OnPlayFabLogin(string playFabId, string facebookId)
    {
        PlayFabManager instance = Singleton <PlayFabManager> .Instance;

        instance.OnLogin = (Action <string, string>)Delegate.Remove(instance.OnLogin, new Action <string, string>(this.OnPlayFabLogin));
        if (!string.IsNullOrEmpty(playFabId))
        {
            if (HatchManager.onPlayFabLoginSuccess != null)
            {
                HatchManager.onPlayFabLoginSuccess();
            }
            HatchManager.CurrentPlayer.AddPlayFabID(playFabId);
            this.PlayerIsReady();
        }
        else
        {
            this.OnLoginError(HatchManager.ErrorType.PlayFabLoginError, "Couldn't login to PlayFab");
        }
    }
Esempio n. 11
0
    public void GoToGamePlay()
    {
        PlayFabManager.UpdateStatistic("games_played", 1);

        if (PlayerShip == null)
        {
            var style = PlayFabManager.GetUserDataValue("ShipStyle");
            var color = PlayFabManager.GetUserDataValue("ShipColor");

            if (string.IsNullOrEmpty(style))
            {
                style = Random.Range(0, 4).ToString();
            }

            if (string.IsNullOrEmpty(color))
            {
                color = Random.Range(0, 4).ToString();
            }

            PlayerShip = Instantiate(ShipPrefabs[int.Parse(style)], new Vector3(0, 0, 1f), Quaternion.identity);
            PlayerShip.GetComponent <ShipBehavior>().ShipColor            = ShipColors[int.Parse(color)];
            PlayerShip.GetComponent <FireJoystickBehavior>().Joystick     = FireStick;
            PlayerShip.GetComponent <MovementJoystickBehavior>().Joystick = ThrustStick;
        }

        // Reset positions to the origin
        Camera.main.transform.position = new Vector3(0, 0, Camera.main.transform.position.z);
        PlayerShip.transform.position  = new Vector3(0, 0, 1f);

        // Stop scrolling the starfield
        FixedScroll.SetActive(false);

        // Turn on world map, asteroids and satellites
        WorldMap.SetActive(true);
        AsteroidField.SetActive(true);

        // Show the player
        PlayerShip.SetActive(true);

        // Start the game
        StartGame();
    }
    void Awake()
    {
        playFabManager = GameObject.Find("PlayFabManager").GetComponent <PlayFabManager>();

        //Playfab Manager

        if (playFabManager.Player_Car == "rouge")
        {
            myTypePlayer = TypePlayer.rouge;
        }
        else if (playFabManager.Player_Car == "vert")
        {
            myTypePlayer = TypePlayer.vert;
        }
        else
        {
            myTypePlayer = TypePlayer.orange;
        }


        switch (myTypePlayer)
        {
        case TypePlayer.orange:
            currentSpeed = normalSpeed;
            canJump      = false;
            GetComponent <MeshRenderer>().material.mainTexture = orangeTex;
            break;

        case TypePlayer.vert:
            currentSpeed = normalSpeed * 2;
            canJump      = false;
            GetComponent <MeshRenderer>().material.mainTexture = vertText;
            break;

        case TypePlayer.rouge:
            currentSpeed = normalSpeed * 2;
            canJump      = true;
            GetComponent <MeshRenderer>().material.mainTexture = rougeTex;
            break;
        }
    }
Esempio n. 13
0
    // Start is called before the first frame update
    void Start()
    {
        //PlayerPrefs.DeleteAll();

        //we create the playfab manager after checking if there's no other object of its kind already created
        PlayFabManager[] managersActive = FindObjectsOfType <PlayFabManager>();
        if (managersActive.Length > 1) //later menu reach. must erase the new playfabManager
        {
            GameObject logPanel = playFabManager.playerLoginPanel;
            for (int i = 0; i < managersActive.Length; i++)
            {
                if (!managersActive[i].activeManager)
                {
                    logPanel = managersActive[i].gameObject;
                    Destroy(managersActive[i].gameObject);
                }
                else
                {
                    playFabManager = managersActive[i];
                }
            }

            playFabManager.playerLoginPanel = logPanel;
            playFabManager.playerLoginPanel.SetActive(false);
            LoginSuccess();
        }
        else
        {
            DontDestroyOnLoad(playFabManager.gameObject);
            playFabManager.StartLogin();
            ShowScreen(4);
        }

        int currentChances = PlayerPrefs.GetInt("playChances", CurrencySettings.instance.maxPlayChances);

        currentPlayChances = currentChances;
    }
        public override void Initialize()
        {
            this.StartCoroutine(InitializeCoroutine());

            IEnumerator InitializeCoroutine()
            {
                yield return(ReleasesManager.WaitForInitialization());

                yield return(PlayFabManager.WaitForInitialization());

                var settings  = ReleasesManager.Instance.CurrentRelease.RealtimeMessageManagerSettings;
                var isEnabled = settings.IsEnabled;
                var ablyKey   = settings.AblyClientKey;

                if (isEnabled)
                {
#if !USING_ABLY
                    Debug.LogError("RealtimeMessageManager: Trying to use this manager, but the USING_ABLY define is not set." +
                                   "Make sure you have installed Ably 1.1.14 (https://github.com/ably/ably-dotnet/tree/1.1.14) and that the" +
                                   "USING_ABLY define is set or else this manager will not work.", this);
#else
                    if (ablyKey.IsNullOrWhitespace() == false)
                    {
                        this.InitilializeAbly(ablyKey);
                    }
                    else
                    {
                        Debug.LogError(
                            "RealtimeMessageManager requires a valid Ably Client Key in the Releases RealtimeMessageManagerSettings. " +
                            "This manager will not work properly. Go to https://www.ably.io/accounts to get a valid client key.", this);
                    }
#endif
                }

                this.SetInstance(this);
            }
        }
    void Awake()
    {
        instance = this;

    }
Esempio n. 16
0
 void Awake()
 {
     playFabMananger = GameObject.Find("PlayFabManager").GetComponent <PlayFabManager>();
     txtCoins.text   = playFabMananger.Player_Coin.ToString();
 }
Esempio n. 17
0
 public TitleNewsManager(PlayFabManager playfabManager)
 {
     this.playfabManager = playfabManager;
 }
    /// <summary>
    /// Prevents object from being destroyed, gets necessary references.
    /// </summary>
    void Awake()
    {
        instance = this;
        DontDestroyOnLoad(this.gameObject);

        facebookManager = this.GetComponent<FacebookManager>();
        playFabManager = this.GetComponent<PlayFabManager>();
    }
Esempio n. 19
0
 // Use this for initialization
 void Start()
 {
     //		showFriendsTest ();
     playFabManager = GameManager.Instance.playfabManager;
 }
 public RegisterUserCommand(PlayFabManager playFabManager, string username, string password)
 {
     _playFabManager = playFabManager;
     _username       = username;
     _password       = password;
 }
Esempio n. 21
0
 void Awake()
 {
     jumpPlugin = GetComponent <JumpPlugin>();
     playFab    = GetComponent <PlayFabManager>();
 }
Esempio n. 22
0
 public void Leaderboard()
 {
     PlayFabManager.SendLeaderboard(time);
 }
Esempio n. 23
0
 void Awake()
 {
     instance = this;
 }
 private void Awake()
 {
     playFabManager = GameObject.Find("PlayFabManager").GetComponent <PlayFabManager>();
     playFabManager.LoadingMessage("Loading LeaderBoard...");
     ReadLeaderBoard();
 }
Esempio n. 25
0
 private void Start()
 {
     PlayFabManager.PostPlayerData("Kills", killsAchievement.currentPoints);
     PlayFabManager.PostPlayerData("Wins", winsAchievement.currentPoints);
 }
 public LogoutUserCommand(PlayFabManager playFabManager, SettingsContainer settingsContainer)
 {
     _playFabManager    = playFabManager;
     _settingsContainer = settingsContainer;
 }
 private void Awake()
 {
     Instance = this;
 }