static int Clear(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         System.Collections.Generic.List <UnityEngine.EventSystems.RaycastResult> obj = (System.Collections.Generic.List <UnityEngine.EventSystems.RaycastResult>)ToLua.CheckObject(L, 1, typeof(System.Collections.Generic.List <UnityEngine.EventSystems.RaycastResult>));
         obj.Clear();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int Clear(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         System.Collections.Generic.List <string> obj = (System.Collections.Generic.List <string>)ToLua.CheckObject(L, 1, typeof(System.Collections.Generic.List <string>));
         obj.Clear();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    /// <summary>
    /// Stop and release all AudioSourcewith loop and pitch
    /// </summary>
    public static void FreeAllsounds()
    {
        if (list_extraSnd.Count > 0)
        {
            GameObject go = list_extraSnd[0].gameObject;
            for (int i = 0; i < list_extraSnd.Count; i++)
            {
                list_extraSnd[i].Stop();
                list_extraSnd[i].clip = null;
                Destroy(list_extraSnd[i]);
            }

            Destroy(go);
            list_extraSnd.Clear();
        }
    }
Esempio n. 4
0
    public void Puzzle_ChestOpen() //puzzle sandığı açılınca çalışacak komutlar
    {
        System.Collections.Generic.List <string> puzzletemp = new System.Collections.Generic.List <string>();
        puzzletemp.Clear();
        if (PlayerPrefs.GetInt("Para") >= 2000) //eger para 6000 den yüksekse calıs
        {
            int temp = PlayerPrefs.GetInt("Para");


            name_control();
            while (puzzletemp.Count < 60)
            {
                int    rand        = UnityEngine.Random.Range(0, 15);
                int    indexrand   = UnityEngine.Random.Range(1, 5);
                string puzzletemps = names[rand] + indexrand;
                if (!PlayerPrefs.HasKey(names[rand] + indexrand))
                {
                    PlayerPrefs.SetInt(names[rand] + indexrand, 1);
                    sandiktanCikan.GetComponent <SandiktanCikanEsya>().puzzle(names[rand] + indexrand);
                    Instantiate(sandiktanCikan);
                    ParaArttir(PlayerPrefs.GetInt("Para"), 0, 2000);
                    PlayerPrefs.SetInt("Para", temp -= 2000);
                    temp = PlayerPrefs.GetInt("Para");

                    return;
                }
                else
                {
                    if (puzzletemp.IndexOf(puzzletemps) == -1)
                    {
                        puzzletemp.Add(puzzletemps);
                    }
                }
            }
            ParaArttir(PlayerPrefs.GetInt("Para"), 2000, 2000);
            PlayerPrefs.SetInt("Para", temp += 2000);
            PlayerPrefs.SetInt("Para", temp -= 2000);
            GameObject dogrucevap = Resources.Load("GameObject/Uyari") as GameObject;
            dogrucevap.transform.GetChild(0).transform.GetChild(0).transform.GetChild(1).GetComponent <Text>().text = "Puzzle'nin tüm parçalarını zaten tamamladınız.";
            Destroy(Instantiate(dogrucevap), 2.3f);
            return;
        }
        else
        {
            Instantiate(Resources.Load("GameObject/ParaYok") as GameObject);
        }
    }
Esempio n. 5
0
 /// <summary>
 /// Remove all instances of ClientDiskList from the collection
 /// </summary>
 /// <pdGenerated>Default removeAll</pdGenerated>
 public void RemoveAllClientDiskList()
 {
     if (clientDiskList != null)
     {
         System.Collections.ArrayList tmpClientDiskList = new System.Collections.ArrayList();
         foreach (ClientDiskList oldClientDiskList in clientDiskList)
         {
             tmpClientDiskList.Add(oldClientDiskList);
         }
         clientDiskList.Clear();
         foreach (ClientDiskList oldClientDiskList in tmpClientDiskList)
         {
             oldClientDiskList.VdiskTemplet = null;
         }
         tmpClientDiskList.Clear();
     }
 }
Esempio n. 6
0
 /// <summary>
 /// Remove all instances of VdiskGroupList from the collection
 /// </summary>
 /// <pdGenerated>Default removeAll</pdGenerated>
 public void RemoveAllVdiskGroupList()
 {
     if (vdiskGroupList != null)
     {
         System.Collections.ArrayList tmpVdiskGroupList = new System.Collections.ArrayList();
         foreach (VdiskGroupList oldVdiskGroupList in vdiskGroupList)
         {
             tmpVdiskGroupList.Add(oldVdiskGroupList);
         }
         vdiskGroupList.Clear();
         foreach (VdiskGroupList oldVdiskGroupList in tmpVdiskGroupList)
         {
             oldVdiskGroupList.VdiskGroup = null;
         }
         tmpVdiskGroupList.Clear();
     }
 }
Esempio n. 7
0
 /// <summary>
 /// Remove all instances of AuthInfo from the collection
 /// </summary>
 /// <pdGenerated>Default removeAll</pdGenerated>
 public void RemoveAllAuthInfo()
 {
     if (authInfo != null)
     {
         System.Collections.ArrayList tmpAuthInfo = new System.Collections.ArrayList();
         foreach (AuthInfo oldAuthInfo in authInfo)
         {
             tmpAuthInfo.Add(oldAuthInfo);
         }
         authInfo.Clear();
         foreach (AuthInfo oldAuthInfo in tmpAuthInfo)
         {
             oldAuthInfo.Product = null;
         }
         tmpAuthInfo.Clear();
     }
 }
Esempio n. 8
0
 /// <summary>
 /// Remove all instances of LoginInfo from the collection
 /// </summary>
 /// <pdGenerated>Default removeAll</pdGenerated>
 public void RemoveAllLoginInfo()
 {
     if (loginInfo != null)
     {
         System.Collections.ArrayList tmpLoginInfo = new System.Collections.ArrayList();
         foreach (LoginInfo oldLoginInfo in loginInfo)
         {
             tmpLoginInfo.Add(oldLoginInfo);
         }
         loginInfo.Clear();
         foreach (LoginInfo oldLoginInfo in tmpLoginInfo)
         {
             oldLoginInfo.RoleInfo = null;
         }
         tmpLoginInfo.Clear();
     }
 }
 /// <summary>
 /// Remove all instances of Client from the collection
 /// </summary>
 /// <pdGenerated>Default removeAll</pdGenerated>
 public void RemoveAllClient()
 {
     if (client != null)
     {
         System.Collections.ArrayList tmpClient = new System.Collections.ArrayList();
         foreach (Client oldClient in client)
         {
             tmpClient.Add(oldClient);
         }
         client.Clear();
         foreach (Client oldClient in tmpClient)
         {
             oldClient.ClientDiskGroupList = null;
         }
         tmpClient.Clear();
     }
 }
Esempio n. 10
0
 /// <summary>
 /// Remove all instances of VdiskRestorePoint from the collection
 /// </summary>
 /// <pdGenerated>Default removeAll</pdGenerated>
 public void RemoveAllVdiskRestorePoint()
 {
     if (vdiskRestorePoint != null)
     {
         System.Collections.ArrayList tmpVdiskRestorePoint = new System.Collections.ArrayList();
         foreach (VdiskRestorePoint oldVdiskRestorePoint in vdiskRestorePoint)
         {
             tmpVdiskRestorePoint.Add(oldVdiskRestorePoint);
         }
         vdiskRestorePoint.Clear();
         foreach (VdiskRestorePoint oldVdiskRestorePoint in tmpVdiskRestorePoint)
         {
             oldVdiskRestorePoint.VdiskTemplet = null;
         }
         tmpVdiskRestorePoint.Clear();
     }
 }
Esempio n. 11
0
    private void FinalizeIngredientSelection()
    {
        m_SelectedIngredients[m_CurrentNumberOfSelectedIngredients] = m_CurrentlyHoveredAreas[0].CurrentIngredient;
        m_CurrentlyHoveredAreas[0].SelectionAreaDisplay.NoHighlights();
        m_CurrentNumberOfSelectedIngredients++;
        ShuffleIngredientsInSelectionArea();

        m_CurrentlyHoveredAreas.Clear();
        ActivateIngredientSelection(true);

        if (m_CurrentNumberOfSelectedIngredients == m_NumberOfIngredientChoices)
        {
            OnLeaveState();
        }
        else
        {
            CheckSelection();
        }
    }
Esempio n. 12
0
    private void LateUpdate()
    {
        e_Current = Window.current?.name;
        var stack = Window.stack;

        if (stack.SequenceEqual(e_Stack))
        {
            return;
        }

        e_Stack.Clear();
        e_Stack.AddRange(stack);

        e_WindowStack.Clear();
        foreach (var w in e_Stack)
        {
            e_WindowStack.Add($"[{w.index}:{w.windowName}]");
        }
    }
Esempio n. 13
0
 void OnEnable()
 {
     name_control();
     if (puzzleImages.Count == 0 || puzzle.Count == 0)
     {
         puzzleImages.Clear();
         puzzle.Clear();
         for (int i = 0; i < gO.transform.childCount; i++)
         {
             for (int y = 0; y < 4; y++)
             {
                 puzzleImages.Add(gO.transform.GetChild(i).gameObject.transform.GetChild(y).gameObject.GetComponent <Image>());
                 if (y == 3)
                 {
                     puzzle.Add(gO.transform.GetChild(i).gameObject.transform.GetChild(y).gameObject.transform.GetChild(0).gameObject);
                 }
             }
         }
     }
     PuzzleYenile();
 }
Esempio n. 14
0
        public void Migrate()
        {
            var count = ValueGuids.Count;

            if (count < 1 || count != ValueIcons.Count || count != valuesInternal.Count)
            {
                return;
            }

            values.Clear();
            for (var i = 0; i < count; ++i)
            {
                var value = new AkBaseInformation
                {
                    Name = valuesInternal[i],
                    Guid = GetGuid(ValueGuids[i].bytes)
                };
                value.PathAndIcons.Add(ValueIcons[i]);
                values.Add(value);
            }
        }
Esempio n. 15
0
    private void startNew(object sender, EventArgs e)
    {
        B.Clear();

        ship.x         = 5;
        ship.y         = 4;
        ship.direction = "right";
        ship.life      = 100;
        lk             = lastKey.Right;

        level = 0;

        caps = new System.Collections.Generic.List <Energy>();

        timer.Start();
        timer2.Start();

        PlaySong(null, null);

        timer3.Start();
    }
Esempio n. 16
0
    public void Update()
    {
        foreach (var onClickFunction in onClickEventFnList)
        {
            onClickFunction();
        }
        onClickEventFnList.Clear();

        SaveErrorCheck();

        // Update object positions that supposed to be visible into the range of the camera
        _minPos = currentSong.WorldYPositionToTick(camYMin.position.y);
        _maxPos = currentSong.WorldYPositionToTick(camYMax.position.y);

        // Set window text to represent if the current song has been saved or not
        windowHandleManager.UpdateDirtyNotification(isDirty);

        if (Globals.applicationMode != Globals.ApplicationMode.Loading && (autosave == null || autosave.ThreadState != System.Threading.ThreadState.Running))
        {
            autosaveTimer += Time.deltaTime;

            if (autosaveTimer > AUTOSAVE_RUN_INTERVAL)
            {
                Autosave();
            }
        }
        else
        {
            autosaveTimer = 0;
        }

        if (quitting)
        {
            if (EditCheck())
            {
                wantsToQuit = true;
                UnityEngine.Application.Quit();
            }
        }
    }
Esempio n. 17
0
    //public GameObject loadingImage;

    public void LoadScene(string level)
    {
        System.Collections.Generic.List <Mission> tempList = new System.Collections.Generic.List <Mission>();

        for (int i = 0; i < Data.militaryList.Count; i++)
        {
            if (Data.militaryList[i].difficulty == Data.currentDifficulty)
            {
                tempList.Add(Data.militaryList[i]);
            }
        }

        System.Random r           = new System.Random();
        int           randomIndex = r.Next(0, tempList.Count);

        Debug.Log("Random mission: " + randomIndex + " out of: " + tempList.Count);
        Data.pickedMission = tempList[randomIndex];
        tempList.Clear();

        //loadingImage.SetActive(true);
        Application.LoadLevel(level);
    }
Esempio n. 18
0
    public override void FillBufferedData()
    {
        if (actDirty != null)
        {
            actDirty();
        }

        SetBuyDialodTitle(m_strTitle);
        SetBuyDialogCost(m_strCost);

        if (m_listActAttr.Count > 0)
        {
            for (int i = 0; i < m_listActAttr.Count; ++i)
            {
                m_listActAttr[i]();
            }

            m_listActAttr.Clear();
        }

        SetBuyDialogIcon(m_strImgName);
    }
Esempio n. 19
0
 void name_control()
 {
     if (names.Count == 0)
     {
         names.Clear();
         names.Add("leeminho");
         names.Add("leehyeri");
         names.Add("kimhyunjoong");
         names.Add("kimseokjin");
         names.Add("leedongwook");
         names.Add("suzy");
         names.Add("parkminyoung");
         names.Add("parkseojong");
         names.Add("leejongsuk");
         names.Add("parkhyungsik");
         names.Add("parkboyoung");
         names.Add("jichangwook");
         names.Add("kimnamjoon");
         names.Add("parkshinhye");
         names.Add("junjihyun");
         //prefab initalize
     }
 }
    int Ignore(int start, int count, RaycastHit[] hits)
    {
        for (int i = start; i < count; i++)
        {
            var hit = hits[i];
            if (!hit.point.IsAbsoluteZero())
            {
                continue;
            }
            m_IndexIgnore.Add(i);
        }
        int countIndex = m_IndexIgnore.Count;

        for (int i = 0; i < countIndex; i++)
        {
            for (int j = m_IndexIgnore[i] - i; j < count - 1; j++)
            {
                hits[j] = hits[j + 1];
            }
        }
        m_IndexIgnore.Clear();
        return(count - countIndex);
    }
Esempio n. 21
0
    public override void FillBufferedData()
    {
        if (actDirty != null)
        {
            actDirty();
        }

        SetUpgradeDialogTitle(m_strTitle);
        SetUpgradeDialogCurrentLevel(m_strLevel);
        SetUpgradeDialogNextLevel(m_strNextLevel);
        SetUpgradeDialogCost(m_strCost);
        SetUpgradeDialogIcon(m_strImgName);

        if (m_listActSetCurrentAttr.Count > 0)
        {
            for (int i = 0; i < m_listActSetCurrentAttr.Count; ++i)
            {
                m_listActSetCurrentAttr[i]();
            }

            m_listActSetCurrentAttr.Clear();
        }

        if (m_listActSetNextAttr.Count > 0)
        {
            for (int i = 0; i < m_listActSetNextAttr.Count; ++i)
            {
                m_listActSetNextAttr[i]();
            }

            m_listActSetNextAttr.Clear();
        }

        SetUpgradeDialogProgressText(m_strProgressText);
        SetUpgradeDialogProgressSize(m_fProgressSize);
        SetUpgradeDialogStarNum(m_iStarNum);
    }
Esempio n. 22
0
    private static void Update_7DayTable()
    {
        Lib.DataUtility       local = new Lib.DataUtility(Lib.DataUtility.ConnectionType.CenterDB);
        System.Data.DataTable dt    = new System.Data.DataTable();
        //需更新鑑測站web物件,重新參考服務web
        MainWS_KUMA_PC.WebService3 MainWebService = new MainWS_KUMA_PC.WebService3();
        //下面要改websv呼叫的方法
        dt = MainWebService.Get_7DayResultCount(Lib.SysSetting.CenterCode);//這裡要改呼叫Get_7DayResultCount
        if (dt.Rows.Count != 0)
        {
            System.Collections.Generic.List <System.Collections.Generic.Dictionary <string, object> > list = new System.Collections.Generic.List <System.Collections.Generic.Dictionary <string, object> >();
            foreach (System.Data.DataRow row in dt.Rows)
            {
                System.Collections.Generic.Dictionary <string, object> d = new System.Collections.Generic.Dictionary <string, object>();
                d.Add("date", row["date"].ToString());
                d.Add("count", row["count"].ToString());

                list.Add(d);
            }
            System.Data.DataTable ds = local.getDataTableBysp("Ex107_Update_7DayTable", list);
            list.Clear();
            dt.Dispose();
        }
    }
Esempio n. 23
0
    protected void ApplyToRenderers()
    {
        UnityEngine.Debug.Assert(this.exportToLocal);
        if (materialPropertyBlock == null)
        {
            materialPropertyBlock = new UnityEngine.MaterialPropertyBlock();
        }

        int datasLength = this.Datas != null ? this.Datas.Length : 0;

        this.FindRenderers(renderers);
        int renderersCount = renderers.Count;

        for (int i = 0; i < renderersCount; ++i)
        {
            renderers[i].GetPropertyBlock(materialPropertyBlock);
            materialPropertyBlock.SetBuffer(this.BufferName, this.computeBuffer);
            materialPropertyBlock.SetFloat(this.bufferSizeName, datasLength);
            renderers[i].SetPropertyBlock(materialPropertyBlock);
            materialPropertyBlock.Clear();
        }

        renderers.Clear();
    }
Esempio n. 24
0
    //public GameObject loadingImage;

    public void LoadScene(string level)
    {
        Data.noMissions = false;
        System.Collections.Generic.List <Mission> tempList = new System.Collections.Generic.List <Mission>();

        for (int i = 0; i < Data.diplomacyList.Count; i++)
        {
            if (Data.diplomacyList[i].difficulty == Data.currentDifficulty && !Data.diplomacyList[i].isDone)
            {
                tempList.Add(Data.diplomacyList[i]);
            }
        }

        System.Random r           = new System.Random();
        int           randomIndex = r.Next(0, tempList.Count);

        if (tempList.Count == 0)
        {
            //hotdogs
        }
        else if (!Data.preserveDipMission || !Data.lastDipMission.isListed)
        {
            Debug.Log("Random mission: " + randomIndex + " out of: " + tempList.Count);
            Data.pickedMission           = tempList[randomIndex];
            Data.lastDipMission          = Data.pickedMission;
            Data.lastDipMission.isListed = true;
        }
        else
        {
            Data.pickedMission = Data.lastDipMission;
        }
        tempList.Clear();
        Data.hitBack = false;
        //loadingImage.SetActive(true);
        Application.LoadLevel(level);
    }
Esempio n. 25
0
    /*
     * Updates SplinePoints Vectors, to be set to a line renderer for instance
     * Warning : variable number of spline points, iterative algorithm.
     */
    void makeSpline(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3)
    {
        float t0 = 0.0f;
        float t1 = GetT(t0, p0, p1);
        float t2 = GetT(t1, p1, p2);
        float t3 = GetT(t2, p2, p3);

        Vector3 p1Screen    = Camera.main.WorldToScreenPoint(p1);
        Vector3 p2Screen    = Camera.main.WorldToScreenPoint(p2);
        float   distPixP1P2 = Vector3.Distance(p1Screen, p2Screen);
        //Debug.Log(distPixP1P2);
        int nbPointsSpline = (int)Mathf.Ceil(distPixP1P2 / SPLINE_SEGMENT_PIXEL_SIZE);

        //Debug.Log(nbPointsSpline);

        SplinePoints.Clear();
        for (float t = t1; t < t2; t += ((t2 - t1) / (float)(nbPointsSpline)))
        {
            Vector2 A1 = (t1 - t) / (t1 - t0) * p0 + (t - t0) / (t1 - t0) * p1;
            Vector2 A2 = (t2 - t) / (t2 - t1) * p1 + (t - t1) / (t2 - t1) * p2;
            Vector2 A3 = (t3 - t) / (t3 - t2) * p2 + (t - t2) / (t3 - t2) * p3;

            Vector2 B1 = (t2 - t) / (t2 - t0) * A1 + (t - t0) / (t2 - t0) * A2;
            Vector2 B2 = (t3 - t) / (t3 - t1) * A2 + (t - t1) / (t3 - t1) * A3;

            Vector2 C = (t2 - t) / (t2 - t1) * B1 + (t - t1) / (t2 - t1) * B2;

            SplinePoints.Add(new Vector3(C.x, C.y, 2));
        }

        //Fix because not always adding last point to spline (t>t2 exit condition)
        //if((p2-SplinePoints[SplinePoints.Count- 1]).magnitude > (p2 - p1).magnitude / (nbPointsSpline*10))
        {
            SplinePoints.Add(new Vector3(p2.x, p2.y, 2));
        }
    }
Esempio n. 26
0
 public void updateAttractionPoints()
 {
     attractionPoints.Clear();
     attractionPoints = gridScript.getAttractionPoints(gameObject);
 }
Esempio n. 27
0
 void OnEnable()
 {
     unitInCircle.Clear();
     winnerDrop = false;
 }
Esempio n. 28
0
    // Update is called once per frame
    void Update()
    {
        //if (ActiveState == Gamestate.InGame)
        //{
        //if(battleZone == null)
        //{
        //   // EnterGame();
        //}
        curEnergy = V_PlayerHandler.energy;
        curHealth = V_PlayerHandler.health;

        energyText.text = curEnergy.ToString();
        aiHpText.text   = V_AI.health.ToString() + "/" + maxHealth;
        hpText.text     = curHealth.ToString() + "/" + maxHealth;

        // Check if all players still have sufficient health, but
        // if one doesn't then call the CallGameResult function:
        if (!isGameOver)
        {
            // if the player's base died:
            if (V_PlayerHandler.health == 0)
            {
                isGameOver = true;
                // then AI is the winner:
                CallGameResult(false);
                GameManager.ActiveState = GameManager.Gamestate.Gameover;
                return;
            }
            // if the AI's base died:
            if (V_AI.health == 0)
            {
                isGameOver = true;
                // then player is the winner:
                CallGameResult(true);
            }
        }

        opponentsTurnText.gameObject.SetActive(playerTurn == playerTypes.AI && !isGameOver);
        playersTurnText.gameObject.SetActive(playerTurn == playerTypes.Player && !isGameOver);

        //warloop, can become a switch case to manage all turns parts.
        if (CardGameState == currentState.war)
        {
            int usagecheck = 0;
            if (warentered == false)     //war setup
            {
                GameObject[] objP = GameObject.FindGameObjectsWithTag("PlayerOwned");
                GameObject[] objA = GameObject.FindGameObjectsWithTag("AIOwned");
                //create a list of active cards
                for (int i = 0; i < objA.Length; i++)
                {
                    ActiveCards.Add(objA[i]);
                    if (playerTurn == playerTypes.AI)
                    {
                        objA[i].GetComponent <V_Card>().TEMPspeed += 5;
                    }
                }
                for (int i = 0; i < objP.Length; i++)
                {
                    ActiveCards.Add(objP[i]);
                    if (playerTurn == playerTypes.Player)
                    {
                        objP[i].GetComponent <V_Card>().TEMPspeed += 5;
                    }
                }
                warentered = true;
                //find the first creatures to act...
                foreach (GameObject o in ActiveCards)
                {
                    if (o.GetComponent <V_Card>().speed > activespeed && o.GetComponent <V_Card>().speed < prevspeed)
                    {
                        activespeed = o.GetComponent <V_Card>().speed;
                    }

                    if (o.GetComponent <V_Card>().speed == activespeed && o.GetComponent <V_Card>().actions > 0)
                    {
                        o.GetComponent <V_CardActions>().isActive = true;
                        usagecheck++;
                    }
                    else
                    {
                        o.GetComponent <V_CardActions>().isActive = false;
                    }
                }
                prevspeed = activespeed;
            }
            //now to flow through each round;
            usagecheck = 0;
            foreach (GameObject o in ActiveCards)
            {
                if (o.GetComponent <V_Card>().speed == activespeed && o.GetComponent <V_Card>().actions > 0)
                {
                    o.GetComponent <V_CardActions>().isActive = true;
                    usagecheck++;
                }
                else
                {
                    o.GetComponent <V_CardActions>().isActive = false;
                }
            }
            if (usagecheck <= 0)
            {
                activespeed -= 5;
            }
            if (activespeed <= 0)
            {
                prevspeed = 1000;
                ActiveCards.Clear();
                CardGameState = currentState.end;
            }
        }
        if (CardGameState == currentState.end)
        {
            GameObject[] objP = GameObject.FindGameObjectsWithTag("PlayerOwned");
            GameObject[] objA = GameObject.FindGameObjectsWithTag("AIOwned");
            for (int i = 0; i < objA.Length; i++)
            {
                ActiveCards.Add(objA[i]);
            }
            for (int i = 0; i < objP.Length; i++)
            {
                ActiveCards.Add(objP[i]);
            }
            ActiveCards.Clear();
            //if (playerTurn == playerTypes.AI)
            //{
            //    ChangeTurn(playerTypes.AI);
            //}
            if (playerTurn == playerTypes.Player)
            {
                ChangeTurn(playerTypes.Player);
            }
        }
        //}
    }
Esempio n. 29
0
    public void RefreshWingGridList(System.Collections.Generic.List <WingGridData> dataList)
    {
        for (int i = 0; i < gridList.Count; ++i)
        {
            AssetCacheMgr.ReleaseInstance(gridList[i].gameObject);
        }

        gridList.Clear();
        GetTransform("WingUIListDialogGridList").GetComponent <MogoSingleButtonList>().SingleButtonList.Clear();
        GetTransform("WingUIListDialogGridListCamera").localPosition = new Vector3(0, -166f, 0);

        for (int i = 0; i < dataList.Count; ++i)
        {
            int index = i;
            AssetCacheMgr.GetUIInstance("WingUIListDialogGrid.prefab", (name, id, go) =>
            {
                GameObject gameObj = (GameObject)go;
                MFUIUtils.AttachWidget(gameObj.transform, GetTransform("WingUIListDialogGridList"));
                gameObj.transform.localPosition = new Vector3(0, -112 * index, 0);
                gameObj.GetComponent <MyDragCamera>().RelatedCamera = GetTransform("WingUIListDialogGridListCamera").GetComponent <Camera>();
                GetTransform("WingUIListDialogGridList").GetComponent <MogoSingleButtonList>().SingleButtonList.Add(
                    gameObj.GetComponent <MogoSingleButton>());
                WingUIGrid uigrid = gameObj.AddComponent <WingUIGrid>();
                uigrid.ID         = index;

                WingGridData data = dataList[index];

                if (data.IsHave == false)
                {
                    uigrid.ShowBuyBtn(true);
                    uigrid.ShowUsedSign(false);
                    uigrid.SetWingCost(data.WingPrice);
                    uigrid.SetWingName(data.WingName);
                    uigrid.SetWingStatus(data.WingStatus);
                    uigrid.SetWingDescripte(data.WingDescripe);
                    uigrid.ShowWingLock(false);
                    uigrid.ShowWingProgress(false);
                    uigrid.ShowWingIconBlackWhite(true);
                    uigrid.ShowCost(true);
                }
                else
                {
                    if (data.IsActive == true)
                    {
                        if (data.IsUsing == false)
                        {
                            uigrid.ShowBuyBtn(false);
                            uigrid.ShowUsedSign(false);
                            uigrid.SetWingName(data.WingName);
                            uigrid.SetWingStatus(data.WingStatus);
                            uigrid.SetWingDescripte(data.WingDescripe);
                            uigrid.ShowWingLock(false);
                            //uigrid.ShowWingProgress(false);
                            uigrid.ShowWingProgress(true);
                            uigrid.SetWingProgressText(string.Concat(data.WingCurExp, "/", data.WingTotalExp));
                            uigrid.SetWingProgressSize((float)data.WingCurExp / (float)data.WingTotalExp);
                            uigrid.ShowWingIconBlackWhite(false);
                            uigrid.ShowCost(false);
                        }
                        else
                        {
                            uigrid.ShowBuyBtn(false);
                            uigrid.ShowUsedSign(true);
                            uigrid.SetWingName(data.WingName);
                            uigrid.SetWingStatus(data.WingStatus);
                            uigrid.SetWingDescripte(data.WingDescripe);
                            uigrid.ShowWingLock(false);
                            uigrid.ShowWingProgress(true);
                            uigrid.SetWingProgressText(string.Concat(data.WingCurExp, "/", data.WingTotalExp));
                            uigrid.SetWingProgressSize((float)data.WingCurExp / (float)data.WingTotalExp);
                            uigrid.ShowWingIconBlackWhite(false);
                            uigrid.ShowCost(false);
                        }
                    }
                    else
                    {
                        uigrid.ShowBuyBtn(false);
                        uigrid.ShowUsedSign(false);
                        uigrid.SetWingName(data.WingName);
                        uigrid.SetWingStatus(data.WingStatus);
                        uigrid.SetWingDescripte(data.WingDescripe);
                        uigrid.ShowWingLock(true);
                        uigrid.ShowWingProgress(false);
                        uigrid.ShowWingIconBlackWhite(false);
                        uigrid.ShowCost(false);
                    }
                }


                if (dataList.Count <= 4)
                {
                    GetTransform("WingUIListDialogGridListCamera").GetComponent <MyDragableCamera>().MINY =
                        -166f;
                }
                else
                {
                    GetTransform("WingUIListDialogGridListCamera").GetComponent <MyDragableCamera>().MINY =
                        -166f - (dataList.Count - 4) * 112f;
                }

                gridList.Add(gameObj);
            });
        }
    }
Esempio n. 30
0
 public void Clear()
 {
     messages.Clear();
 }