Esempio n. 1
0
    //public GameObject gameoverachievementunlock;

    // Use this for initialization
    void Start()
    {
        //FriendDiceRequest Panel
        GameObject tempFriendDiceR = GameObject.Instantiate(frienddicerequestPrefab, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.identity) as GameObject;

        tempFriendDiceR.transform.parent     = this.transform;
        tempFriendDiceR.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);
        ((UIPanel)tempFriendDiceR.GetComponent("UIPanel")).depth = 1;
        frienddicerequest = (FriendDiceRequest)tempFriendDiceR.GetComponent("FriendDiceRequest");
        frienddicerequest.gameObject.SetActive(false);

        // ShopGoldBar Panel
        shopgoldbar = GameObject.Instantiate(shopgoldbarprefab, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.identity) as GameObject;
        shopgoldbar.transform.parent     = this.transform;
        shopgoldbar.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);
        ((UIPanel)shopgoldbar.GetComponent("UIPanel")).depth = 1;
        shopgoldbar.SetActive(false);

        g_instance      = this;
        buttonClickable = true;
        if (Localization.instance != null)
        {
            // Localization 객체에게 언어를 바꾸라고 합니다.

            Debug.Log("Locale is " + CMainData.Locale);

            if (CMainData.Locale.Contains("ko"))
            {
                Localization.instance.currentLanguage = "korea";
            }
            else if (CMainData.Locale.Contains("ja"))
            {
                Localization.instance.currentLanguage = "japan";
            }
            else
            {
                Localization.instance.currentLanguage = "english";
            }
        }

        prev_score = CMainData.UserScore;
        // Check Current State - 점수 갱신, 랭킹 갱신, 일반
        string friendlist = "";

        /*
         * foreach (Dictionary<string, object> temp in FaceBook.friends)
         * {
         *  friendlist += (string)temp["id"] + ",";
         * }*/

        foreach (Dictionary <string, string> temp in CMainData.appFriends)
        {
            friendlist += (string)temp["fid"] + ",";
        }


        if (friendlist.Length != 0)
        {
            friendlist = friendlist.Substring(0, friendlist.Length - 1);
        }

        if (serverConnection != null)
        {
            serverConnection.SendGameEnd(score.ToString(), friendlist, new CallBackClass.MessageCheckCallBack(success));
        }
    }
Esempio n. 2
0
        public scene.Scene CreateScene(SceneType type, PitchPitch parent, object arg = null)
        {
            if (_scenes == null)
            {
                _scenes = new Dictionary <SceneType, Scene>();
            }

            Scene scene = null;

            if (_scenes.ContainsKey(type))
            {
                scene = _scenes[type];
                switch (type)
                {
                case SceneType.GameStage:
                    (scene as scene.SceneGameStage).Map = arg as map.Map;
                    break;

                case SceneType.Error:
                    (scene as scene.SceneError).ErrorMessages = (string[])arg;
                    break;
                }
            }
            else
            {
                switch (type)
                {
                case SceneType.Error:
                    scene = new SceneError();
                    (scene as scene.SceneError).ErrorMessages = (string[])arg;
                    break;

                case SceneType.Title:
                    scene = new SceneTitle();
                    break;

                case SceneType.MapSelect:
                    scene = new SceneMapSelect();
                    break;

                case SceneType.Option:
                    scene = new SceneOption();
                    break;

                case SceneType.GameStage:
                    scene = new SceneGameStage(arg as map.Map);
                    break;

                case SceneType.GameOver:
                    scene = new SceneGameOver();
                    break;

                default:
                    return(null);
                }
                _scenes.Add(type, scene);
            }
            if (scene != null)
            {
                scene.Init(parent);
            }
            return(scene);
        }