Esempio n. 1
0
        private void DecideUnitRandom(bool notice = false, bool spaceOnly = false)
        {
            if (!VersusDraftList.VersusDraftTurnOwn)
            {
                return;
            }
            int num = this.SelectableUnitCount;

            if (spaceOnly)
            {
                num = this.SelectableUnitCount - VersusDraftUnit.CurrentSelectCursors.FindAll((Predicate <VersusDraftUnit>)(u => UnityEngine.Object.op_Inequality((UnityEngine.Object)u, (UnityEngine.Object)null))).Count;
            }
            for (int index = 0; index < num; ++index)
            {
                VersusDraftUnit randomUnit = this.GetRandomUnit();
                if (UnityEngine.Object.op_Equality((UnityEngine.Object)randomUnit, (UnityEngine.Object)null))
                {
                    return;
                }
                randomUnit.SelectUnit(true);
            }
            if (!notice)
            {
                return;
            }
            this.SelectUnit();
        }
Esempio n. 2
0
        private void UpdateSingleMode()
        {
            if (!this.mSingleMode)
            {
                List <MyPhoton.MyPlayer> roomPlayerList = PunMonoSingleton <MyPhoton> .Instance.GetRoomPlayerList();

                if (roomPlayerList != null && roomPlayerList.Count >= 2)
                {
                    return;
                }
                this.mSingleMode = true;
            }
            else
            {
                if (VersusDraftList.VersusDraftTurnOwn)
                {
                    return;
                }
                this.mEnemyTimer += Time.get_unscaledDeltaTime();
                if ((double)this.mEnemyTimer < 5.0)
                {
                    return;
                }
                this.mEnemyTimer = 0.0f;
                for (int index = 0; index < this.SelectableUnitCount; ++index)
                {
                    VersusDraftUnit randomUnit = this.GetRandomUnit();
                    if (UnityEngine.Object.op_Equality((UnityEngine.Object)randomUnit, (UnityEngine.Object)null))
                    {
                        return;
                    }
                    randomUnit.SelectUnit(false);
                    randomUnit.DecideUnit(false);
                    ++this.mEnemyUnitIndex;
                }
                this.ChangeTurn(true);
            }
        }