예제 #1
0
    public void DoLogin(string eMail, string pwd)
    {
        mLoginInfo             = new LoginInfo();
        mLoginInfo.memberEmail = eMail;
        mLoginInfo.memberName  = "";
        mLoginInfo.memberPwd   = pwd;
        mLoginEvent            = new LoginEvent(new EventDelegate(this, "LoginComplete"));
//		UtilMgr.ShowLoading (true);

        PlayerPrefs.SetString(Constants.PrefEmail, eMail);
        PlayerPrefs.SetString(Constants.PrefPwd, pwd);

        if (Application.platform == RuntimePlatform.Android)
        {
            AndroidMgr.RegistGCM(new EventDelegate(this, "SetGCMId"));
        }
        else if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
        }
        else if (Application.platform == RuntimePlatform.OSXEditor)
        {
            mLoginInfo.memUID = "";
            NetMgr.DoLogin(mLoginInfo, mLoginEvent);
        }
    }
예제 #2
0
    public void GoNext()
    {
        if (mSelected && IsGuest)
        {
            GetUID();
        }
        else if (mSelected)
        {
            mMemInfo.FavoBB = mTeamCode;
                        #if (UNITY_EDITOR)
            mMemInfo.OsType = 1;
            CompleteGCM();
                        #elif (UNITY_ANDROID)
            mMemInfo.OsType = 1;
            AndroidMgr.RegistGCM(new EventDelegate(this, "CompleteGCM"));
                        #else
            mMemInfo.OsType = 2;
            if (GetComponentInParent <ScriptTitle>().CheckPushAgree())
            {
                CompleteGCM();
            }
            else
            {
                IOSMgr.RegistAPNS(new EventDelegate(this, "SetGCMId"));
            }
//			IOSMgr.RegistAPNS(new EventDelegate(this, "CompleteGCM"));
                        #endif
        }
        else if (!mSelected)
        {
            DialogueMgr.ShowDialogue(
                mErrorTitle, mErrorBody, DialogueMgr.DIALOGUE_TYPE.Alert,
                null, null, null, null);
        }
    }
예제 #3
0
 public void OpenCamera()
 {
             #if (UNITY_EDITOR)
             #elif (UNITY_ANDROID)
     AndroidMgr.OpenGallery(new EventDelegate(this, "GotImage"));
             #else
             #endif
 }
예제 #4
0
    public static void OpenCamera(EventDelegate eventDelegate)
    {
        Instance.mEventDelegate = eventDelegate;
        string timeStr = UtilMgr.GetDateTime("yyyy-MM-dd HH:mm:ss");

        timeStr += " by lb.jpg";
        AndroidMgr.CallJavaFunc("OpenCamera", timeStr);
    }
 public void SetPhoto()
 {
     Debug.Log("OpenGallery!!!");
             #if (UNITY_ANDROID)
     AndroidMgr.OpenGallery(new EventDelegate(this, "OpenGallery"));
             #else
     IOSMgr.OpenGallery(new EventDelegate(this, "OpenGallery"));
             #endif
 }
예제 #6
0
 public void CameraClicked()
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         //need selection window
         AndroidMgr.OpenGallery(new EventDelegate(this, "GotUserImg"));
     }
     else
     {
     }
 }
예제 #7
0
 public void OnClick()
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         AndroidMgr.OpenGallery(new EventDelegate(ReceivedGallery));
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         IOSMgr.OpenGallery(new EventDelegate(ReceivedGallery));
     }
 }
예제 #8
0
    public void GotImage()
    {
                #if (UNITY_EDITOR)
                #elif (UNITY_ANDROID)
        mImgPath = AndroidMgr.GetMsg();
                #else
                #endif

        WWW www = new WWW("file://" + mImgPath);
        StartCoroutine(LoadImage(www));
    }
예제 #9
0
    public void FBReceived()
    {
        string jsonStr = AndroidMgr.GetMsg();
        Dictionary <string, string> dic = new Dictionary <string, string>();

        dic = JsonFx.Json.JsonReader.Deserialize <Dictionary <string, string> > (jsonStr);

        foreach (string key in dic.Keys)
        {
            Debug.Log(key + " : " + dic[key]);
        }
    }
예제 #10
0
    public void FBReceived()
    {
        string jsonStr = AndroidMgr.GetMsg();
        Dictionary <string, string> dic = new Dictionary <string, string>();

        //        dic = Newtonsoft.Json.JsonConvert.Deserialize<Dictionary<string, string>> (jsonStr);

        foreach (string key in dic.Keys)
        {
            Debug.Log(key + " : " + dic[key]);
        }
    }
예제 #11
0
    public void OpenFacebook()
    {
                #if (UNITY_EDITOR)
                #elif (UNITY_ANDROID)
        AndroidMgr.OpenFB(new EventDelegate(this, "FBReceived"));
                #else
                #endif
//		if (mFBInitialized) {
//			FBLogin();
//		} else{
//			FB.Init (SetInit, FB.OnHideUnity);
//		}
    }
예제 #12
0
 void OpenGallery()
 {
     CheckInGallery = true;
     Debug.Log("OpenGallery");
             #if (UNITY_ANDROID)
     images = "file://" + AndroidMgr.GetMsg();
             #else
     images = "file://" + IOSMgr.GetMsg();
             #endif
     Debug.Log("images");
     tLoad = new WWW(images);
     StartCoroutine(LoadImage(tLoad));
 }
예제 #13
0
    public void CompleteGCM()
    {
        Debug.Log("CompleteGCM");
        string memUID = "";

                #if (UNITY_EDITOR)
                #elif (UNITY_ANDROID)
        memUID = AndroidMgr.GetMsg();
                #else
                #endif
        mMemInfo.MemUID = memUID;
        GetComponentInParent <ScriptTitle>().mProfileEvent =
            new GetProfileEvent(new EventDelegate(GetComponentInParent <ScriptTitle>(), "GotProfile"));

        NetMgr.JoinMember(mMemInfo, GetComponentInParent <ScriptTitle>().mProfileEvent);
    }
예제 #14
0
    void OpenCamera()
    {
        ScriptItemPhoto sip = GetCurrentItemPhoto();

        if (sip == null)
        {
            return;
        }
        if (Application.platform == RuntimePlatform.Android)
        {
            AndroidMgr.OpenCamera(new EventDelegate(this, "GotPhoto"));
        }
        else
        {
        }
    }
예제 #15
0
    void ReceivedGallery()
    {
        Debug.Log("ReceivedGallery");
        string image = "";

        if (Application.platform == RuntimePlatform.Android)
        {
            image = "file://" + AndroidMgr.GetMsg();
        }
        else
        {
            image = "file://" + IOSMgr.GetMsg();
        }
        WWW www = new WWW(image);

        StartCoroutine(LoadImage(www));
    }
예제 #16
0
 public void CompleteGCM()
 {
     Debug.Log("CompleteGCM");
             #if (UNITY_EDITOR)
     mMemInfo.MemUID   = "";
     mMemInfo.DeviceID = SystemInfo.deviceUniqueIdentifier;
     DoJoin();
             #elif (UNITY_ANDROID)
     mMemInfo.MemUID   = AndroidMgr.GetMsg();
     mMemInfo.DeviceID = SystemInfo.deviceUniqueIdentifier;
     DoJoin();
             #else
     mMemInfo.MemUID = IOSMgr.GetMsg();
     EventDelegate eventd = new EventDelegate(this, "DoJoin");
     IOSMgr.GetUID("", eventd);
             #endif
 }
예제 #17
0
    //    public void GuestCompelte(){
    //        Login (mLoginEvent.Response.data.memberEmail, mLoginEvent.Response.data.memberPwd);
    //    }

    public void SetGCMId()
    {
        UtilMgr.DismissLoading();
                #if (UNITY_EDITOR)
        mLoginInfo.memUID   = AndroidMgr.GetMsg();
        mLoginInfo.DeviceID = SystemInfo.deviceUniqueIdentifier;
        DoLogin();
                #elif (UNITY_ANDROID)
        mLoginInfo.memUID   = AndroidMgr.GetMsg();
        mLoginInfo.DeviceID = SystemInfo.deviceUniqueIdentifier;
        DoLogin();
                #else
        StopCoroutine(WaitingToken());
        mLoginInfo.memUID = IOSMgr.GetMsg();
        EventDelegate eventd = new EventDelegate(this, "DoLogin");
        IOSMgr.GetUID("", eventd);
                #endif
    }
예제 #18
0
    public void GotUserImg()
    {
        string images;

        Debug.Log("OpenGallery");
        if (Application.platform == RuntimePlatform.Android)
        {
            images = "file://" + AndroidMgr.GetMsg();
        }
        else
        {
            images = "file://" + IOSMgr.GetMsg();
        }
        Debug.Log("images");
        WWW tLoad = new WWW(images);

        StartCoroutine(LoadImage2(tLoad));
    }
예제 #19
0
    public void GotImage()
    {
                #if (UNITY_EDITOR)
                #elif (UNITY_ANDROID)
        mImgPath = AndroidMgr.GetMsg();
                #else
        mImgPath = IOSMgr.GetMsg();
                #endif

//		string filePath = mImgPath;
        if (System.IO.File.Exists(mImgPath))
        {
            WWW www = new WWW("file://" + mImgPath);
            StartCoroutine(LoadImage(www));
        }
        else
        {
            DialogueMgr.ShowDialogue("Error", "파일을 찾을 수 없습니다.", DialogueMgr.DIALOGUE_TYPE.Alert, null);
        }
    }
예제 #20
0
    void Login()
    {
        mLoginInfo = new LoginInfo();

        if (mNick == null)
        {
            mLoginInfo.nick = mCheckEvent.Response.data.nick;
        }
        else
        {
            mLoginInfo.nick = mNick;
        }

        if (Application.platform == RuntimePlatform.Android)
        {
            mLoginInfo.osType = 1;
            AndroidMgr.RegistGCM(new EventDelegate(this, "SetGCMId"));
            StartCoroutine(WaitingToken());
        }
        else if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            mLoginInfo.osType = 2;
            //			if(CheckPushAgree()){
            //				mLoginInfo.memUID = "";
            //				//                NetMgr.DoLogin (mLoginInfo, mLoginEvent);
            //				SetGCMId();
            //			} else{
            IOSMgr.RegistAPNS(new EventDelegate(this, "SetGCMId"));
            //waiting 3 secs
            StartCoroutine(WaitingToken());
            //			}
        }
        else if (Application.platform == RuntimePlatform.OSXEditor)
        {
            mLoginInfo.osType = 1;
            mLoginInfo.memUID = "";
            //            NetMgr.DoLogin (mLoginInfo, mLoginEvent);
            SetGCMId();
        }
    }
예제 #21
0
    //    public void Login(string eMail, string pwd)
    public void Login(LoginInfo loginInfo)
    {
        //        mLoginInfo = new LoginInfo ();
        mLoginInfo             = loginInfo;
        mLoginInfo.memberEmail = "";
        //        mLoginInfo.memberName = nick;
        mLoginInfo.memberPwd = "";
        mLoginEvent          = new LoginEvent(new EventDelegate(this, "LoginComplete"));
        //        UtilMgr.ShowLoading (true);

        PlayerPrefs.SetString(Constants.PrefNick, loginInfo.memberName);
        //        PlayerPrefs.SetString (Constants.PrefPwd, pwd);

        if (Application.platform == RuntimePlatform.Android)
        {
            mLoginInfo.osType = 1;
            AndroidMgr.RegistGCM(new EventDelegate(this, "SetGCMId"));
        }
        else if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            mLoginInfo.osType = 2;
//			if(CheckPushAgree()){
//				mLoginInfo.memUID = "";
//				//                NetMgr.DoLogin (mLoginInfo, mLoginEvent);
//				SetGCMId();
//			} else{
            IOSMgr.RegistAPNS(new EventDelegate(this, "SetGCMId"));
            //waiting 4 secs
            StartCoroutine(WaitingToken());
//			}
        }
        else if (Application.platform == RuntimePlatform.OSXEditor)
        {
            mLoginInfo.osType = 1;
            mLoginInfo.memUID = "";
            //            NetMgr.DoLogin (mLoginInfo, mLoginEvent);
            SetGCMId();
        }
    }
예제 #22
0
 public void GoNext()
 {
     if (mSelected)
     {
         mMemInfo.FavoBB = mTeamCode;
                     #if (UNITY_EDITOR)
         mMemInfo.OsType = 0;
         CompleteGCM();
                     #elif (UNITY_ANDROID)
         mMemInfo.OsType = 1;
         AndroidMgr.RegistGCM(new EventDelegate(this, "CompleteGCM"));
                     #else
         memInfo.OsType = 2;
                     #endif
     }
     else if (!mSelected)
     {
         DialogueMgr.ShowDialogue(
             "Select Team", "You must choose a team!", DialogueMgr.DIALOGUE_TYPE.Alert,
             null, null, null);
     }
 }
예제 #23
0
 public static void GetGalleryImages(EventDelegate eventDelegate)
 {
     Instance.mEventDelegate = eventDelegate;
     AndroidMgr.CallJavaFunc("GetGalleryImages", "");
 }
예제 #24
0
 public void GotUserImg()
 {
     string path = AndroidMgr.GetMsg();
     //here we go!!!!
 }
예제 #25
0
 public void GotPhoto()
 {
     string msg = AndroidMgr.GetMsg();
 }
예제 #26
0
 public static void GetHeightStatusBar()
 {
     AndroidMgr.CallJavaFunc("GetHeightStatusBar", "");
 }
예제 #27
0
 public void SetGCMId()
 {
     mLoginInfo.memUID = AndroidMgr.GetMsg();
     NetMgr.DoLogin(mLoginInfo, mLoginEvent);
 }
예제 #28
0
 public static void OpenFB(EventDelegate eventDelegate)
 {
     Instance.mEventDelegate = eventDelegate;
     AndroidMgr.CallJavaFunc("OpenFB", "");
 }
예제 #29
0
 public static void ViberateDevice(long millSec)
 {
     AndroidMgr.CallJavaFunc("ViberateDevice", string.Format("{0}", millSec));
 }
예제 #30
0
 public static void RegistGCM(EventDelegate eventDelegate)
 {
     Instance.mEventDelegate = eventDelegate;
     AndroidMgr.CallJavaFunc("RegisterGCM", "");
 }