Esempio n. 1
0
    void FindScripts()
    {
        // Find Controller GameObject
        GameObject controller =  Camera.main.gameObject;

        // Attach scripts that are attached to controller object
        sc_CameraController = controller.GetComponent<CameraController>();
        sc_GameController   = controller.GetComponent<GameController>();
        sc_LevelManager     = controller.GetComponent<LevelManager>();
        sc_RowManager       = controller.GetComponent<RowManager>();

        // Find Scripts not attached to controller object
        sc_AudioManager     = GameObject.Find("audio_manager").GetComponent<AudioManager>();

        if (LevelName == "Intro") return;

        sc_FadeToScene      = GameObject.FindGameObjectWithTag("Fade").GetComponent<FadeToScene>();
        sc_HighScoreManager = GameObject.FindGameObjectWithTag("Scores").GetComponent<HighScoreManager>();

        if (CheckObjectExist("score_tracker"))
            sc_ScoreTracker     = GameObject.Find("score_tracker").GetComponent<ScoreTracker>();

        if (CheckObjectExist("glow_ball"))
            sc_BallController   = GameObject.Find("glow_ball").GetComponent<BallController>();

        if (CheckObjectExist("boundaries"))
            sc_BoundaryManager   = GameObject.Find("boundaries").GetComponent<BoundaryManager>();
    }
Esempio n. 2
0
    void FollowPlayerUntilPassBounds(BoundaryManager currentBounds)
    {
        // Following the player freely
        if (!isAbleToClamp)
        {
            transform.position = Vector3.Lerp(transform.position, new Vector3(player.position.x, player.position.y, transform.position.z), cameraDelay);
        }

        // Until the player enters the area, keep "leaving the camera free"
        if (!currentBounds.alreadyClampedThisBounds)
        {
            isAbleToClamp = false;
        }

        // Debug
        boundsMax = currentBounds.managerBox.bounds.max;
        boundsMin = currentBounds.managerBox.bounds.min;

        // Checking if the player is within the limit area
        if (
            currentBounds.managerBox.bounds.min.x < leftPoint.x &&
            currentBounds.managerBox.bounds.max.x > rightPoint.x &&
            currentBounds.managerBox.bounds.min.y < topPoint.y &&
            currentBounds.managerBox.bounds.max.y > bottomPoint.y &&
            !currentBounds.alreadyClampedThisBounds
            )
        {
            currentBounds.alreadyClampedThisBounds = true;
            isAbleToClamp = true;
        }
    }
Esempio n. 3
0
        protected virtual void Start()
        {
            // Get the Boundary Manager instance.
            GameObject boundaryBox = GameObject.FindGameObjectWithTag("BoundaryBox");

            if (boundaryBox != null)
            {
                this.boundaryManager = boundaryBox.GetComponent <BoundaryManager>();
            }
        }
Esempio n. 4
0
    void Start()
    {
        // Attach Scripts to holders
        sc_ScriptHelper    = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <ScriptHelper>();
        sc_BoundaryManager = sc_ScriptHelper.sc_BoundaryManager;
        sc_GameController  = sc_ScriptHelper.sc_GameController;
        sc_LevelManager    = sc_ScriptHelper.sc_LevelManager;

        Time_Between_Rows = 2.0f;
    }
    void Start()
    {
        if (UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque == false)
        {
            Debug.Log("Not an immersive display so we'll use spatial mapping instead of this fake world");
            Destroy(this.gameObject);
            return;
        }

        playspace = BoundaryManager.Instance;
    }
Esempio n. 6
0
    void Start()
    {
        // Attach Scripts to holders
        sc_ScriptHelper    = Camera.main.GetComponent <ScriptHelper>();
        sc_BoundaryManager = sc_ScriptHelper.sc_BoundaryManager;
        sc_GameController  = sc_ScriptHelper.sc_GameController;
        sc_LevelManager    = sc_ScriptHelper.sc_LevelManager;

        // Get users saved settings for ball sensitivity
        ball_speed = PlayerPrefs.GetFloat("glow_ball_speed", 9.0f);

        if (!isTestBall)
        {
            // Set the ball to the first intermission height
            SET_BallToIntermission();
        }
    }
Esempio n. 7
0
    void Start()
    {
        // Attach Scripts to holders
        sc_ScriptHelper     = Camera.main.GetComponent<ScriptHelper>();
        sc_BallController   = sc_ScriptHelper.sc_BallController;
        sc_BoundaryManager  = sc_ScriptHelper.sc_BoundaryManager;
        sc_CameraController = sc_ScriptHelper.sc_CameraController;
        sc_GameController   = sc_ScriptHelper.sc_GameController;
        sc_RowManager       = sc_ScriptHelper.sc_RowManager;

        // Set intermission time intertval
        Time_Between_Intermission = 5.0f;

        // Set intermission height
        BallIntermissionHeight = 65;

        // Set speed at which rows move up
        LevelSpeed = 2.0f;
        sc_RowManager.SET_RowSpeed(LevelSpeed);

        StartCoroutine( StartInitermission() );
    }
Esempio n. 8
0
    void Start()
    {
        // Attach Scripts to holders
        sc_ScriptHelper     = Camera.main.GetComponent <ScriptHelper>();
        sc_BallController   = sc_ScriptHelper.sc_BallController;
        sc_BoundaryManager  = sc_ScriptHelper.sc_BoundaryManager;
        sc_CameraController = sc_ScriptHelper.sc_CameraController;
        sc_GameController   = sc_ScriptHelper.sc_GameController;
        sc_RowManager       = sc_ScriptHelper.sc_RowManager;

        // Set intermission time intertval
        Time_Between_Intermission = 5.0f;

        // Set intermission height
        BallIntermissionHeight = 65;

        // Set speed at which rows move up
        LevelSpeed = 2.0f;
        sc_RowManager.SET_RowSpeed(LevelSpeed);

        StartCoroutine(StartInitermission());
    }
Esempio n. 9
0
    void FindScripts()
    {
        // Find Controller GameObject
        GameObject controller = Camera.main.gameObject;

        // Attach scripts that are attached to controller object
        sc_CameraController = controller.GetComponent <CameraController>();
        sc_GameController   = controller.GetComponent <GameController>();
        sc_LevelManager     = controller.GetComponent <LevelManager>();
        sc_RowManager       = controller.GetComponent <RowManager>();

        // Find Scripts not attached to controller object
        sc_AudioManager = GameObject.Find("audio_manager").GetComponent <AudioManager>();

        if (LevelName == "Intro")
        {
            return;
        }

        sc_FadeToScene      = GameObject.FindGameObjectWithTag("Fade").GetComponent <FadeToScene>();
        sc_HighScoreManager = GameObject.FindGameObjectWithTag("Scores").GetComponent <HighScoreManager>();

        if (CheckObjectExist("score_tracker"))
        {
            sc_ScoreTracker = GameObject.Find("score_tracker").GetComponent <ScoreTracker>();
        }

        if (CheckObjectExist("glow_ball"))
        {
            sc_BallController = GameObject.Find("glow_ball").GetComponent <BallController>();
        }

        if (CheckObjectExist("boundaries"))
        {
            sc_BoundaryManager = GameObject.Find("boundaries").GetComponent <BoundaryManager>();
        }
    }
Esempio n. 10
0
    void Start()
    {
        // Attach Scripts to holders
        sc_ScriptHelper    = Camera.main.GetComponent<ScriptHelper>();
        sc_BoundaryManager = sc_ScriptHelper.sc_BoundaryManager;
        sc_GameController  = sc_ScriptHelper.sc_GameController;
        sc_LevelManager    = sc_ScriptHelper.sc_LevelManager;

        // Get users saved settings for ball sensitivity
        ball_speed = PlayerPrefs.GetFloat("glow_ball_speed", 9.0f);

        if (!isTestBall)
        // Set the ball to the first intermission height
        SET_BallToIntermission();
    }
Esempio n. 11
0
 void Awake()
 {
     Instance = this;
 }
Esempio n. 12
0
    void Start()
    {
        // Attach Scripts to holders
        sc_ScriptHelper    = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<ScriptHelper>();
        sc_BoundaryManager = sc_ScriptHelper.sc_BoundaryManager;
        sc_GameController = sc_ScriptHelper.sc_GameController;
        sc_LevelManager    = sc_ScriptHelper.sc_LevelManager;

        Time_Between_Rows = 2.0f;
    }
 void Start()
 {
     managerBox = GetComponent <BoxCollider2D>();
     player     = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>();
     instance   = this;
 }