// Use this for initialization
    void Start()
    {
        pView = pc.GetComponent <PhotonView>();
        if (!pView.IsMine)
        {
            return;
        }
        correctStreak  = 0;
        gameOver       = true;
        questionMode   = false;
        Cursor.visible = false;
        paused         = false;

        imageHolder.SetActive(false);
        pauseMenu.SetActive(false);

        gameSparksHandler = GameObject.FindWithTag("gsh").GetComponent <GameSparksHandler>();
        words             = gameSparksHandler.getWords();
        defs      = gameSparksHandler.getDefs();
        defs2     = gameSparksHandler.getDefs2();
        misspell1 = gameSparksHandler.getMisspell();
        misspell2 = gameSparksHandler.getMisspell2();
        misspell3 = gameSparksHandler.getMisspell3();
        listID    = gameSparksHandler.getIDS();
        type      = gameSparksHandler.getTypes();
        listEmpty = gameSparksHandler.getListEmptys();
        studyXP   = gameSparksHandler.getStudyXPS();



        settings = gameSparksHandler.getSettings();

        numSets = 0;
        for (int i = 0; i < listID.Length; i++)
        {
//            Debug.Log("List Empty " + i + " val " + listEmpty[i]);
            if (!listEmpty[i])
            {
                indexes.Add(i);
                Debug.Log("id: " + listID[i]);
                numSets++;
            }
        }
        for (int i = 0; i < 10; i++)
        {
            if (!listEmpty[i])
            {
                donePhrases[i] = new bool[words[i].Length];
            }
        }
        //numSets = words.Length;
        //Debug.Log("sets: " + numSets);
    }
Ejemplo n.º 2
0
    void Start()
    {
        //sets the active skin on other players' devices
        if (!pView.IsMine)
        {
            return;
        }
        else
        {
            pView.RPC("setSkinAndStuff", RpcTarget.OthersBuffered, null);

            new LogEventRequest().SetEventKey("loadPlayerData").Send((response) => {
                if (!response.HasErrors)
                {
                    Debug.Log("Received Player Data From GameSparks...");
                    GSData data        = response.ScriptData.GetGSData("Game_Data");
                    oldWins            = (int)data.GetInt("HydroFlash_WINS");
                    oldLosses          = (int)data.GetInt("HydroFlash_LOSSES");
                    oldBlasts          = (int)data.GetInt("HydroFlash_BLASTS");
                    oldDeaths          = (int)data.GetInt("HydroFlash_DEATHS");
                    oldXP              = (int)data.GetInt("HydroFlash_XP");
                    shotsFired         = (int)data.GetInt("HydroFlash_FIRED");
                    shotsLanded        = (int)data.GetInt("HydroFlash_LANDED");
                    incorrectQuestions = (int)data.GetInt("HydroFlash_IQ");
                    correctQuestions   = (int)data.GetInt("HydroFlash_CQ");
                    elapsedTime        = (long)data.GetLong("HydroFlash_TIME");
                    tutorialNum        = (int)data.GetInt("HydroFlash_TUTNUM");
                    if (tutorialNum < 11)
                    {
                        showTutorial = true;
                        tutorialObj.changeTutNum(tutorialNum);
                        tutorialObj.gameObject.SetActive(true);
                    }
                    else
                    {
                        showTutorial = false;
                        tutorialObj.gameObject.SetActive(false);
                    }
                }
                else
                {
                    Debug.Log("Error Loading Player Data...");
                }
            });


            settingData = handler.getSettings();
            autoWP      = settingData[5];
        }
    }