Exemple #1
0
    // ------------------------------------------------------------------
    IEnumerator FlyToPos()
    {
        int   iCount = 1;
        float fFrame = 1;

        while (iCount <= 9)
        {
            pSprite.transform.Rotate(0, 0, -10);
            pSprite.transform.localScale = new Vector3(pSprite.transform.localScale.x + (0.01f * iCount), pSprite.transform.localScale.y + (0.01f * iCount), 1);
            iCount++;
            yield return(new WaitForEndOfFrame());
        }

        yield return(new WaitForSeconds(0.8f));

        while (Vector2.Distance(pSprite.transform.position, P_UI.pthis.ObjAmmoHeavy.transform.position) > 0.03f)
        {
            yield return(new WaitForEndOfFrame());

            ToolKit.MoveTo(gameObject, P_UI.pthis.ObjAmmoHeavy.transform.position - pSprite.transform.position, 0.8f * fFrame);
            fFrame += 0.05f;
        }

        DataPickup.pthis.Data[iItemID].bPickup = true;
        Rule.HeavyAmmoAdd(DataPickup.pthis.Data[iItemID].iCount);
        P_UI.pthis.UpdateResource();

        SysAchieve.pthis.Add(ENUM_Achievement.Total_HeavyAmmo, DataPickup.pthis.Data[iItemID].iCount);
        GoogleAnalyticsV3.getInstance().LogEvent("Count", "Pickup HeavyAmmo", "", 0);

        Destroy(gameObject);
    }
    // ------------------------------------------------------------------
    IEnumerator FlyToPos()
    {
        //轉加放大
        int iCount = 1;

        while (iCount <= 9)
        {
            pSprite.transform.localScale = new Vector3(pSprite.transform.localScale.x + (0.01f * iCount), pSprite.transform.localScale.y + (0.01f * iCount), 1);
            iCount++;
            yield return(new WaitForEndOfFrame());
        }
        P_UI.pthis.ShowCrystal();
        yield return(new WaitForSeconds(0.8f));

        Vector3 VecPos = P_UI.pthis.ObjCrystal.transform.position;

        float fFrame = 1;

        while (Vector2.Distance(pSprite.transform.position, VecPos) > 0.03f)
        {
            yield return(new WaitForEndOfFrame());

            ToolKit.MoveTo(gameObject, VecPos - pSprite.transform.position, 0.82f * fFrame);
            fFrame += 0.05f;
        }

        DataPickup.pthis.Data[iItemID].bPickup = true;
        P_UI.pthis.AddCrystal(DataPickup.pthis.Data[iItemID].iCount);

        SysAchieve.pthis.Add(ENUM_Achievement.Total_Crystal, DataPickup.pthis.Data[iItemID].iCount);
        GoogleAnalyticsV3.getInstance().LogEvent("Count", "Pickup Crystal", "", 0);

        Destroy(gameObject);
    }
Exemple #3
0
    void Start()
    {
        GoogleAnalyticsV3.getInstance().LogScreen("Failed");
        GoogleAnalyticsV3.getInstance().LogEvent("Failed", "Day" + DataPlayer.pthis.iStage, "", 1);

        StartCoroutine(OpenPage());
        // 天數.
        pLb[0].text = DataPlayer.pthis.iStage.ToString();
        // 關卡時間.
        pLb[1].text = string.Format("{0:00}:{1:00}:{2:00}", DataPlayer.pthis.iPlayTime / 3600, (DataPlayer.pthis.iPlayTime / 60) % 60, DataPlayer.pthis.iPlayTime % 60);
        // 殺怪數.
        pLb[2].text = DataPlayer.pthis.iEnemyKill.ToString();

        AudioCtrl.pthis.pMusic.volume = 0.5f;
        NGUITools.PlaySound(Resources.Load("Sound/FX/Fail") as AudioClip);

        // 比較紀錄.
        ObjRecord.SetActive(DataRecord.pthis.RecordNow());

        // 重設存檔與遊戲檔案.
        DataPlayer.pthis.Clear();
        DataGame.pthis.Clear();
        DataPickup.pthis.Clear();

        // 設為新遊戲.
        SysMain.pthis.NewRoleData();

        SysMain.pthis.SaveGame();
    }
Exemple #4
0
    void Start()
    {
        GoogleAnalyticsV3.getInstance().LogScreen("Stage");

        GoogleAnalyticsV3.getInstance().LogEvent("Play", "Day" + DataPlayer.pthis.iStage, "", 1);
        LbDay.text = "Day [e92121]" + DataPlayer.pthis.iStage;

        if (Rule.AppearBossStage())
        {
            pAni.Play("ShowDayBoss");
        }
    }
Exemple #5
0
    void Start()
    {
        GoogleAnalyticsV3.getInstance().LogScreen("Login");
        // 選音樂.
        AudioCtrl.pthis.PlayMusic("Start", 0.9f);

        // 預先載入地圖物件.
        UITool.pthis.PreLoadMapObj(DataPlayer.pthis.iStyle);

        // 建立地圖物件.
        MapCreater.pthis.Show(0);
        // 開始行走
        CameraCtrl.pthis.LoginMove();
    }
Exemple #6
0
    // ------------------------------------------------------------------
    public void ChangePage(int iPage)
    {
        ObjPage[iPage].SetActive(false);
        ObjPage[iPage + 1].SetActive(true);

        if (ObjPage[iPage + 1] && ObjPage[iPage + 1].GetComponent <G_Feature>())
        {
            ObjPage[iPage + 1].GetComponent <G_Feature>().OpenPage();
        }

        if (iPage + 1 == 2)
        {
            GoogleAnalyticsV3.getInstance().LogScreen("Shop");
            ObjCrystalShop = SysUI.pthis.CreatePanel("Prefab/P_CrystalMan");
        }
    }
Exemple #7
0
    // ------------------------------------------------------------------
    void OnClick()
    {
        // 檢查金錢是否足夠.
        if (DataPlayer.pthis.iCurrency < GameDefine.iPriceLayoff)
        {
            return;
        }

        GoogleAnalyticsV3.getInstance().LogEvent("Count", "Layoff", "", 0);

        DataPlayer.pthis.iCurrency -= GameDefine.iPriceLayoff;
        pData.pData.Layoff();

        P_UI.pthis.UpdateCurrency();
        DataPlayer.pthis.Save();
    }
 // ------------------------------------------------------------------
 void OnPress(bool bIsPress)
 {
     if (bIsPress)
     {
         NGUITools.PlaySound(Resources.Load("Sound/FX/SaveRole") as AudioClip);
         if (pPlayer.iTied <= 0)
         {
             PlayerCreater.pthis.SaveRole(pPlayer.gameObject);
             Statistics.pthis.RecordResource(ENUM_Pickup.Member, 1);
             GoogleAnalyticsV3.getInstance().LogEvent("Count", "Save Member", "", 0);
             if (DataPickup.pthis.Data[iItemID] != null)
             {
                 DataPickup.pthis.Data[iItemID].bPickup = true;
             }
         }
         Destroy(gameObject);
     }
 }
Exemple #9
0
    // ------------------------------------------------------------------
    void StartBomb()
    {
        if (fCoolDown > Time.time || DataPlayer.pthis.iBomb <= 0)
        {
            return;
        }

        pBtn.isEnabled = false;

        // 播放大絕.
        SysBomb.pthis.StartBomb();

        // 計算冷卻.
        fCoolDown = Time.time + 3;

        GoogleAnalyticsV3.getInstance().LogEvent("Count", "Use Bomb", "", 0);

        StartCoroutine(CoolDown());
    }
Exemple #10
0
    void OnClick()
    {
        // 檢查金錢是否足夠.
        if (DataPlayer.pthis.iCurrency < GameDefine.iLightAmmoCost)
        {
            // 錢不夠要表演叭叭.
            GetComponent <Animator>().Play("CantBuy");
            return;
        }

        GoogleAnalyticsV3.getInstance().LogEvent("Count", "Buy LightAmmo", "", 0);

        NGUITools.PlaySound(P_Victory.pthis.Clip_Buy);
        DataPlayer.pthis.iCurrency -= GameDefine.iLightAmmoCost;
        Rule.LightAmmoAdd(GameDefine.iLightAmmoCount);
        P_UI.pthis.UpdateCurrency();
        P_UI.pthis.UpdateResource();
        DataPlayer.pthis.Save();
    }
Exemple #11
0
    // ------------------------------------------------------------------
    void OnClick()
    {
        // 檢查金錢是否足夠.
        if (DataPlayer.pthis.iCurrency < Rule.DmgLvMoney())
        {
            // 錢不夠要表演叭叭.
            GetComponent <Animator>().Play("CantBuy");
            return;
        }

        GoogleAnalyticsV3.getInstance().LogEvent("Count", "Buy AddDmg", "", 0);

        NGUITools.PlaySound(P_Victory.pthis.Clip_Buy);
        DataPlayer.pthis.iCurrency -= Rule.DmgLvMoney();
        DataPlayer.pthis.iDamageLv++;
        P_UI.pthis.UpdateCurrency();
        DataPlayer.pthis.Save();
        // 更新價格.
        LbMoney.text = Rule.DmgLvMoney().ToString();
    }
    // ------------------------------------------------------------------
    void OnPress(bool bIsPress)
    {
        if (bIsPress)
        {
            NGUITools.PlaySound(Resources.Load("Sound/FX/SaveRole") as AudioClip);

            pPlayer.iTied--;
            if (pPlayer.iTied <= 0)
            {
                // 加回被抓機率.
                if (ToolKit.CatchRole.ContainsKey(pPlayer.gameObject))
                {
                    ToolKit.CatchRole[pPlayer.gameObject] += 20;
                }

                GoogleAnalyticsV3.getInstance().LogEvent("Count", "Untied Member", "", 0);
            }
            Destroy(gameObject);
        }
    }
    private void SendGaHitWithMeasurementProtocol(string url)
    {
        if (optOut)
        {
            return;
        }
        if (String.IsNullOrEmpty(url))
        {
            if (GoogleAnalyticsV3.belowThreshold(logLevel, GoogleAnalyticsV3.DebugMode.WARNING))
            {
                Debug.Log("No tracking code set for 'Other' platforms - hit will not be sent.");
            }
            return;
        }
        if (dryRun)
        {
            if (GoogleAnalyticsV3.belowThreshold(logLevel, GoogleAnalyticsV3.DebugMode.VERBOSE))
            {
                Debug.Log("Dry run or opt out enabled - hits will not be sent.");
            }
            return;
        }
        if (startSessionOnNextHit)
        {
            url += AddOptionalMPParameter(Fields.SESSION_CONTROL, "start");
            startSessionOnNextHit = false;
        }
        else if (endSessionOnNextHit)
        {
            url += AddOptionalMPParameter(Fields.SESSION_CONTROL, "end");
            endSessionOnNextHit = false;
        }
        // Add random z to avoid caching
        string newUrl = url + "&z=" + UnityEngine.Random.Range(0, 500);

        if (GoogleAnalyticsV3.belowThreshold(logLevel, GoogleAnalyticsV3.DebugMode.VERBOSE))
        {
            Debug.Log(newUrl);
        }
        GoogleAnalyticsV3.getInstance().StartCoroutine(this.HandleWWW(new WWW(newUrl)));
    }
Exemple #14
0
    // ------------------------------------------------------------------
    void Start()
    {
        GoogleAnalyticsV3.getInstance().LogScreen("Victory");

        GoogleAnalyticsV3.getInstance().LogEvent("PlayTime", "Day" + DataPlayer.pthis.iStage, "", DataGame.pthis.iStageTime);
        GoogleAnalyticsV3.getInstance().LogEvent("Victory", "Day" + DataPlayer.pthis.iStage, "", 1);

        // 天數.
        pLb[0].text = DataPlayer.pthis.iStage.ToString();
        // 關卡時間.
        pLb[1].text = string.Format("{0:00}:{1:00}:{2:00}", DataGame.pthis.iStageTime / 3600, (DataGame.pthis.iStageTime / 60) % 60, DataGame.pthis.iStageTime % 60);
        // 殺怪數.
        pLb[2].text = DataGame.pthis.iKill.ToString();
        // 殘餘人數.
        pLb[3].text = DataPlayer.pthis.MemberParty.Count.ToString();
        // 死亡人數.
        pLb[4].text = DataGame.pthis.iDead.ToString();

        AudioCtrl.pthis.PlayMusic("BG_Victory", 0.55f);
        NGUITools.PlaySound(Resources.Load("Sound/FX/Victory") as AudioClip);
    }
Exemple #15
0
    // ------------------------------------------------------------------
    public void OpenPage()
    {
        GoogleAnalyticsV3.getInstance().LogScreen("Member List");

        iFeature = new int[DataPlayer.pthis.MemberParty.Count];
        iEquip   = new int[DataPlayer.pthis.MemberParty.Count];

        // 有幾個人建幾個人.
        for (int i = 0; i < DataPlayer.pthis.MemberParty.Count; i++)
        {
            // 建立群組.
            ObjGroup[i]      = UITool.pthis.CreateUI(ObjGrid, "Prefab/G_ListRole");
            ObjGroup[i].name = string.Format("Role{0:000}", i);
            ObjGroup[i].GetComponent <G_ListRole>().pInfo     = pInfo;
            ObjGroup[i].GetComponent <G_ListRole>().iPlayerID = i;

            if (!DataGame.pthis.bVictory)
            {
                // 升級.
                DataPlayer.pthis.MemberParty[i].iLiveStage++;
                iFeature[i] = Rule.GainFeature(i);
                iEquip[i]   = Rule.GainEquip(i);
            }
        }

        RefreshMember();

        ObjGrid.GetComponent <UIGrid>().Reposition();

        DataGame.pthis.bVictory = true;

        Rule.AddDamageReset();
        Rule.CriticalStrikeReset();
        SysMain.pthis.SaveGame();

        StartCoroutine(StartGain());
    }
 public void ShowAd()
 {
     UnityAdsHelper.ShowAd(zoneID, RewardUser);
     GoogleAnalyticsV3.getInstance().LogEvent("Count", "WatchAD", "", 0);
 }
 // ------------------------------------------------------------------
 void Start()
 {
     GoogleAnalyticsV3.getInstance().LogScreen("AddMember");
     UpdateCurrency();
 }
 void Start()
 {
     GoogleAnalyticsV3.getInstance().LogScreen("Copyright");
     SysMain.pthis.ReadyStart();
 }