예제 #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()
 {
     pS           = PoolingSystem.Instance;
     playerScript = player.GetComponent <PlayerController> ();
     milestoneControllerScript = player.GetComponent <MilestoneController>();
     storeControllerScript     = storeObject.GetComponent <StoreController>();
     survivorButtonsController = storeObject.GetComponent <SurvivorButtonsController>();
 }
    void Start()
    {
        player              = GameObject.Find("Player");
        ZombieSpawner       = GameObject.Find("ZombieSpawner");
        soundController     = GameObject.Find("SoundController");
        playerScript        = player.GetComponent <PlayerController> ();
        secondaryController = player.GetComponent <SecondaryController> ();

        storeControllerScript     = storeObject.GetComponent <StoreController>();
        survivorButtonsController = storeObject.GetComponent <SurvivorButtonsController>();
        //spawnerScript = ZombieSpawner.GetComponent<Spawner> ();
        zombieSpawnerScript   = ZombieSpawner.GetComponent <ZombieSpawner> ();
        soundControllerScript = soundController.GetComponent <SoundController>();
    }
예제 #4
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();
    }
예제 #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.
    }