示例#1
0
    // Use this for initialization
    void Start()
    {
        defaultYPos = mainCamera.transform.position.y;
        deathCount  = 0;
        myBody      = this.GetComponent <Rigidbody2D> ();
        myTransform = this.GetComponent <Transform>();
        anim        = GetComponent <Animator>();
        system      = GetComponent <RopeSystem> ();
        source      = GetComponent <AudioSource> ();
        respawnPos  = myTransform.position;
        camUpDown   = mainCamera.GetComponent <CameraUpDown> ();
        GameObject playerScoreObject = GameObject.FindGameObjectWithTag("PlayerScore");

        score        = playerScoreObject.GetComponent <PlayerScore> ();
        thisCollider = this.GetComponent <PolygonCollider2D> ();
    }
示例#2
0
    private void Start()
    {
        SL         = GameObject.Find("SL").GetComponent <SAVELOAD>();
        cameraMove = GetComponent <CameraMove>();
        admob      = GetComponent <ADMOBManager>();

        rCam = GameObject.Find("RatingCamera");
        sCam = GameObject.Find("SpaceCamera");
        pCam = GameObject.Find("PlanetCamera");

        Planet = GameObject.Find("PlanetLevel");
        Space  = GameObject.Find("CanvasSpaces");
        Rating = GameObject.Find("CanvasRatings");
        UI     = GameObject.Find("CanvasUI");

        CanvasSpace  = UI.transform.Find("CanvasSpace").gameObject;
        CanvasRating = UI.transform.Find("CanvasRating").gameObject;
        CanvasPlanet = UI.transform.Find("CanvasPlanet").gameObject;

        objTable = GameObject.Find("Table");
        objBlack = CanvasPlanet.transform.Find("Black").gameObject;
        objHint  = CanvasPlanet.transform.Find("Hint").gameObject;


        Score     = CanvasPlanet.transform.Find("Overlay/Score").GetComponent <Score>();
        statistic = CanvasPlanet.transform.Find("Overlay/Statistic").GetComponent <Statistic>();
        objBonusF = CanvasPlanet.transform.Find("Overlay/BonusF").gameObject;
        objBonusR = CanvasPlanet.transform.Find("Overlay/BonusR").gameObject;
        objBonusC = CanvasPlanet.transform.Find("Overlay/BonusC").gameObject;


        PlanetInfo = Planet.GetComponent <PlanetInfo>();


        Mines     = Planet.transform.Find("Mines").GetComponent <Mines>();
        objEl     = Planet.transform.Find("Up/Elevator").gameObject;
        objFac    = Planet.transform.Find("Up/Factory").gameObject;
        objLab    = Planet.transform.Find("Up/Lab").gameObject;
        objStock  = Planet.transform.Find("Up/Stock").gameObject;
        objBoer   = Planet.transform.Find("Up/Boer").gameObject;
        objRock   = Planet.transform.Find("Up/RocketPlace").gameObject;
        objRJ     = Planet.transform.Find("RobotEnginer").gameObject;
        Miniature = Planet.transform.Find("Miniature").GetComponent <Miniature>();
        objBat    = Planet.transform.Find("Miniature/BatteryF").gameObject;
        Builds    = Planet.transform.Find("Up").GetComponentsInChildren <Builds>();

        cameraUpDown = objEl.GetComponent <CameraUpDown>();

        BuySourse   = Planet.transform.Find("Up").GetComponent <AudioSource>();
        BonusSourse = Planet.transform.Find("Mines").GetComponent <AudioSource>();
        MineSource  = Planet.GetComponent <AudioSource>();
        CrashSource = Planet.transform.Find("Up/Forest").GetComponent <AudioSource>();
        BtnSource   = GameObject.Find("CanvasUI").GetComponent <AudioSource>();
        DynSource   = Planet.transform.Find("bgPlanet0").GetComponent <AudioSource>();
        ErrorSource = GameObject.Find("SL").GetComponent <AudioSource>();


        Elevator = objStock.GetComponent <Elevator>();
        Factory  = objFac.GetComponent <Factory>();
        Rocket   = objRock.GetComponent <Rocket>();

        btnL               = objLab.transform.Find("Btn").gameObject;
        iconBtnL           = btnL.transform.GetComponentInChildren <Button>();
        btnE               = objStock.transform.Find("Btn").gameObject;
        iconBtnE           = btnE.transform.GetComponentInChildren <Button>();
        btnF               = objFac.transform.Find("Btn").gameObject;
        iconBtnF           = btnF.transform.GetComponentInChildren <Button>();
        btnR               = objRock.transform.Find("Btn").gameObject;
        iconBtnR           = btnR.transform.GetComponentInChildren <Button>();
        table              = GetComponent <Table>();
        objRegTableCont    = objTable.transform.Find("RegisterContent").gameObject;
        objBonusTableCont  = objTable.transform.Find("BonusContent").gameObject;
        objRatingTableCont = objTable.transform.Find("RatingContent").gameObject;

        displayPlayers = Rating.GetComponent <DisplayPlayers>();
        ContentRating  = Rating.transform.Find("Scroll View/Viewport/Content");

        addUser = Rating.GetComponent <AddUser>();

        cameraMove.enabled = false;

        //  table.Load();
        // cameraUpDown.Load();
        // PlanetInfo.Load();
        // SL.Load();
        //Score.Load();

        rCam.SetActive(false);
        sCam.SetActive(false);
        pCam.SetActive(false);

        Planet.SetActive(false);
        Rating.SetActive(false);

        CanvasRating.SetActive(false);
        CanvasPlanet.SetActive(false);

        objTable.SetActive(false);
        objBlack.SetActive(false);
        objHint.SetActive(false);

        objBonusF.SetActive(false);
        objBonusR.SetActive(false);
        objBonusC.SetActive(false);
    }