Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        GameObject gl = GameObject.Find("Global");

        nav           = GameObject.FindGameObjectWithTag("NavAgent");
        nav_obj       = nav.GetComponent <NavMeshAgent>();
        globalObj     = gl.GetComponent <Level1_Global>();
        uniWii        = gl.GetComponent <UniWiiCheck>();
        spawn_nav_obj = GameObject.FindGameObjectWithTag("ObsNavAgent").GetComponent <NavMeshAgent>();

        cameraController = GameObject.Find("OVRCameraController");
        so = cameraController.GetComponentsInChildren <ScreenOverlay>();

        // Set the screen overlay parameters
        so[0].enabled   = false;
        so[0].blendMode = ScreenOverlay.OverlayBlendMode.AlphaBlend;
        so[0].intensity = 1.0f;

        so[1].enabled   = false;
        so[1].blendMode = ScreenOverlay.OverlayBlendMode.AlphaBlend;
        so[1].intensity = 1.0f;

        overlayTimer  = 0.5f;
        overlayToggle = false;

        //gameObject.rigidbody.AddForce(0, 0, -1000);//new Vector3(Random.Range (-10,10),0,Random.Range (-4,-5)));//
        // Avoid collision between the navAgent and the obstacles
        Physics.IgnoreLayerCollision(11, 20, true);
        Physics.IgnoreLayerCollision(10, 20, true);
        Physics.IgnoreLayerCollision(20, 20, true);
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        uniWii = gameObject.GetComponent<UniWiiCheck>();

        pauseEnabled = true;

        // Refresh PlayerPrefs
        PlayerPrefs.SetInt("Complete", 0);
        PlayerPrefs.SetString("SceneToLoad", "Level2");
        //PlayerPrefs.SetInt("Score", score);
        //PlayerPrefs.SetFloat("Time", timer);
        //PlayerPrefsX.SetStringArray("AchievementList", LEVEL1_ACH);
        //PlayerPrefsX.SetIntArray("AchievementTracker", LEVEL1_ACH_TRACKER);
    }
Ejemplo n.º 3
0
    // Start
    new public virtual void Start()
    {
        base.Start();

        InitializeInputs();
        SetCameras();

        //getting uniwiicheck script
        GameObject gl = GameObject.Find("Global");

        uniWii    = gl.GetComponent <UniWiiCheck>();
        globalObj = gl.GetComponent <Level1_Global>();

        nav_obj     = GameObject.FindGameObjectWithTag("NavAgent").GetComponent <NavMeshAgent>();
        obs_nav_obj = GameObject.FindGameObjectWithTag("ObsNavAgent").GetComponent <NavMeshAgent>();
    }
Ejemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        g = GameObject.Find("Gilly");
        SetOVRCameraController(ref CameraController);

        uniWii = gameObject.GetComponent <UniWiiCheck>();

        currentHealth  = 100;
        maxHealth      = 100;
        currentStamina = 100.0f;
        maxStamina     = 100.0f;

        storedHealthPU  = false;
        storedStaminaPU = false;

        bubblesLeft       = Constants.MAX_BUBBLES;
        bubbleRegenTimer  = Constants.BUBBLE_REGEN_TIME;
        staminaRegenTimer = Constants.STAMINA_REGEN_TIME;

        score     = 0;
        startTime = Time.time;
    }
Ejemplo n.º 5
0
    // Start
    public new virtual void Start()
    {
        base.Start();

        InitializeInputs();
        SetCameras();

        //getting uniwiicheck script
        GameObject gl = GameObject.Find("Global");
        uniWii = gl.GetComponent<UniWiiCheck>();

        if(PlayerPrefs.GetInt("Level") == 1)
            globalObj = gl.GetComponent<Level1_Global>();

        else if(PlayerPrefs.GetInt("Level") == 2)
            globalObj2 = gl.GetComponent<Level2_Global>();

        nav_obj = GameObject.FindGameObjectWithTag("NavAgent").GetComponent<NavMeshAgent>();
        obs_nav_obj = GameObject.FindGameObjectWithTag("ObsNavAgent").GetComponent<NavMeshAgent>();
    }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        GameObject gl = GameObject.Find("Global");
        nav = GameObject.FindGameObjectWithTag("NavAgent");
        navObj = nav.GetComponent<NavMeshAgent>();
        globalObj = gl.GetComponent<Level1_Global>();
        uniWii = gl.GetComponent<UniWiiCheck>();
        obstacleNavObj = GameObject.FindGameObjectWithTag("ObsNavAgent").GetComponent<NavMeshAgent>();
        audioScript = gl.GetComponent<Level1_Audio>();

        cameraController = GameObject.Find("OVRCameraController");
        so = cameraController.GetComponentsInChildren<ScreenOverlay>();

        // Set the screen overlay parameters
        so[0].enabled = false;
        so[0].blendMode = ScreenOverlay.OverlayBlendMode.AlphaBlend;
        so[0].intensity = 1.0f;

        so[1].enabled = false;
        so[1].blendMode = ScreenOverlay.OverlayBlendMode.AlphaBlend;
        so[1].intensity = 1.0f;

        overlayTimer = 0.5f;
        overlayToggle = false;

        bubbleParticleSpawnTimer = Constants.BUBBLE_PARTICLE_SPAWN_TIMER;

        powerUpSpawnTimer = UnityEngine.Random.Range(15.0f, 20.0f);

        playGrindSound = false;
        grindTimer = 0.0f;

        // Easy
        if(globalObj.branchDiff == 0)
            obstacleTimer = UnityEngine.Random.Range(0.5f, 2.0f);

        // Hard
        else if(globalObj.branchDiff == 1)
            obstacleTimer = UnityEngine.Random.Range(0.5f, 1.0f);

        // Avoid collision between the navAgent and the obstacles
        Physics.IgnoreLayerCollision(11, 20, true);
        Physics.IgnoreLayerCollision(10, 20, true);
        Physics.IgnoreLayerCollision(20, 20, true);

        Physics.IgnoreLayerCollision(17, 20, true);
    }
Ejemplo n.º 7
0
    // Use this for initialization
    void Start()
    {
        // Set camera controller
        SetOVRCameraController(ref CameraController);

        uniWii = gameObject.GetComponent<UniWiiCheck>();
        audioScript = gameObject.GetComponent<Level1_Audio>();

        currentHealth = 100;
        maxHealth = 100;
        currentStamina = 100.0f;
        maxStamina = 100.0f;

        storedHealthPU = false;
        storedStaminaPU = false;

        bubblesLeft = Constants.MAX_BUBBLES;
        bubbleRegenTimer = Constants.BUBBLE_REGEN_TIME;
        staminaRegenTimer = Constants.STAMINA_REGEN_TIME;
        shootTimer = Constants.SHOOT_TIME;
        shootEnabled = true;

        pauseTimer = Constants.PAUSE_TOGGLE_DELAY;
        pauseEnabled = true;

        // Default setting = easy
        branchDiff = 0;

        score = 0;
        startTime = Time.time;

        smObsDestroyed = 0;

        // Ignore appropriate collisions
        setUpPhysics();

        // Achievements
        LEVEL1_ACH = new string[] {	"Complete the level in under 10 minutes",
                                    "Shoot and destroy 25 small obstacles",
                                    "Complete the level without using any health power-ups",
                                    "Complete the level while selecting the industrial pipes at each junction"};

        LEVEL1_ACH_TRACKER = new int[] {1, 0, 1, 1};

        PlayerPrefs.SetInt("Complete", 0);
        PlayerPrefs.SetInt("Score", score);
        PlayerPrefs.SetFloat("Time", timer);
        PlayerPrefs.SetString("SceneToLoad", "Level1");
        PlayerPrefsX.SetStringArray("AchievementList", LEVEL1_ACH);
        PlayerPrefsX.SetIntArray("AchievementTracker", LEVEL1_ACH_TRACKER);
    }