コード例 #1
0
ファイル: Merchant3.cs プロジェクト: juny1258/JJ_Project
 private void OnApplicationPause(bool pauseStatus)
 {
     if (pauseStatus)
     {
         // 나갔을 때
     }
     else
     {
         // 다시 들어왔을 때
         if (PlayerPrefs.GetFloat("Merchant3", 0) == 0)
         {
             if (AndroidUtil.IsAppInstalled("game.Tylenol.CTDT"))
             {
                 PlayerPrefs.SetFloat("Merchant3", 1);
                 DataController.Instance.ruby += 1000;
                 if (Application.systemLanguage == SystemLanguage.Korean)
                 {
                     NotificationManager.Instance.SetNotification2("루비 1,000개가 지급되었습니다.");
                 }
                 else
                 {
                     NotificationManager.Instance.SetNotification2("Get 1,000 Ruby!!");
                 }
                 Panel.SetActive(false);
             }
         }
     }
 }
コード例 #2
0
ファイル: UIManager.cs プロジェクト: juny1258/JJ_Project
    // Use this for initialization
    void Start()
    {
//        FirebaseMessaging.MessageReceived += OnMessageReceived;

        if (Application.systemLanguage == SystemLanguage.Japanese)
        {
            var textComponents = FindObjectsOfTypeAll(typeof(Text)) as Text[];
            foreach (var textComponent in textComponents)
            {
                textComponent.font = Resources.Load <Font>("Font/Japan3");
            }
        }

        // 첫 실행 시 튜토리얼 진행
        if (PlayerPrefs.GetInt("FirstOpenGame", 0) == 0)
        {
            DataController.Instance.isTutorial = true;

            StartInfoPanel.SetActive(true);
        }

        if (PlayerPrefs.GetFloat("Merchant", 0) == 0)
        {
            if (AndroidUtil.IsAppInstalled("com.juny.merchant"))
            {
                PlayerPrefs.SetFloat("Merchant", 1);
                DataController.Instance.ruby += 2000;
                if (Application.systemLanguage == SystemLanguage.Korean)
                {
                    NotificationManager.Instance.SetNotification2("루비 2,000개가 지급되었습니다.");
                }
                else
                {
                    NotificationManager.Instance.SetNotification2("Get 2,000 Ruby!!");
                }
            }
        }

        if (PlayerPrefs.GetFloat("Merchant2", 0) == 0)
        {
            if (AndroidUtil.IsAppInstalled("com.pancol.LifeIsGood"))
            {
                PlayerPrefs.SetFloat("Merchant2", 1);
                DataController.Instance.ruby += 1000;
                if (Application.systemLanguage == SystemLanguage.Korean)
                {
                    NotificationManager.Instance.SetNotification2("루비 1,000개가 지급되었습니다.");
                }
                else
                {
                    NotificationManager.Instance.SetNotification2("Get 1,000 Ruby!!");
                }
            }
        }

        if (PlayerPrefs.GetFloat("Merchant3", 0) == 0)
        {
            if (AndroidUtil.IsAppInstalled("game.Tylenol.CTDT"))
            {
                PlayerPrefs.SetFloat("Merchant3", 1);
                DataController.Instance.ruby += 1000;
                if (Application.systemLanguage == SystemLanguage.Korean)
                {
                    NotificationManager.Instance.SetNotification2("루비 1,000개가 지급되었습니다.");
                }
                else
                {
                    NotificationManager.Instance.SetNotification2("Get 1,000 Ruby!!");
                }
            }
        }

        SetCostume();

        EventManager.AutoClickEvent += SetAutoClick;

        EventManager.SelectCostumeEvent += SetCostume;

        EventManager.SelectSkinEvent += SetCostume;

        EventManager.PlaySkillEvent += ShowSkillCoolTime;

        InvokeRepeating("FlyRewardPlay", 60, 180);

        InvokeRepeating("ShowSkillCoolTime", 0, 0.2f);

        InvokeRepeating("AddCool", 1, 1);

        if (Social.localUser.authenticated)
        {
            userReference.Child(PlayGamesPlatform.Instance.localUser.id).GetValueAsync().ContinueWith(
                task =>
            {
                if (task.IsCompleted)
                {
                    var userData = JsonUtility.FromJson <UserRankData>(task.Result.GetRawJsonValue());
                    if (userData.isHack >= 1)
                    {
                        BanPanel.SetActive(true);
                        task.Result.Child("isHack").Reference.SetValueAsync(2);
                    }
                }
            });
        }

        if (DataController.Instance.petIndex > -1)
        {
            PetObject[DataController.Instance.petIndex].SetActive(true);
        }


        InvokeRepeating("InitKeepStart", 3600, 3600);
    }