Exemple #1
0
    void Awake()
    {
        PopUpController.init();
        popUpTextCanvas = GameObject.Find("popUpTextCanvas");
        myCamera        = Camera.main.GetComponent <CameraController>();
        blockColor      = Camera.main.GetComponent <BlockColor>();
        score           = Camera.main.GetComponent <Score>();
        Mesh   mesh   = block.GetComponent <MeshFilter>().sharedMesh;
        Bounds bounds = mesh.bounds;

        blockSide  = bounds.size.x;
        blockSideY = bounds.size.y * block.transform.localScale.y;

        mesh       = player.GetComponent <MeshFilter>().mesh;
        bounds     = mesh.bounds;
        playerSide = bounds.size.x * player.GetComponent <Transform>().localScale.x;

        mesh        = pointUp.GetComponent <MeshFilter>().sharedMesh;
        bounds      = mesh.bounds;
        pointUpSide = bounds.size.x;

        mesh             = blockCover.GetComponent <MeshFilter>().sharedMesh;
        bounds           = mesh.bounds;
        coverLength      = bounds.size.x;
        playerJumpHeight = player.jumpHeight;


        mesh   = newBlock.GetComponent <MeshFilter>().sharedMesh;
        bounds = mesh.bounds;
        float side  = bounds.size.x;
        float scale = blockSide / side;

        print("scale " + scale);
    }