Exemple #1
0
    // Use this for initialization
    void Start()
    {
        globalClass.correct          = 0;
        globalClass.firstScoreGamer  = 0;
        globalClass.secondScoreGamer = 0;

        globalClass.isFirst     = true;
        globalClass.activeGamer = 1;

        globalClass.cardFirst  = null;
        globalClass.cardSecond = null;

        if (globalClass.countPlayers == 1)
        {
            GameObject.Find("Canvas/Panel/score").SetActive(true);
        }
        else
        {
            GameObject.Find("Canvas/Panel/scoreFirstGamer").SetActive(true);
            GameObject.Find("Canvas/Panel/scoreSecondGamer").SetActive(true);
        }
        //float screenHeightInUnits = Camera.main.orthographicSize * 2;
        //Debug.Log (screenHeightInUnits);
        //float screenWidthInUnits = screenHeightInUnits * Screen.width/ Screen.height;
        //Debug.Log (screenWidthInUnits);

                #if UNITY_EDITOR
        isMobile = false;
                #endif

                #if UNITY_IPHONE
        isMobile = true;
                #endif

                #if UNITY_ANDROID
        isMobile = true;
                #endif

                #if UNITY_STANDALONE_OSX
        isMobile = false;
                #endif

                #if UNITY_STANDALONE_WIN
        isMobile = false;
                #endif


        GameObject go = new GameObject();
        go.AddComponent <gridFormatClass> ();
        gf = go.GetComponent <gridFormatClass>();
        gf.initGrid(cardObject, grid);
    }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        float screenHeightInUnits = Camera.main.orthographicSize * 2;

        Debug.Log(screenHeightInUnits);
        float screenWidthInUnits = screenHeightInUnits * Screen.width / Screen.height;

        Debug.Log(screenWidthInUnits);

                #if UNITY_EDITOR
        isMobile = false;
                #endif

                #if UNITY_IPHONE
        isMobile = true;
                #endif

                #if UNITY_ANDROID
        isMobile = true;
                #endif

                #if UNITY_STANDALONE_OSX
        isMobile = false;
                #endif

                #if UNITY_STANDALONE_WIN
        isMobile = false;
                #endif


        GameObject go = new GameObject();
        go.AddComponent <gridFormatClass> ();
        gf = go.GetComponent <gridFormatClass>();

        gf = new gridFormatClass();
        gf.initGrid(cardObject, grid);
    }