예제 #1
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;
        }
    }
예제 #2
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);
    }
예제 #3
0
 void Start()
 {
     pS                       = PoolingSystem.Instance;
     player                   = GameObject.Find("Player");
     primaryController        = player.GetComponent <PrimaryController>();
     spriteRenderer           = this.GetComponent <SpriteRenderer>();
     optionsOverlay           = GameObject.Find("OptionsOverlay");
     optionsOverlayController = optionsOverlay.GetComponent <OptionsOverlayController>();
 }
    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;
    }
예제 #5
0
    void Start()
    {
        Time.timeScale = 1f;         // Death Scene Pauses game. This ensures it is not paused when the game starts

        floodingControllerObject = GameObject.Find("FloodingController");
        floodingControllerScript = floodingControllerObject.GetComponent <FloodingController>();
        body = this.GetComponent <Rigidbody2D>();
        //milestoneControllerScript = this.GetComponent<MilestoneController>();
        bulletSpawnPoint          = transform.Find("BulletSpawnPoint").gameObject;
        gatlingSpawnPoint         = transform.Find("GatlingGunBulletSpawnPoint").gameObject;
        storeControllerScript     = storeObject.GetComponent <StoreController>();
        spriteRenderer            = this.GetComponent <SpriteRenderer>();
        survivorSpawner           = GameObject.Find("SurvivorSpawner");
        survivorSpawnerScript     = survivorSpawner.GetComponent <SurvivorSpawner>();
        secondaryController       = this.GetComponent <SecondaryController>();
        primaryController         = this.GetComponent <PrimaryController>();
        survivorButtonsController = storeObject.GetComponent <SurvivorButtonsController>();
        zombieSpawnerScript       = ZombieSpawner.GetComponent <ZombieSpawner>();

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

        hud             = this.GetComponent <PlayerHUD>();
        displayHUDCheck = true;
        shotGunSpawn1   = GameObject.Find("ShotGunSpawnPoint1");
        shotGunSpawn2   = GameObject.Find("ShotGunSpawnPoint2");
        shotGunSpawn3   = GameObject.Find("ShotGunSpawnPoint3");
        shotGunSpawn4   = GameObject.Find("ShotGunSpawnPoint4");

        if (PlayerPrefs.HasKey("JumpScare"))
        {
            jumpScareToggle = PlayerPrefs.GetInt("JumpScare");
        }

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

        setPlayerSprite();

        int spawnLocation = (int)Random.Range(0f, 4f);

        if (spawnLocation == 0)
        {
            this.transform.position = new Vector3(-12, -12, 0);
        }
        else if (spawnLocation == 1)
        {
            this.transform.position = new Vector3(-12, 12, 0);
        }
        else if (spawnLocation == 2)
        {
            this.transform.position = new Vector3(12, 12, 0);
        }
        else if (spawnLocation == 3)
        {
            this.transform.position = new Vector3(12, -12, 0);
        }

        currentHealth   = maxHealth;
        currentScraps   = 100;      //500;
        jumpScareToggle = 0;        //Set JumpScare to off, because I'm removing it.
    }
예제 #6
0
    /*void Start () {
     *      pS = PoolingSystem.Instance;
     *      body = this.GetComponent<Rigidbody2D>();
     *      player = GameObject.Find("Player"); //Reference to Player Game Object
     *      primaryController = player.GetComponent<PrimaryController>(); // Reference to PlayerController Script
     *      ZombieSpawner = GameObject.Find("ZombieSpawner"); //Reference to Player Game Object
     *      playerControllerScript = player.GetComponent<PlayerController>(); // Reference to PlayerController Script
     *      //spawnerScript = ZombieSpawner.GetComponent<Spawner> ();
     *      spawnAI = this.GetComponent<SpawnAI>();
     *      circleCollider = GetComponent<CircleCollider2D>();
     *      spriterenderer = this.GetComponent<SpriteRenderer>();
     *
     *
     *      int zombieType = (int)Random.Range(0f,3f);
     *
     *      if (zombieType == 0) {//Regular Zombie
     *              movementSpeed = 1f + (spawnerScript.getCurrentRound () / 10f);
     *              if(movementSpeed > 1.5f){
     *                      movementSpeed = 1.5f;
     *              }
     *              maxHealth = 100 + (spawnerScript.getCurrentRound () * 10);
     *              this.gameObject.name = "Zombie";
     *              //Set Animator To Regular
     *      } else if (zombieType == 1) {
     *              movementSpeed = 1f + (spawnerScript.getCurrentRound () / 2f);
     *              if(movementSpeed > 1.7f){
     *                      movementSpeed = 1.7f;
     *              }
     *              maxHealth = 75;
     *              spriterenderer.sprite = fastZombie;
     *              this.gameObject.name = "FastZombie";
     *              //Set Animator to Fast
     *      } else if (zombieType == 2){
     *              movementSpeed = 1f + (spawnerScript.getCurrentRound () / 10f)/2f;
     *              if(movementSpeed > 1.4f){
     *                      movementSpeed = 1.4f;
     *              }
     *              maxHealth = 100 + (spawnerScript.getCurrentRound () * 10)*2;
     *              spriterenderer.sprite = fatZombie;
     *              this.gameObject.name = "FatZombie";
     *              //animator.SetInteger("Type",2);//Set Animator to Fat
     *      }
     *      currentHealth = maxHealth;
     * }*/

    void OnEnable()
    {
        pS                     = PoolingSystem.Instance;
        player                 = GameObject.Find("Player");                 //Reference to Player Game Object
        primaryController      = player.GetComponent <PrimaryController>(); // Reference to PlayerController Script
        ZombieSpawner          = GameObject.Find("ZombieSpawner");          //Reference to Player Game Object
        zombieSpawnerScript    = ZombieSpawner.GetComponent <ZombieSpawner>();
        playerControllerScript = player.GetComponent <PlayerController>();  // Reference to PlayerController Script
        spriterenderer         = this.GetComponent <SpriteRenderer>();

        dead = true;

        int zombieType = (int)Random.Range(0f, 3f);

        if (zombieType == 0)          //Regular Zombie
        {
            movementSpeed = 1f + (zombieSpawnerScript.getCurrentRound() / 10f);
            if (movementSpeed > 1.5f)
            {
                movementSpeed = 1.5f;
            }
            maxHealth            = 100 + (zombieSpawnerScript.getCurrentRound() * 12);
            this.gameObject.name = "Zombie";
            //Set Animator To Regular
        }
        else if (zombieType == 1)
        {
            movementSpeed = 1f + (zombieSpawnerScript.getCurrentRound() / 2f);
            if (movementSpeed > 1.7f)
            {
                movementSpeed = 1.7f;
            }
            maxHealth = 75 + (zombieSpawnerScript.getCurrentRound() * 10);
            //spriterenderer.sprite = fastZombie;
            this.gameObject.name = "FastZombie";
            //Set Animator to Fast
        }
        else if (zombieType == 2)
        {
            movementSpeed = 1f + (zombieSpawnerScript.getCurrentRound() / 10f) / 2f;
            if (movementSpeed > 1.4f)
            {
                movementSpeed = 1.4f;
            }
            maxHealth = 100 + (zombieSpawnerScript.getCurrentRound() * 12) * 2;
            //spriterenderer.sprite = fatZombie;
            this.gameObject.name = "FatZombie";
            //animator.SetInteger("Type",2);//Set Animator to Fat
        }

        int zombieSprite = (int)Random.Range(0f, 8f);        // 0-7 - inclusive

        if (zombieSprite == 1)
        {
            spriterenderer.sprite = zombieOne;
        }
        else if (zombieSprite == 2)
        {
            spriterenderer.sprite = zombieTwo;
        }
        else if (zombieSprite == 3)
        {
            spriterenderer.sprite = zombieThree;
        }
        else if (zombieSprite == 4)
        {
            spriterenderer.sprite = zombieFour;
        }
        else if (zombieSprite == 5)
        {
            spriterenderer.sprite = zombieFive;
        }
        else if (zombieSprite == 6)
        {
            spriterenderer.sprite = zombieSix;
        }
        else if (zombieSprite == 7)
        {
            spriterenderer.sprite = zombieSeven;
        }
        else
        {
            spriterenderer.sprite = zombieZero;
        }

        currentHealth = maxHealth;
    }