Esempio n. 1
0
 //타이틀 관련 변수 초기화
 void ClearData()
 {
     //MarketIdx = 0;
     //Ver = 0;
     selectedPlatform = PLATFORM_TYPE.NONE;
     isCompleteLogin  = false;
 }
Esempio n. 2
0
    /// <summary>
    /// 设置预编译参数,由于一些游戏是3.5版本的,旧版本没法使用预编译参数,所以这个功能不能用
    /// </summary>
    /// <param name="type"></param>
    static public void SetScriptingDefine(PLATFORM_TYPE type)
    {
        string s = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android);

        string[] arr    = s.Split(new Char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
        string   result = "";
        bool     find   = false;
        string   name   = "PLATFORM_" + type;

        for (int i = 0; i < arr.Length; i++)
        {
            foreach (PLATFORM_TYPE item in Enum.GetValues(typeof(PLATFORM_TYPE)))
            {
                if (arr[i] == name)
                {
                    find = true;
                    break;
                }
            }

            if (!find)
            {
                result += arr[i] + ";";
            }
        }
        result += name;
        PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android, result);
    }
    void Set_AccounInfo()
    {
        User _user = UserDataManager.instance.user;

        //유저아이디
        text_userID.text = _user.user_Users.UserID.ToString();

        //유저명
        text_NkNm.text = _user.user_Users.NkNm;
        //킬메세지
        if (_user.User_Words.ContainsKey(USERWORD_TYPE.WRD_KILL))
        {
            text_Killmsg.text = _user.User_Words[USERWORD_TYPE.WRD_KILL].Words;
        }
        else
        {
            text_Killmsg.text = "";
        }

        //플랫폼 인덱스
        nowUsePlatform = (PLATFORM_TYPE)PlatformManager.Getsingleton.ChkGet_BeforeUsePlatformIndex();

        //플랫폼 이미지
        Set_PlatformIcon((byte)nowUsePlatform);

        //플랫폼 버튼 활성,비활성
        Set_PlatformButton((byte)nowUsePlatform);
    }
    /// <summary>
    /// generates a platform piece starting from x,y for l length
    /// </summary>
    /// <param name="x"></param>
    /// <param name="y"></param>
    /// <param name="l"></param>
    private void _generatePiece(float x, float y, float len, PLATFORM_TYPE pt, out List <GameObject> curObjects)
    {
        curObjects = new List <GameObject>();
        //case: we're generating a floor object
        if (pt == PLATFORM_TYPE.FLOOR_T)
        {
            var cur_length = x;
            while (cur_length < len)
            {
                //select random platform type
                PLATFORM_TYPE pt2;

                //debug stuff
                var rnum = _randomNum(0, 3);
                if (rnum == 1)
                {
                    pt2 = PLATFORM_TYPE.FLOOR_T;
                }
                else
                {
                    pt2 = PLATFORM_TYPE.SPIKE_T;
                }
                var num = _randomNum(1, 5);
                for (var i = 0; i < num; ++i)
                {
                    if (pt2 == PLATFORM_TYPE.FLOOR_T)
                    {
                        var obj = Instantiate(prefab_lowerPlatform, new Vector3(cur_length, y, 0), Quaternion.identity);
                        _currentFloorChunkObjects.Add(obj);
                        curObjects.Add(obj);
                    }
                    else
                    {
                        var obj = Instantiate(prefab_spikes, new Vector3(cur_length, y, 0), Quaternion.identity);
                        _currentFloorChunkObjects.Add(obj);
                        curObjects.Add(obj);
                    }
                    cur_length += BOX_WIDTH;
                }
            }
            _curFloorEnd = cur_length;
        }
        else if (pt == PLATFORM_TYPE.AIR_T)
        {
            var plen       = x + len;
            var cur_length = x;
            while (cur_length < plen)
            {
                curObjects.Add(Instantiate(prefab_lowerPlatform, new Vector3(cur_length, y), Quaternion.identity));
                cur_length += BOX_WIDTH;
            }
            _curPlatformEnd = cur_length;
        }
    }
Esempio n. 5
0
    public void Login_guestID(bool sucess)
    {
        Write_TitleLog("Login guest account...");
        UserEditor.Getsingleton.EditLog("로그인 게스트 계정");

        selectedPlatform = PLATFORM_TYPE.GUEST;

        User _user = UserDataManager.instance.user;

        _user.user_Users.Init();         //

        //유저로그인정보에 플랫폼인덱스 저장
#if UNITY_EDITOR
        _user.user_logins.PlfID = (byte)UserEditor.Getsingleton.PlfID;
#else
        _user.user_logins.PlfID = (byte)selectedPlatform;
#endif
        //로그인시도
        Start_login();
    }
Esempio n. 6
0
    public void Init_Login()
    {
        User _user = UserDataManager.instance.user;

        if (_user.LogInState == Login_State.LogOut)
        {
            //연결할 계정플랫폼 UI active
            Activate_SelectPlatformLoginPopup();
        }
        else
        {
            //임시 로그인
            //Start_login();

            selectedPlatform = (PLATFORM_TYPE)PlatformManager.Getsingleton.ChkGet_BeforeUsePlatformIndex();

            //플랫폼별 로그인 시작
            if (selectedPlatform == PLATFORM_TYPE.NONE)
            {
                //연결할 계정플랫폼 UI active
                Activate_SelectPlatformLoginPopup();
            }
            else if (selectedPlatform == PLATFORM_TYPE.GUEST)            // 게스트
            {
                Try_Login_GuestID();
            }
            else if (selectedPlatform == PLATFORM_TYPE.GOOGLE)            //구글
            {
                Try_Login_Google();
            }
            else if (selectedPlatform == PLATFORM_TYPE.FACEBOOK)            // 페이스북
            {
                Try_Login_Facebook();
            }
            else if (selectedPlatform == PLATFORM_TYPE.GAMECENTER)            // 게임센터
            {
                Try_Login_GameCenter();
            }
        }
    }
Esempio n. 7
0
    //구글계정연동시도  완료시 콜백
    public void Login_GoogleID(bool success)
    {
        if (success)         // 구글계정 연결에 성공했다.
        {
            Write_TitleLog("Login google account...");
            UserEditor.Getsingleton.EditLog(" 구글 계정으로 로그인~");

            selectedPlatform = PLATFORM_TYPE.GOOGLE;

            User _user = UserDataManager.instance.user;
            _user.user_logins.Lgnkey = PlatformManager.Getsingleton.Platform_UserID;
            _user.user_logins.Email  = PlatformManager.Getsingleton.Platform_UserEmail;
            _user.user_logins.PlfID  = (byte)selectedPlatform;            //구글


            if (_user.user_Users.UserID != 0 && _user.user_logins.PlfID != (byte)PLATFORM_TYPE.GOOGLE)            // 로그인 했엇다. 플랫폼 전환을 한다.
            {
                //플랫폼 전환이 완료되면 로그인으로..
                ChangePlatform();
            }
            else
            {
                //로그인시도
                Start_login();
            }
        }
        else
        {
            selectedPlatform = PLATFORM_TYPE.NONE;
            PlatformManager.Getsingleton.Save_NowUsePlatformIndex((int)selectedPlatform);

            UI_Popup_Notice popup = UI_Manager.Getsingleton.CreatAndGetPopup <UI_Popup_Notice>(UIPOPUP.POPUPNOTICE);
            popup.Set_PopupTitleMessage(TextDataManager.Dic_TranslateText[145]);
            popup.SetPopupMessage(TextDataManager.Dic_TranslateText[220]);            // 구글 계정 연결 실패 하였습니다
            //다시 계정띄우는곳으로
            popup.Set_addEventButton(Init_Login);
        }
    }
Esempio n. 8
0
    public static void DoStuffs(PerPlatform d, string apkName, bool openBat = false)
    {
        PLATFORM_TYPE type = d.平台;

        if (type == PLATFORM_TYPE.None)
        {
            Debug.Log("发布平台未定义!");
            return;
        }

        string packName = null;
        string xml      = null;

        GetPackName(d, out packName, out xml);
        if (packName == null || xml == null)
        {
            return;
        }

        PlayerSettings.Android.bundleVersionCode = d.数字版本号;
        PlayerSettings.applicationIdentifier     = packName;
        PlayerSettings.bundleVersion             = d.版本号;
        PlayerSettings.productName = d.产品名称;
        PlayerSettings.companyName = "ZHJiaShiJie";
        CreateVersion(d, packName);
        CopyPlugin(type.ToString().ToLower(), d, xml);

        if (apkName == "" || apkName == null)
        {
            apkName = packName + "_" + d.艺名;
        }
        else
        {
            apkName = apkName + "_" + d.艺名;
        }

        string[] nobuildSceneName = null;
        if (d.发布的场景名 != null && d.发布的场景名.Length > 0)
        {
            nobuildSceneName = new string[d.发布的场景名.Length];
            for (int i = 0; i < d.发布的场景名.Length; i++)
            {
                if (d.发布的场景名[i] == null)
                {
                    continue;
                }
                nobuildSceneName[i] = d.发布的场景名[i].name;
            }
        }
        else if (d.发布的场景名字 != null)
        {
            nobuildSceneName = d.发布的场景名字;
        }
#if UNITY_4_5 || UNITY_4_2
        SetScriptingDefine(d.平台);
#endif
        Copy2StreamingAsset(d.制文件);
        BuildForAndroid(apkName, GetBuildScenes(nobuildSceneName), !openBat);
        CreateBat(apkName, packName, openBat);
        Copy2StreamingAsset(d.制文件, false);
    }
Esempio n. 9
0
    static public void CreateVersion(PerPlatform per, string packName)
    {
        PLATFORM_TYPE type     = per.平台;
        LANG_TYPE     curLang  = per.语言;
        string        gameName = per.产品名称;


        string v = "using System.Collections.Generic;\r\npublic class Version{ \r\n";

        foreach (PLATFORM_TYPE item in Enum.GetValues(typeof(PLATFORM_TYPE)))
        {
            v += "static public bool Is" + item.ToString() + "(){ return " + (type == item ? "true" : "false") + "; }\r\n";
        }

        foreach (LANG_TYPE item in Enum.GetValues(typeof(LANG_TYPE)))
        {
            v += "static public bool Is" + item.ToString() + "(){ return " + (curLang == item ? "true" : "false") + "; }\r\n";
        }

        v += "public const bool SHOW_BUY_TIPS = " + (per.是否显示购买图 ? "true" : "false") + ";\r\n";

        v += "public const string packName = \"" + packName + "\";\r\n";

        v += "public const string gameName=\"" + gameName + "\";\r\n";

        v += "public enum PLAFTFORM_ENUM{";

        PerPlatform[] platforms = null;


#if UNITY_3_5
        platforms = GameInfo.data.平台列表;
#else
        if (platformDatas == null)
        {
            platformDatas = AssetDatabase.LoadAssetAtPath(ASSETS_PATH, typeof(PlatformData)) as PlatformData;
        }
        platforms = platformDatas.平台列表;
#endif

        for (int i = 0; i < platforms.Length; i++)
        {
            v += platforms[i].艺名.ToString();
            if (i != (platforms.Length - 1))
            {
                v += ",";
            }
        }


        v += "};\r\n";
        v += "public static PLAFTFORM_ENUM currentPlatform= PLAFTFORM_ENUM." + per.艺名.ToString() + ";\r\n";

        v += "public static Dictionary<string, string> customData = new Dictionary<string, string>(){";
        Dictionary <string, string> customData = new Dictionary <string, string>();

        if (per.自定义数据 != null)
        {
            for (int i = 0; i < per.自定义数据.Count; i++)
            {
                if (String.IsNullOrEmpty(per.自定义数据[i].name) == false)
                {
                    if (customData.ContainsKey(per.自定义数据[i].name) == false)
                    {
                        try
                        {
                            customData.Add(per.自定义数据[i].name, per.自定义数据[i].value);
                            v += "{\"" + per.自定义数据[i].name + "\",\"" + per.自定义数据[i].value + "\"}";
                        }
                        catch
                        {
                            Debug.LogWarning("自定义数据" + per.自定义数据[i].name + ", " + per.自定义数据[i].value + " 创建失败,请注意不能使用特殊符号");
                        }
                    }
                    else
                    {
                        Debug.LogWarning("自定义数据" + per.自定义数据[i].name + " 重复的KEY");
                    }
                }
            }
        }
        v += "};";

        v += "}";

        SaveFile(v, Application.dataPath + "/plugins/Version.cs"); //save for cs.

        v = "#pragma strict \r\n";
        foreach (PLATFORM_TYPE item in Enum.GetValues(typeof(PLATFORM_TYPE)))
        {
            v += "static  public function Is" + item.ToString() + "(){ return " + (type == item ? "true" : "false") + "; }\r\n";
        }

        foreach (LANG_TYPE item in Enum.GetValues(typeof(LANG_TYPE)))
        {
            v += "static  public function Is" + item.ToString() + "(){ return " + (curLang == item ? "true" : "false") + "; }\r\n";
        }

        v += "static public var packName:String = \"" + packName + "\";\r\n";

        v += "public  static var SHOW_BUY_TIPS:boolean = " + (per.是否显示购买图 ? "true" : "false") + ";\r\n";

        v += "static public var gameName:String=\"" + gameName + "\";\r\n";

        v += "public enum PLAFTFORM_ENUM{";
        for (int i = 0; i < platforms.Length; i++)
        {
            v += platforms[i].艺名.ToString();
            if (i != (platforms.Length - 1))
            {
                v += ",";
            }
        }
        v += "};\r\n";
        v += "public static var currentPlatform:PLAFTFORM_ENUM= PLAFTFORM_ENUM." + per.艺名.ToString() + ";\r\n";


        SaveFile(v, Application.dataPath + "/plugins/VersionJS.js");
    }