void Awake()
    {
        wasOccupied = false;

        if (GameObject.Find ("BlockSpawner")){
            blockSpawner = GameObject.Find ("BlockSpawner");
        }
        launchCount = 0;
        f = 0;
        lowThresh = 10f;
        highThresh = 90f;
        knockbackFactor = 4f;
        baselineKnockback = 20f;

        occupied = false;
        nowProjectile = false;
        waiting = false;
        blockTypes = new int[] {0,0,0,0};
        storedWeapons = new GameObject[] {null,null,null,null};

        superNeutralBlockPath = "Prefabs/WeaponBlocks/SuperNeutralBlock";
        superExplosiveBlockPath = "Prefabs/WeaponBlocks/SuperExplosiveBlock";
        superFrozesplosiveBlockPath = "Prefabs/WeaponBlocks/SuperFreezeBlock";
        superTelekineticBlockPath = "Prefabs/WeaponBlocks/SuperTelekineticBlock";
        superTurretBlockPath = "Prefabs/WeaponBlocks/SuperTurretBlock";

        if (gameObject.name == "WeaponDetector1"){
            chargeDisplay = GameObject.Find ("ChargeBar1").GetComponent<ChargeDisplay> ();
            character = GameObject.Find ("Hero1");

            arm = GameObject.Find ("Arm1").transform;
            tractorBeam = GameObject.Find ("TractorBeam1").GetComponent<TractorBeam>();
            wepDSID = 1;
        }
        else {
            chargeDisplay = GameObject.Find ("ChargeBar2").GetComponent<ChargeDisplay> ();
            character = GameObject.Find ("Hero2");

            arm = GameObject.Find ("Arm2").transform;
            tractorBeam = GameObject.Find ("TractorBeam2").GetComponent<TractorBeam>();
            wepDSID = 2;
        }
        player = character.GetComponent<Player> ();
        controller = character.GetComponent<Controller> ();

        if (GameObject.Find ("MainCamera").GetComponent<CameraFollowPlayer1> ().enabled){
            c1 = true;
            c2 = false;
            cameraFollowPlayer1 = GameObject.Find ("MainCamera").GetComponent<CameraFollowPlayer1> ();
        }
        else {
            c1 = false;
            c2 = true;
            cameraBattleArena = GameObject.Find ("MainCamera").GetComponent<CameraBattleArena> ();
        }
        baselineFire = 300f;
        fireSpeed = 12f;
        StartCoroutine (PeriodicCatalog ());
    }
예제 #2
0
 // Use this for initialization
 void Awake()
 {
     cameraScript         = GameObject.Find("MainCamera").GetComponent <CameraFollowPlayer1> ();
     weaponDetectorScript = GameObject.Find("WeaponDetector1").GetComponent <WeaponDetectorScript> ();
 }
예제 #3
0
 // Use this for initialization
 void Awake()
 {
     cameraScript = GameObject.Find ("MainCamera").GetComponent<CameraFollowPlayer1> ();
     weaponDetectorScript = GameObject.Find ("WeaponDetector1").GetComponent<WeaponDetectorScript> ();
 }
예제 #4
0
    void Awake()
    {
        wasOccupied = false;

        if (GameObject.Find("BlockSpawner"))
        {
            blockSpawner = GameObject.Find("BlockSpawner");
        }
        launchCount       = 0;
        f                 = 0;
        lowThresh         = 10f;
        highThresh        = 90f;
        knockbackFactor   = 4f;
        baselineKnockback = 20f;

        occupied      = false;
        nowProjectile = false;
        waiting       = false;
        blockTypes    = new int[] { 0, 0, 0, 0 };
        storedWeapons = new GameObject[] { null, null, null, null };

        superNeutralBlockPath       = "Prefabs/WeaponBlocks/SuperNeutralBlock";
        superExplosiveBlockPath     = "Prefabs/WeaponBlocks/SuperExplosiveBlock";
        superFrozesplosiveBlockPath = "Prefabs/WeaponBlocks/SuperFreezeBlock";
        superTelekineticBlockPath   = "Prefabs/WeaponBlocks/SuperTelekineticBlock";
        superTurretBlockPath        = "Prefabs/WeaponBlocks/SuperTurretBlock";

        if (gameObject.name == "WeaponDetector1")
        {
            chargeDisplay = GameObject.Find("ChargeBar1").GetComponent <ChargeDisplay> ();
            character     = GameObject.Find("Hero1");

            arm         = GameObject.Find("Arm1").transform;
            tractorBeam = GameObject.Find("TractorBeam1").GetComponent <TractorBeam>();
            wepDSID     = 1;
        }
        else
        {
            chargeDisplay = GameObject.Find("ChargeBar2").GetComponent <ChargeDisplay> ();
            character     = GameObject.Find("Hero2");

            arm         = GameObject.Find("Arm2").transform;
            tractorBeam = GameObject.Find("TractorBeam2").GetComponent <TractorBeam>();
            wepDSID     = 2;
        }
        player     = character.GetComponent <Player> ();
        controller = character.GetComponent <Controller> ();

        if (GameObject.Find("MainCamera").GetComponent <CameraFollowPlayer1> ().enabled)
        {
            c1 = true;
            c2 = false;
            cameraFollowPlayer1 = GameObject.Find("MainCamera").GetComponent <CameraFollowPlayer1> ();
        }
        else
        {
            c1 = false;
            c2 = true;
            cameraBattleArena = GameObject.Find("MainCamera").GetComponent <CameraBattleArena> ();
        }
        baselineFire = 300f;
        fireSpeed    = 12f;
        StartCoroutine(PeriodicCatalog());
    }