Esempio n. 1
0
 // Use this for initialization
 void Start()
 {
     ES           = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     SPS          = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
     OPProjectile = GameObject.Find("ObjectPoolerSachelShrap").GetComponent <ObjectPoolScript> ();
     OPTrail      = GameObject.Find("ObjectPoolerTrailS").GetComponent <ObjectPoolScript> ();
 }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        Delay = 2;
        SpawnWithNoControls = true;
        ES  = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
        RHS = GameObject.Find("WinTextObj").GetComponent <RoundHandlerScript> ();

        SpawnInQue = new bool[4];
        for (int i = 0; i < 4; i++)
        {
            SpawnInQue[i] = false;
            SpawnPointsProtection[i].SetActive(false);
        }
        if (ES.GetActivePlayer(0))
        {
            Respawn(0);
        }
        if (ES.GetActivePlayer(1))
        {
            Respawn(1);
        }
        if (ES.GetActivePlayer(2))
        {
            Respawn(2);
        }
        if (ES.GetActivePlayer(3))
        {
            Respawn(3);
        }
    }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        ES = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();

        /*
         * Kfield = new Text[4];
         * Dfield = new Text[4];
         * Sfield = new Text[4];
         * Afield = new Text[4];
         * Pfield = new Text[4];*/
        spotOccupied = new bool[4];
        shotsFired   = new int[4];
        shotsHit     = new int[4];
        deaths       = new int[4];
        kills        = new int[4];
        Suicides     = new int[4];
        damageDone   = new int[4];
        place        = new int[4];
        InputEnabled = false;
        playerIndex  = new PlayerIndex[4];
        state        = new GamePadState[4];
        prevState    = new GamePadState[4];
        ActivePlayer = new bool[4];
        for (int x = 0; x < 4; x++)
        {
            playerIndex [x] = (PlayerIndex)x;
            if (ES.GetActivePlayer(x))
            {
                ActivePlayer[x] = true;
                NumOfPlayers++;
            }
        }

        PopulateArray();
    }
Esempio n. 4
0
    //SoundPlayerScript SPS;
    //bool CanStepSound;
    //int StepCounter;

    // Use this for initialization
    void Start()
    {
        //CanStepSound = true;
        //StepCounter = 0;
        //SPS = GameObject.Find ("Main Camera").GetComponent<SoundPlayerScript> ();
        PauseScript = GameObject.Find("PauseMenuComponent").GetComponent <UIPauseMenuScript>();
        ES          = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
        RB          = GetComponent <Rigidbody2D> ();
        LR          = GetComponent <LineRenderer> ();
        RS          = GameObject.Find("RespawnObject").GetComponent <RespawnScript>();
        PauseScript.SetPlayer(PlayerNumber, this);
        AimingCursor.SetActive(false);
        ReticleRB = AimingCursor.GetComponent <Rigidbody2D> ();
        AimingCursor.GetComponent <SpriteRenderer> ().color = GetComponent <SpriteRenderer> ().color;
        Color C = ES.GetColor(PlayerNumber);

        C.r += .2f;
        C.g += .2f;
        C.b += .2f;
        Color C2 = C;

        C2.a = .2f;
        LR.SetColors(C, C2);
        currentRot = Quaternion.identity;
        if (BounceReticle)
        {
            LR.SetVertexCount(4);
        }
    }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        RS       = GameObject.Find("RespawnObject").GetComponent <RespawnScript>();
        Stats    = GameObject.Find("TotalStatsHolder").GetComponent <EndGameStatsScript>();
        ES       = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
        WinText  = GameObject.Find("WinTextObj").GetComponent <Text>();
        WarBarP1 = GameObject.Find("KillBarP1").GetComponent <Image> ();
        WarBarP2 = GameObject.Find("KillBarP2").GetComponent <Image> ();
        WarBarP3 = GameObject.Find("KillBarP3").GetComponent <Image> ();
        WarBarP4 = GameObject.Find("KillBarP4").GetComponent <Image> ();

        WarBarP1.color = ES.GetColor(0);
        WarBarP2.color = ES.GetColor(1);
        WarBarP3.color = ES.GetColor(2);
        WarBarP4.color = ES.GetColor(3);

        WarBarP1.fillAmount = 0;
        WarBarP2.fillAmount = 0;
        WarBarP3.fillAmount = 0;
        WarBarP4.fillAmount = 0;
        P1Kills             = 0;
        P2Kills             = 0;
        P3Kills             = 0;
        P4Kills             = 0;

        KillsToWin      = ES.GetKillNumber();
        WinText.text    = "";
        WinText.enabled = false;

        // temporary dev tool
        KillsToWin = 10;
    }
Esempio n. 6
0
 // Use this for initialization
 void Start()
 {
     ES           = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     SPS          = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
     OPProjectile = GameObject.Find("ObjectPoolerGrenadeShrap").GetComponent <ObjectPoolScript> ();
     OPTrail      = GameObject.Find("ObjectPoolerTrailS").GetComponent <ObjectPoolScript> ();
     Trail        = Resources.Load("ShortTrail") as GameObject;
 }
Esempio n. 7
0
 void OnLevelWasLoaded(int level)
 {
     if (level == 2)
     {
         ES                = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
         CurrentColor      = ES.GetColor(PlayerNum);
         RedSlider.value   = CurrentColor.r;
         GreenSlider.value = CurrentColor.g;
         BlueSlider.value  = CurrentColor.b;
     }
 }
Esempio n. 8
0
    // Use this for initialization
    void Start()
    {
        SPS               = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
        PCS               = GetComponent <PlayerControlScript> ();
        ES                = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
        SpriteColor       = GetComponent <SpriteRenderer> ();
        CurrentColor      = ES.GetColor(PCS.GetPlayerNum());
        SpriteColor.color = CurrentColor;

        Stats = GameObject.Find("TotalStatsHolder").GetComponent <EndGameStatsScript>();
    }
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
Esempio n. 10
0
 // Use this for initialization
 void Start()
 {
     ES  = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     PCS = GetComponent <PlayerControlScript> ();
     SPS = GameObject.Find("Main Camera").GetComponent <SoundPlayerScript> ();
     AS  = GetComponent <AmmoScript>();
     AS.SetSecondaryMagazineSize(2);
     PCS.SetSecondaryWeapon(Shoot);
     ShotTimer         = 0;
     ShootFireCooldown = 50;
     CanShoot          = true;
     projectile        = Resources.Load("KnifeProjectilePrefab") as GameObject;
 }
Esempio n. 11
0
 // Use this for initialization
 void Start()
 {
     ES           = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     SPS          = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
     OPProjectile = GameObject.Find("ObjectPoolerTripMine").GetComponent <ObjectPoolScript> ();
     PCS          = GetComponent <PlayerControlScript> ();
     AS           = GetComponent <AmmoScript>();
     AS.SetSecondaryMagazineSize(2);
     PCS.SetSecondaryWeapon(Shoot);
     ShotTimer         = 0;
     ShootFireCooldown = 25;
     CanShoot          = true;
 }
Esempio n. 12
0
 // Use this for initialization
 void Start()
 {
     ES  = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     SPS = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
     PCS = GetComponent <PlayerControlScript> ();
     AS  = GetComponent <AmmoScript>();
     AS.SetPrimaryMagazineSize(1);
     AS.SetReloadTime(.5f);
     PCS.SetPrimaryWeapon(Charge);
     ShotTimer         = 0;
     ShootFireCooldown = 15;
     CanShoot          = true;
     projectile        = Resources.Load("SwordPrefab") as GameObject;
 }
Esempio n. 13
0
 // Use this for initialization
 void Start()
 {
     ES           = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     SPS          = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
     OPProjectile = GameObject.Find("ObjectPoolerFireArrow").GetComponent <ObjectPoolScript> ();
     PCS          = GetComponent <PlayerControlScript> ();
     AS           = GetComponent <AmmoScript>();
     AS.SetPrimaryMagazineSize(3);
     AS.SetReloadTime(1.5f);
     PCS.SetPrimaryWeapon(Shoot);
     ShotTimer         = 0;
     ShootFireCooldown = 15;
     CanShoot          = true;
 }
Esempio n. 14
0
 // Use this for initialization
 void Start()
 {
     ES  = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     SPS = GameObject.Find("Main Camera").GetComponent <SoundPlayerScript> ();
     PCS = GetComponent <PlayerControlScript> ();
     AS  = GetComponent <AmmoScript>();
     AS.SetPrimaryMagazineSize(3);
     AS.SetReloadTime(2f);
     PCS.SetPrimaryWeapon(Shoot);
     ShotTimer         = 0;
     ShootFireCooldown = 15;
     CanShoot          = true;
     projectile        = Resources.Load("SplitProjectilePrefab") as GameObject;
     Trail             = Resources.Load("ShortTrail") as GameObject;
 }
Esempio n. 15
0
 // Use this for initialization
 void Start()
 {
     ES           = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     SPS          = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
     OPProjectile = GameObject.Find("ObjectPoolerAssault").GetComponent <ObjectPoolScript> ();
     OPTrail      = GameObject.Find("ObjectPoolerTrailS").GetComponent <ObjectPoolScript> ();
     PCS          = GetComponent <PlayerControlScript> ();
     AS           = GetComponent <AmmoScript>();
     AS.SetPrimaryMagazineSize(15);
     AS.SetReloadTime(2f);
     PCS.SetPrimaryWeapon(Shoot);
     ShotTimer         = 0;
     ShootFireCooldown = 4;
     CanShoot          = true;
     //projectile = Resources.Load ("AssultProjectilePrefab") as GameObject;
     //Trail = Resources.Load ("ShortTrail") as GameObject;
 }
Esempio n. 16
0
    // Use this for initialization
    void Start()
    {
        ES  = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
        SPS = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
        PCS = GetComponent <PlayerControlScript> ();
        AS  = GetComponent <AmmoScript>();
        AS.SetSecondaryMagazineSize(2);
        PCS.SetSecondaryWeapon(ShootOutline);
        PCS.SetSecondaryWeaponRelease(Shoot);
        CanShoot   = true;
        projectile = Resources.Load("ShieldPrefab") as GameObject;
        POutline   = Instantiate(projectile, Vector3.zero, Quaternion.identity) as GameObject;
        Color CtoChange = ES.GetColor(PCS.GetPlayerNum());

        CtoChange.a = .75f;
        POutline.GetComponent <SpriteRenderer> ().color = CtoChange;
        POutline.SetActive(false);
    }
Esempio n. 17
0
 // Use this for initialization
 void Start()
 {
     CCS           = GameObject.Find("Main Camera").GetComponent <CameraControllerScript>();
     PCS           = GetComponent <PlayerControlScript> ();
     PlayerColor   = GetComponent <SpriteRenderer> ().color;
     RHS           = GameObject.Find("WinTextObj").GetComponent <RoundHandlerScript> ();
     BoarderColor  = HitBoarder.color;
     SPS           = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
     Stats         = GameObject.Find("TotalStatsHolder").GetComponent <EndGameStatsScript>();
     ES            = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     Invincible    = true;
     bulletNumbers = new int[4];
     for (int x = 0; x < 4; x++)
     {
         bulletNumbers[x] = -1;
     }
     Invoke("RemoveIncincible", 2f);
 }
Esempio n. 18
0
 // Use this for initialization
 void Start()
 {
     ES           = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     SPS          = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
     OPProjectile = GameObject.Find("ObjectPoolerRng").GetComponent <ObjectPoolScript> ();
     OPGrenade    = GameObject.Find("ObjectPoolerGrenadeRng").GetComponent <ObjectPoolScript> ();
     OPTrail      = GameObject.Find("ObjectPoolerTrailS").GetComponent <ObjectPoolScript> ();
     PCS          = GetComponent <PlayerControlScript> ();
     AS           = GetComponent <AmmoScript>();
     AS.SetPrimaryMagazineSize(5);
     AS.SetReloadTime(2f);
     PCS.SetPrimaryWeapon(Shoot);
     ShotTimer         = 0;
     ShootFireCooldown = 20;
     CanShoot          = true;
     projectile        = Resources.Load("RngGunProjectile") as GameObject;
     projectileG       = Resources.Load("GrenadeRngPrefab") as GameObject;
     Trail             = Resources.Load("ShortTrail") as GameObject;
 }
Esempio n. 19
0
 // Use this for initialization
 void Start()
 {
     ES           = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     PCS          = GetComponent <PlayerControlScript> ();
     SPS          = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
     OPProjectile = GameObject.Find("ObjectPoolerGrenade").GetComponent <ObjectPoolScript> ();
     OPTrail      = GameObject.Find("ObjectPoolerTrailS").GetComponent <ObjectPoolScript> ();
     AS           = GetComponent <AmmoScript>();
     AS.SetSecondaryMagazineSize(2);
     PCS.SetSecondaryWeapon(Cook);
     PCS.SetSecondaryWeaponRelease(Shoot);
     ShotTimer           = 0;
     CookTime            = 0;
     ShootFireCooldown   = 50;
     CanShoot            = true;
     projectile          = Resources.Load("GrenadePrefab") as GameObject;
     Trail               = Resources.Load("ShortTrail") as GameObject;
     GrenadeDetonateTime = projectile.GetComponent <ProjectileScript> ().SelfDestruct;
 }
Esempio n. 20
0
 // Use this for initialization
 void Start()
 {
     ES  = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     PCS = GetComponent <PlayerControlScript> ();
     SPS = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
     AS  = GetComponent <AmmoScript>();
     AS.SetSecondaryMagazineSize(2);
     PCS.SetSecondaryWeapon(Shoot);
     ShotTimer         = 0;
     ShootFireCooldown = 10;
     CanShoot          = true;
     ProjectileWrapper = Resources.Load("WallProjectileWrapper") as GameObject;
     ProjectileWrapper = Instantiate(ProjectileWrapper, Vector3.zero, Quaternion.identity) as GameObject;
     PrimaryBullet     = ProjectileWrapper.transform.GetChild(0).gameObject;
     SecondaryBullet   = ProjectileWrapper.transform.GetChild(1).gameObject;
     WPS = PrimaryBullet.GetComponent <WallProjectileScript> ();
     PrimaryBullet.SetActive(false);
     SecondaryBullet.SetActive(false);
 }
Esempio n. 21
0
 // Use this for initialization
 void Start()
 {
     ES           = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     PCS          = GetComponent <PlayerControlScript> ();
     SPS          = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
     OPProjectile = GameObject.Find("ObjectPoolerLazer").GetComponent <ObjectPoolScript> ();
     particlesOBJ = Resources.Load("ChargeParticleHolder") as GameObject;
     AS           = GetComponent <AmmoScript>();
     AS.SetPrimaryMagazineSize(6);
     AS.SetReloadTime(3f);
     PCS.SetPrimaryWeapon(Charge);
     PCS.SetPrimaryWeaponRelease(Shoot);
     ShotTimer                  = 0;
     chargeLevel                = 1;
     ShootFireCooldown          = 7;
     CanShoot                   = true;
     particlesOBJ               = Instantiate(particlesOBJ, transform.position, transform.rotation) as GameObject;
     particlesSystem            = particlesOBJ.GetComponentInChildren <ParticleSystem> ();
     particlesSystem.startColor = ES.GetColor(PCS.GetPlayerNum());
     particlesOBJ.SetActive(false);
 }
Esempio n. 22
0
    // Use this for initialization
    void Start()
    {
        SPS = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
        ES  = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();

        LeftRightPos        = new int[4];
        UpDownPos           = new int[4];
        InputAllowedLR      = new bool[4];
        InputAllowedUD      = new bool[4];
        InputResetCounterLR = new int[4];
        InputResetCounterUD = new int[4];
        CurrentSlide        = new int[4] {
            1, 1, 1, 1
        };
        CurrentSelectedButton = new int[4];
        playerIndex           = new PlayerIndex[4];
        state           = new GamePadState[4];
        prevState       = new GamePadState[4];
        lockedIn        = false;
        NumberOfPlayers = 0;

        for (int x = 0; x < 4; x++)
        {
            playerIndex [x] = (PlayerIndex)x;
        }

        if (ES.CheckIfSecondVisit())
        {
            SetOverviewPrimaryText(0, ES.GetPrimary(0));
            SetOverviewPrimaryText(1, ES.GetPrimary(1));
            SetOverviewPrimaryText(2, ES.GetPrimary(2));
            SetOverviewPrimaryText(3, ES.GetPrimary(3));
            SetOverviewSecondaryText(0, ES.GetSecondary(0));
            SetOverviewSecondaryText(1, ES.GetSecondary(1));
            SetOverviewSecondaryText(2, ES.GetSecondary(2));
            SetOverviewSecondaryText(3, ES.GetSecondary(3));
        }
    }
Esempio n. 23
0
    // Use this for initialization
    void Start()
    {
        ES                = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
        LeftRightPos      = new int[4];
        UpDownPos         = new int[4];
        InputAllowed      = new bool[4];
        LockedIn          = new bool[4];
        ActivePlayer      = new bool[4];
        PlayerVote        = new int[4];
        InputResetCounter = new int[4];
        SPS               = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();

        playerIndex = new PlayerIndex[4];
        state       = new GamePadState[4];
        prevState   = new GamePadState[4];

        for (int x = 0; x < 4; x++)
        {
            playerIndex [x] = (PlayerIndex)x;
        }

        Invoke("DelayInitialPosition", .1f);
    }
Esempio n. 24
0
    // Use this for initialization
    void Start()
    {
        ES                = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
        LeftRightPos      = new int[4];
        UpDownPos         = new int[4];
        InputResetCounter = new int[4];
        InputAllowed      = new bool[4];
        CurrentPlayer     = new bool[4];
        PCS               = new PlayerControlScript[4];
        SPS               = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
        SetBoarderActive(0);



        playerIndex = new PlayerIndex[4];
        state       = new GamePadState[4];
        prevState   = new GamePadState[4];

        for (int x = 0; x < 4; x++)
        {
            playerIndex [x] = (PlayerIndex)x;
        }
    }
Esempio n. 25
0
 // Use this for initialization
 void Start()
 {
     ES           = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     preview1     = GetComponent <Image> ();
     CurrentColor = Color.white;
 }
Esempio n. 26
0
 // Use this for initialization
 void Start()
 {
     SPS = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
     ES  = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
 }
Esempio n. 27
0
 // Use this for initialization
 void Awake()
 {
     ES = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     PS = GetComponent <ParticleSystem> ();
 }
 // Use this for initialization
 void Awake()
 {
     ES = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     GetComponent <Image> ().color = ES.GetColor(PNum);
 }