예제 #1
0
    void Start()
    {
        monkeyScript  = GameObject.Find("monkey").GetComponent <monkey_Level_09>();
        zebraScript   = GameObject.Find("zebra").GetComponent <zebra_Level_09>();
        rhinoScript   = GameObject.Find("rhino").GetComponent <rhino_Level_09>();
        gorillaScript = GameObject.Find("gorilla").GetComponent <gorilla_Level_09>();

        dogFightDustScript = GameObject.Find("dogFightDust").GetComponent <dogFightDust>();

        monkey       = GameObject.Find("monkey");
        zebra        = GameObject.Find("zebra");
        rhino        = GameObject.Find("rhino");
        dogLimitArea = GameObject.Find("dogLimitArea");

        anim = this.GetComponent <Animator>();

        highlightZebMeercat01 = GameObject.Find("highlightZebMeercat01");
        highlightZebRabbit01  = GameObject.Find("highlightZebRabbit01");
        highlightZebRabbit02  = GameObject.Find("highlightZebRabbit02");
        highlightZebRabbit03  = GameObject.Find("highlightZebRabbit03");
        highlightZebRabbit04  = GameObject.Find("highlightZebRabbit04");
        highlightZebTeller01  = GameObject.Find("highlightZebTeller01");
        highlightZebTeller02  = GameObject.Find("highlightZebTeller02");
        highlightZebTeller03  = GameObject.Find("highlightZebTeller03");
        highlightZebTeller04  = GameObject.Find("highlightZebTeller04");
        highlightZebSafebox   = GameObject.Find("highlightZebSafebox");
        highlightZebSafebox02 = GameObject.Find("highlightZebSafebox02");
        highlightZebSafebox03 = GameObject.Find("highlightZebSafebox03");
    }
    // Use this for initialization
    void Start()
    {
        cameraScript      = GameObject.Find("Main Camera").GetComponent <Camera>();
        dummyCameraZoon01 = GameObject.Find("dummyCameraZoon01");
        dummyCameraZoon02 = GameObject.Find("dummyCameraZoon02");
        camera            = GameObject.Find("Main Camera");

        rhino               = GameObject.Find("rhino");
        rhinoDummy          = GameObject.Find("rhinoDummy");
        highlightZebSafebox = GameObject.Find("highlightZebSafebox");

        //total score from previews lavels
        lastLevelScore = PlayerPrefs.GetInt("Player Score");

        zebraScript = GameObject.Find("zebra").GetComponent <zebra_Level_09>();
        zebraScript.moneyDone.Play();

        totalScore   = totalScore + lastLevelScore;
        guiText.text = ("$" + totalScore.ToString());

        moneyRandomMeercat01 = PlayerPrefs.GetInt("moneyRandomMeercat01_level09");
        moneyRandomRabbit01  = PlayerPrefs.GetInt("moneyRandomRabbit01_level09");
        moneyRandomRabbit02  = PlayerPrefs.GetInt("moneyRandomRabbit02_level09");
        moneyRandomRabbit03  = PlayerPrefs.GetInt("moneyRandomRabbit03_level09");
        moneyRandomRabbit04  = PlayerPrefs.GetInt("moneyRandomRabbit04_level09");
        moneyRandomTeller01  = PlayerPrefs.GetInt("moneyRandomTeller01_level09");
        moneyRandomTeller02  = PlayerPrefs.GetInt("moneyRandomTeller02_level09");
        moneyRandomTeller03  = PlayerPrefs.GetInt("moneyRandomTeller03_level09");
        moneyRandomTeller04  = PlayerPrefs.GetInt("moneyRandomTeller04_level09");
        moneyRandomSafebox   = PlayerPrefs.GetInt("moneyRandomSafebox_level09");
        moneyRandomSafebox02 = PlayerPrefs.GetInt("moneyRandomSafebox02_level09");
        moneyRandomSafebox03 = PlayerPrefs.GetInt("moneyRandomSafebox03_level09");
        Debug.Log(moneyRandomTeller01);


        totalLevelMoney = moneyRandomMeercat01
                          + moneyRandomTeller01 + moneyRandomTeller02 + moneyRandomTeller03 + moneyRandomTeller04 +
                          moneyRandomRabbit01 + moneyRandomRabbit02 + moneyRandomRabbit03 + moneyRandomRabbit04 +
                          moneyRandomSafebox + moneyRandomSafebox02 + moneyRandomSafebox03;

        //texts layer is 11 but not timer and score
        cameraScript.cullingMask = ~(1 << 11);


        int screenWidthX  = Screen.width;
        int screenHeightY = Screen.height;


        scoreBG = GameObject.Find("scoreBG");

        Vector3 scoreBGPos   = Camera.main.WorldToScreenPoint(scoreBG.transform.position);
        float   scoreBGPos_x = (scoreBGPos.x / screenWidthX);
        float   scoreBGPos_y = (scoreBGPos.y / screenHeightY);

        this.transform.position = new Vector3(scoreBGPos_x, scoreBGPos_y, 0);

        guiText.fontSize = (int)(Screen.width * 0.04f);
    }
    void Start()
    {
        highlightZebMeercat01 = GameObject.Find("highlightZebMeercat01");
        highlightZebRabbit01  = GameObject.Find("highlightZebRabbit01");
        highlightZebRabbit02  = GameObject.Find("highlightZebRabbit02");
        highlightZebRabbit03  = GameObject.Find("highlightZebRabbit03");
        highlightZebRabbit04  = GameObject.Find("highlightZebRabbit04");
        highlightZebTeller01  = GameObject.Find("highlightZebTeller01");
        highlightZebTeller02  = GameObject.Find("highlightZebTeller02");
        highlightZebTeller03  = GameObject.Find("highlightZebTeller03");
        highlightZebTeller04  = GameObject.Find("highlightZebTeller04");
        highlightZebSafebox   = GameObject.Find("highlightZebSafebox");
        highlightZebSafebox02 = GameObject.Find("highlightZebSafebox02");
        highlightZebSafebox03 = GameObject.Find("highlightZebSafebox03");

        dummyHighlightZebMeercat01 = GameObject.Find("dummyHighlightZebMeercat01");
        dummyHighlightZebRabbit01  = GameObject.Find("dummyHighlightZebRabbit01");
        dummyHighlightZebRabbit02  = GameObject.Find("dummyHighlightZebRabbit02");
        dummyHighlightZebRabbit03  = GameObject.Find("dummyHighlightZebRabbit03");
        dummyHighlightZebRabbit04  = GameObject.Find("dummyHighlightZebRabbit04");
        dummyHighlightZebTeller01  = GameObject.Find("dummyHighlightZebTeller01");
        dummyHighlightZebTeller02  = GameObject.Find("dummyHighlightZebTeller02");
        dummyHighlightZebTeller03  = GameObject.Find("dummyHighlightZebTeller03");
        dummyHighlightZebTeller04  = GameObject.Find("dummyHighlightZebTeller04");
        dummyHighlightZebSafebox   = GameObject.Find("dummyHighlightZebSafebox");
        dummyHighlightZebSafebox02 = GameObject.Find("dummyHighlightZebSafebox02");
        dummyHighlightZebSafebox03 = GameObject.Find("dummyHighlightZebSafebox03");

        moneyTextMeercat01 = GameObject.Find("moneyTextMeercat01");
        moneyTextRabbit01  = GameObject.Find("moneyTextRabbit01");
        moneyTextRabbit02  = GameObject.Find("moneyTextRabbit02");
        moneyTextRabbit03  = GameObject.Find("moneyTextRabbit03");
        moneyTextRabbit04  = GameObject.Find("moneyTextRabbit04");
        moneyTextTeller01  = GameObject.Find("moneyTextTeller01");
        moneyTextTeller02  = GameObject.Find("moneyTextTeller02");
        moneyTextTeller03  = GameObject.Find("moneyTextTeller03");
        moneyTextTeller04  = GameObject.Find("moneyTextTeller04");
        moneyTextSafebox   = GameObject.Find("moneyTextSafebox");
        moneyTextSafebox02 = GameObject.Find("moneyTextSafebox02");
        moneyTextSafebox03 = GameObject.Find("moneyTextSafebox03");

        moneyTeller01  = GameObject.Find("moneyTeller01");
        moneyTeller02  = GameObject.Find("moneyTeller02");
        moneyTeller03  = GameObject.Find("moneyTeller03");
        moneyTeller04  = GameObject.Find("moneyTeller04");
        moneySafebox   = GameObject.Find("moneySafebox");
        moneySafebox02 = GameObject.Find("moneySafebox02");
        moneySafebox03 = GameObject.Find("moneySafebox03");

        zebra       = GameObject.Find("zebra");
        zebraScript = GameObject.Find("zebra").GetComponent <zebra_Level_09>();

        scoreMoney = GameObject.Find("scoreGUItext").GetComponent <gameScore_Level_09>();

        timerM1_10secondsObject   = GameObject.Find("timerM1_10seconds");
        timerR1_10secondsObject   = GameObject.Find("timerR1_10seconds");
        timerR2_10secondsObject   = GameObject.Find("timerR2_10seconds");
        timerR3_10secondsObject   = GameObject.Find("timerR3_10seconds");
        timerR4_10secondsObject   = GameObject.Find("timerR4_10seconds");
        timerT1_10secondsObject   = GameObject.Find("timerT1_10seconds");
        timerT2_10secondsObject   = GameObject.Find("timerT2_10seconds");
        timerT3_10secondsObject   = GameObject.Find("timerT3_10seconds");
        timerT4_10secondsObject   = GameObject.Find("timerT4_10seconds");
        timerSB_10secondsObject   = GameObject.Find("timerSB_10seconds");
        timerSB02_10secondsObject = GameObject.Find("timerSB02_10seconds");
        timerSB03_10secondsObject = GameObject.Find("timerSB03_10seconds");

        anim = this.GetComponent <Animator>();
    }