Ejemplo n.º 1
0
    void Start()
    {
        player                = GameObject.Find("Player"); //Reference to Player Game Object
        playerScript          = player.GetComponent <PlayerController>();
        primaryController     = player.GetComponent <PrimaryController>();
        storeControllerScript = storeObject.GetComponent <StoreController>();
        ZombieSpawner         = GameObject.Find("ZombieSpawner");
        //spawnerScript = ZombieSpawner.GetComponent<Spawner>();
        zombieSpawnerScript = ZombieSpawner.GetComponent <ZombieSpawner>();

        optionsOverlay           = GameObject.Find("OptionsOverlay");
        optionsOverlayController = optionsOverlay.GetComponent <OptionsOverlayController>();
        optionsOverlayController.displayOverlayOff();

        soundController       = GameObject.Find("SoundController");
        soundControllerScript = soundController.GetComponent <SoundController>();

        rpController       = GameObject.Find("RPController");
        rpControllerScript = rpController.GetComponent <RPController>();


        if (PlayerPrefs.HasKey("PlayerName"))
        {
            playerName = PlayerPrefs.GetString("PlayerName");
        }


        //FB.API (Util.GetPictureURL ("me", 128, 128), Facebook.HttpMethod.GET, PictureCallBack);
    }
Ejemplo n.º 2
0
    void Start()
    {
        player = GameObject.Find("Player");                                //Reference to Player Game Object
        playerControllerScript = player.GetComponent <PlayerController>(); // Reference to PlayerController Script
        secondaryController    = player.GetComponent <SecondaryController>();
        primaryController      = player.GetComponent <PrimaryController>();

        soundController       = GameObject.Find("SoundController");
        soundControllerScript = soundController.GetComponent <SoundController>();
        rpController          = GameObject.Find("RPController");
        rpControllerScript    = rpController.GetComponent <RPController>();

        zombieSpawner       = GameObject.Find("ZombieSpawner");
        zombieSpawnerScript = zombieSpawner.GetComponent <ZombieSpawner>();

        storeObject                = GameObject.Find("Store");
        storeControllerScript      = storeObject.GetComponent <StoreController>();
        primaryButtonsController   = storeObject.GetComponent <PrimaryButtonsController>();
        secondaryButtonsController = storeObject.GetComponent <SecondaryButtonsController>();
        survivorButtonsController  = storeObject.GetComponent <SurvivorButtonsController>();

        if (PlayerPrefs.HasKey("PlayerName"))
        {
            playerName = PlayerPrefs.GetString("PlayerName");
        }

        if (PlayerPrefs.HasKey("DisplayFreeRPBubble"))
        {
            displayFreeRPBubble = PlayerPrefs.GetInt("DisplayFreeRPBubble");
        }
        else
        {
            displayFreeRPBubble = 1;
        }
    }
Ejemplo n.º 3
0
    void Start()
    {
        playerScript               = player.GetComponent <PlayerController> ();
        hud                        = player.GetComponent <PlayerHUD>();
        primaryButtonsController   = this.GetComponent <PrimaryButtonsController>();
        secondaryButtonsController = this.GetComponent <SecondaryButtonsController>();
        survivorButtonsController  = this.GetComponent <SurvivorButtonsController>();
        soundController            = GameObject.Find("SoundController");
        soundControllerScript      = soundController.GetComponent <SoundController>();
        rpController               = GameObject.Find("RPController");
        rpControllerScript         = rpController.GetComponent <RPController>();

        //if (PlayerPrefs.HasKey ("RP")) {
        //	currentRP = PlayerPrefs.GetInt ("RP");
        //}

        //rpControllerScript.refreshRP();
    }
    void Start()
    {
        player                = GameObject.Find("Player");
        soundController       = GameObject.Find("SoundController");
        playerScript          = player.GetComponent <PlayerController> ();
        primaryController     = player.GetComponent <PrimaryController> ();
        storeControllerScript = storeObject.GetComponent <StoreController>();
        soundControllerScript = soundController.GetComponent <SoundController>();
        rpController          = GameObject.Find("RPController");
        rpControllerScript    = rpController.GetComponent <RPController>();

        if (PlayerPrefs.HasKey("PurchasedbunkerLevels"))
        {
            bunkerLevelCounter = PlayerPrefs.GetInt("PurchasedbunkerLevels");
        }

        bunkerLevel += bunkerLevelCounter;
        maxSurvivors = bunkerLevel * 2;
    }
Ejemplo n.º 5
0
    void OnGUI()
    {
        GUI.skin.font     = defaultFont;
        myStyle           = new GUIStyle(GUI.skin.textField); // Set Text GUI Style
        myStyle.alignment = TextAnchor.MiddleCenter;          // Set Text to Center Alignment

        GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), mainMenubackground, ScaleMode.StretchToFill);

        if (adultOverlayShown == 0 || clearCheck)         // Disable Play Button and Options Button if a pop-up needs to come up
        {
            GUI.enabled = false;
        }
        playerName = GUI.TextField(new Rect(347, 310, 105, 20), playerName, 10, myStyle);         // Draw Player Name Text Field

        if (GUI.Button(new Rect(325, 350, 150, 33), playButtonImage, GUIStyle.none))
        {
            if (playerName.Equals("Name?"))             //If name hasn't been changed from default text
            {
                PlayerPrefs.SetString("PlayerName", "Player");
            }
            else               //If Name has been changed
            {
                PlayerPrefs.SetString("PlayerName", playerName);
            }
            //PlayerPrefs.SetInt("Gender", gender);//Sets Gender
            soundControllerScript.playSFX("bubbleClick");
            Application.LoadLevel("Instructions");
        }

        if (optionsOverlayController.getDisplayOverlay())
        {
            GUI.enabled = false;
        }

        if (GUI.Button(new Rect(325, 400, 150, 33), optionsButtonImage, GUIStyle.none))                 // On Right
        {
            optionsOverlayController.displayOverlayOn();
            displayOptions = true;
            soundControllerScript.playSFX("bubbleClick");
        }
        GUI.enabled = true;
        if (displayOptions)
        {
            optionsOverlayController.display();                                      // Display Options Overlay - Calling it from here so it displayed above background texture
        }
        if (GUI.Button(new Rect(325, 450, 150, 33), exitButtonImage, GUIStyle.none)) // On Right
        {
            soundControllerScript.playSFX("bubbleClick");
            Application.Quit();
        }
        GUI.enabled = true;
        if (adultOverlayShown == 0)
        {
            GUI.depth = -1;
            //GUI.DrawTexture (new Rect (275, 285, 250, 170), adultOverlayBackground, ScaleMode.StretchToFill);
            GUI.Label(new Rect(105, 305, 600, 135), new GUIContent("This game may include content not suitable for children and \n deleting cookies and/or temporary files may delete game data.\n You also agree to the terms set forth in our End User License Agreement & Terms of Service. \n Are you ok with this?"), myStyle); //Draw Scraps Number

            if (GUI.Button(new Rect(120, 395, 39, 39), checkMarkButton, GUIStyle.none))                                                                                                                                                                                                                                              // On Right
            {
                optionsOverlayController.setAdultContentOn();
                PlayerPrefs.SetInt("AdultOverlay", 1);
                adultOverlayShown = 1;
                soundControllerScript.playSFX("bubbleClick");
            }

            /*if (GUI.Button (new Rect (230, 400, 75, 33), tosButton, GUIStyle.none)) {	// On Right
             *      Application.ExternalEval("window.open('http://www.playeditstudios.com/termsofservice.html','_blank')");
             *      soundControllerScript.playSFX("bubbleClick");
             * }
             *
             * if (GUI.Button (new Rect (500, 400, 75, 33), eulaButton, GUIStyle.none)) {	// On Right
             *      Application.ExternalEval("window.open('http://www.playeditstudios.com/Ranger/Ranger_EULA.html','_blank')");
             *      soundControllerScript.playSFX("bubbleClick");
             * }*/

            if (GUI.Button(new Rect(650, 395, 39, 39), xButton, GUIStyle.none))                 // On Right
            {
                PlayerPrefs.SetInt("AdultOverlay", 1);
                adultOverlayShown = 1;
                optionsOverlayController.setAdultContentOff();
                soundControllerScript.playSFX("bubbleClick");
            }

            GUI.depth = 0;
        }

        if (clearCheck)
        {
            GUI.depth = -1;
            GUI.Label(new Rect(105, 305, 600, 135), new GUIContent("This will clear all data including items purchased with real money.\n Are you ok with this?"), myStyle); //Draw Scraps Number

            if (GUI.Button(new Rect(120, 395, 39, 39), checkMarkButton, GUIStyle.none))                                                                                      // On Right
            {
                PlayerPrefs.DeleteAll();                                                                                                                                     //Delete all PlayerPrefs
                if (rpController != null)
                {
                    rpControllerScript = rpController.GetComponent <RPController>();
                    rpControllerScript.setRP(2200);
                }
                Start();
                clearCheck = false;
                soundControllerScript.playSFX("bubbleClick");
            }

            if (GUI.Button(new Rect(650, 395, 39, 39), xButton, GUIStyle.none))                 // On Right
            {
                clearCheck = false;
                soundControllerScript.playSFX("bubbleClick");
            }
            GUI.depth = 0;
        }
        GUI.Label(new Rect(5, 575, 90, 20), "Ranger v1");          //Draw Scraps Number
    }