Exemplo n.º 1
0
    void GetNextAnchor()
    {
        Vector3 newAnchorPos = anchor.transform.position + (transform.position - anchor.transform.position) * 2;

        if (CameraSize.CheckIfOnScreen(0, newAnchorPos))
        {
            dir = -dir;
            anchor.transform.position = newAnchorPos;
        }
    }
Exemplo n.º 2
0
 void Start()
 {
     //Guardamos la posición de anclaje de la cámara
     anchor = transform.GetChild(0).GetComponent <Transform>().position;
     cam    = SmoothMovement.mainCamera.gameObject;
     //Guardamos referencias a los scripts necesarios de la cámara
     movement = cam.gameObject.GetComponent <SmoothMovement>();
     camSize  = cam.gameObject.transform.GetChild(0).GetComponent <CameraSize>();
     //Guardamos el tamaño base de la cámara
     defaultSize = camSize.GetSize();
 }
Exemplo n.º 3
0
    public void CheckGameField_PointOffTheHeight_01()
    {
        Camera     camera           = Camera.main;
        CameraSize cameraSizeScript = new CameraSize();

        Vector3 point          = new Vector3(0, 10, 0);
        bool    expectedResult = true;

        bool result = cameraSizeScript.IsOffTheFieldHeight(point, camera);

        Assert.AreEqual(expectedResult, result);
    }
Exemplo n.º 4
0
    public void CheckGameField_PointOffTheWidth_02()
    {
        Camera     camera           = Camera.main;
        CameraSize cameraSizeScript = new CameraSize();

        Vector3 point          = new Vector3(0, 0, 0);
        bool    expectedResult = false;

        bool result = cameraSizeScript.IsOffTheFieldWidth(point, camera);

        Assert.AreEqual(expectedResult, result);
    }
Exemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        transform.position = CameraSize.CheckIfOnScreenWithTransfer(offset, transform.position);

        /*
         *
         *      if (transform.position.x > HBoundX + offset)
         *          Destroy (gameObject);
         *      if (transform.position.x < LBoundX - offset)
         *          Destroy (gameObject);
         *
         *      if (transform.position.y > HBoundY + offset)
         *          Destroy (gameObject);
         *      if (transform.position.y < LBoundY - offset)
         *          Destroy (gameObject);
         */
    }
Exemplo n.º 6
0
    void Awake()
    {
        if (alPrScr == null)
        {
            alPrScr = FindObjectOfType <AllPrefsScript>();
        }
        if (univFunc == null)
        {
            univFunc = FindObjectOfType <UniversalFunctions>();
        }
        if (gM == null)
        {
            gM = FindObjectOfType <GameManager> ();
        }
        if (adMob == null)
        {
            adMob = FindObjectOfType <AndroidAdMob_0>();
        }
        if (buf == null)
        {
            buf = FindObjectOfType <Buffer>();
        }

        if (cntrL == null)
        {
            cntrL = FindObjectOfType <CountriesList>();
        }
        if (plL == null)
        {
            plL = FindObjectOfType <PlayersList>();
        }
        if (prMng == null)
        {
            prMng = FindObjectOfType <ProfileManager>();
        }

        switch (SceneManager.GetActiveScene().buildIndex)
        {
        case 1:
            if (upgr == null)
            {
                upgr = FindObjectOfType <Upgrades>();
            }
            if (allAw == null)
            {
                allAw = FindObjectOfType <AllAwardsScript>();
            }
            if (topPanMng == null)
            {
                topPanMng = FindObjectOfType <TopPanelManager>();
            }
            if (objM == null)
            {
                objM = FindObjectOfType <Objects_Menu>();
            }
            if (currPrPan == null)
            {
                currPrPan = FindObjectOfType <CurrentProfilePanel>();
            }
            if (everyDayReward == null)
            {
                everyDayReward = FindObjectOfType <EverydayReward>();
            }
            if (carMng == null)
            {
                carMng = FindObjectOfType <CareerManager>();
            }
            break;

        case 2:
            if (fwScr == null)
            {
                fwScr = FindObjectOfType <FireworkScript>();
            }
            if (molnia == null)
            {
                molnia = FindObjectOfType <LighteningScript>();
            }
            if (practScr == null)
            {
                practScr = FindObjectOfType <Practice>();
            }
            if (timFr == null)
            {
                timFr = FindObjectOfType <TimeFreeze>();
            }
            if (rainMan == null)
            {
                rainMan = FindObjectOfType <RainManager>();
            }
            if (bonObjMan == null)
            {
                bonObjMan = FindObjectOfType <BonusObjManager>();
            }
            if (enOrDis == null)
            {
                enOrDis = FindObjectOfType <EnableOrDisable>();
            }
            if (monWin == null)
            {
                monWin = FindObjectOfType <MoneyWinScript>();
            }
            if (camSize == null)
            {
                camSize = FindObjectOfType <CameraSize>();
            }
            if (colCorr == null)
            {
                colCorr = FindObjectOfType <ColorCorrectionControl>();
            }
            if (marks == null)
            {
                marks = FindObjectOfType <Markers>();
            }
            if (goalPanScr == null)
            {
                goalPanScr = FindObjectOfType <GoalPanelScript>();
            }
            if (objLev == null)
            {
                objLev = FindObjectOfType <Objects_Level>();
            }
            if (scoreScr == null)
            {
                scoreScr = FindObjectOfType <Score>();
            }
            if (pMov == null)
            {
                pMov = FindObjectOfType <PlayerMovement>();
            }
            if (tM == null)
            {
                tM = FindObjectOfType <TimeManager>();
            }
            if (ballScr == null)
            {
                ballScr = FindObjectOfType <BallScript>();
            }
            if (grTr == null)
            {
                grTr = FindObjectOfType <GroundTrigger1>();
            }
            if (congrPan == null)
            {
                congrPan = FindObjectOfType <CongradulationsPanel>();
            }
            if (levAudScr == null)
            {
                levAudScr = FindObjectOfType <LevelAudioScript>();
            }
            if (stChScr == null)
            {
                stChScr = FindObjectOfType <StadiumChooseScript>();
            }
            if (ballTScr == null)
            {
                ballTScr = FindObjectOfType <BallTouchScript>();
            }
            if (jScr == null)
            {
                jScr = FindObjectOfType <JumpScript>();
            }
            if (skyScr == null)
            {
                skyScr = FindObjectOfType <SkyScript>();
            }
            //if (enAlg == null) enAlg = FindObjectOfType<Enemy>();
            break;
        }
    }
Exemplo n.º 7
0
 protected override void Awake()
 {
     base.Awake();
     cameraSizeScript = new CameraSize();
 }
Exemplo n.º 8
0
 void Start()
 {
     camera = objeto.GetComponent <CameraSize>();
     camera.SetSize(10f);
 }