コード例 #1
0
    private IEnumerator SpawnEnemy()
    {
        yield return(new WaitForSeconds(spawnDelay));

        int       i             = Random.Range(0, EnemyPrefabs.Length);
        EnemyBase enemy         = Instantiate(EnemyPrefabs[i]);
        Vector2   spawnLocation = new Vector2();

        switch (enemy.Type)
        {
        case EnemyBase.EnemyTypes.Undefined:
            spawnLocation.x = maxX / 2f;
            spawnLocation.y = (maxY - minY) / 2f;
            break;

        case EnemyBase.EnemyTypes.Ground:
            spawnLocation.x = maxX / 2f;
            spawnLocation.y = minY;
            break;

        case EnemyBase.EnemyTypes.Air:
            spawnLocation.x = Random.Range(minX, maxX);
            spawnLocation.y = Random.Range(minY, maxY);
            break;

        default:
            break;
        }

        enemy.Spawn(spawnLocation);
        ArenaUI.SetEnemyName(enemy.GetType().ToString());

        enemy.OnDeath += EnemyDefeated;
    }
コード例 #2
0
 public void IsOPenArena()
 {
     if (openPvE)
     {
         ArenaUI.SwithShowMe();
     }
     if (openPvP)
     {
         ArenaPvpPanelUI.SwithShowMe();
         //NetConnection.Instance.requestpvprank();
     }
 }
コード例 #3
0
ファイル: ToolTip.cs プロジェクト: behindcurtain3/TheArena
        public override void Update(ArenaUI hud, GameTime dt, InputState input)
        {
            if (Parent == null || Text == null || Text.Equals(String.Empty))
                return;

            if (Parent.IsMouseOver)
            {
                _durationOfMouseOver += dt.ElapsedGameTime.Milliseconds;

                if(FlavorText != null && !FlavorText.Equals(String.Empty))
                    _durationOfFlavor += dt.ElapsedGameTime.Milliseconds;

                if (_durationOfMouseOver >= _mouseOverDelay)
                    Visible = true;

                if (_durationOfFlavor >= _mouseOverFlavorDelay)
                    _showFlavorText = true;
            }
            else
            {
                Visible = false;
                _durationOfMouseOver = 0;

                _showFlavorText = false;
                _durationOfFlavor = 0;
            }

            _mousePosition.X = input.CurrentMouseState.X;
            _mousePosition.Y = input.CurrentMouseState.Y;

            int width;
            int height;

            if (_showFlavorText)
            {
                width = Math.Max((int)Font.MeasureString(Text).X, (int)FlavorFont.MeasureString(FlavorText).X);
                width = Math.Max(100, width + FrameLeft + FrameRight + PaddingLeft + PaddingRight);

                height = Math.Max(15, (int)Font.MeasureString(Text).Y + (int)FlavorFont.MeasureString(FlavorText).Y + 4 + PaddingTop + PaddingBottom + FrameTop + FrameBottom);
            }
            else
            {
                width = Math.Max(100, (int)Font.MeasureString(Text).X + 20);
                height = Math.Max(15, (int)Font.MeasureString(Text).Y + PaddingTop + PaddingBottom + FrameTop + FrameBottom);
            }

            Position = new Rectangle((int)_mousePosition.X + 10, (int)_mousePosition.Y, width, height);
        }
コード例 #4
0
 private void OnPve(ButtonScript obj, object args, int param1, int param2)
 {
     if (TeamSystem.MemberCount > 0)
     {
         //ErrorTipsUI.ShowMe(LanguageManager.instance.GetValue("teamnopve"));
         PopText.Instance.Show(LanguageManager.instance.GetValue("teamnopve"));
         return;
     }
     if (!GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_JJC))
     {
         //ErrorTipsUI.ShowMe(LanguageManager.instance.GetValue("cannotopen"));
         PopText.Instance.Show(LanguageManager.instance.GetValue("cannotopen"));
         return;
     }
     ArenaUI.SwithShowMe();
 }
コード例 #5
0
    private void OnChallengeBtn(ButtonScript obj, object args, int param1, int param2)
    {
        if (ArenaSystem.Instance.ChallengeNum <= 0)
        {
            //ErrorTipsUI.ShowMe( LanguageManager.instance.GetValue("ChallengeNum"));
            PopText.Instance.Show(LanguageManager.instance.GetValue("ChallengeNum"));
            return;
        }
        if (ArenaSystem.Instance.RemainCDTime > 0)
        {
            //ErrorTipsUI.ShowMe( LanguageManager.instance.GetValue("RemainCDTime"));
            PopText.Instance.Show(LanguageManager.instance.GetValue("RemainCDTime"));
            return;
        }
        COM_SimplePlayerInst[] team = TeamSystem.GetTeamMembers();
        if (team != null && team.Length > 0)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("zhuduibuxing"));
            return;
        }

        NetConnection.Instance.requestChallenge(_player.name_);
        ArenaUI.HideMe();
    }
コード例 #6
0
 void OnJJC(GameObject go)
 {
     ArenaUI.SwithShowMe();
 }
コード例 #7
0
ファイル: Component.cs プロジェクト: behindcurtain3/TheArena
        public virtual void Update(ArenaUI hud, GameTime dt, InputState input)
        {
            foreach (Component child in Children)
                child.Update(hud, dt, input);

            if (ToolTip != null && Enabled)
                ToolTip.Update(hud, dt, input);
        }
コード例 #8
0
ファイル: Component.cs プロジェクト: behindcurtain3/TheArena
        public virtual void InjectMouseUp(ArenaUI hud, MouseState mouse)
        {
            if (onMouseUp != null && Enabled)
                onMouseUp(this, mouse);

            IsMouseDown = false;
        }
コード例 #9
0
ファイル: Component.cs プロジェクト: behindcurtain3/TheArena
        public virtual void InjectMouseOver(ArenaUI hud, MouseState mouse)
        {
            if (onMouseOver != null && Enabled)
                onMouseOver(this, mouse);

            IsMouseOver = true;
        }
コード例 #10
0
ファイル: Component.cs プロジェクト: behindcurtain3/TheArena
        public virtual void InjectMouseOut(ArenaUI hud, MouseState mouse)
        {
            if (onMouseOut != null && Enabled)
                onMouseOut(this, mouse);

            IsMouseOver = false;
        }
コード例 #11
0
ファイル: Component.cs プロジェクト: behindcurtain3/TheArena
 public virtual void InjectMouseMove(ArenaUI hud, MouseState mouse)
 {
     if (onMouseMove != null && Enabled)
         onMouseMove(this, mouse);
 }
コード例 #12
0
ファイル: Component.cs プロジェクト: behindcurtain3/TheArena
        public virtual void InjectMouseDown(ArenaUI hud, MouseState mouse)
        {
            if (onMouseDown != null && Enabled)
                onMouseDown(this, mouse);

            IsMouseDown = true;
        }
コード例 #13
0
ファイル: Component.cs プロジェクト: behindcurtain3/TheArena
 public virtual void InjectDragEnd(ArenaUI hud, MouseState mouse)
 {
     if (onDragEnd != null && Moveable && Enabled)
         onDragEnd(this, mouse);
 }
コード例 #14
0
 private void Start()
 {
     ArenaUI.SetEnemyName("spawning...");
     CalculateBounds();
     StartCoroutine(SpawnEnemy());
 }
コード例 #15
0
 // Use this for initialization
 void Awake()
 {
     instance = this;
 }
コード例 #16
0
    public void NpcOpenUI(UIASSETS_ID id)
    {
        switch (id)
        {
        case UIASSETS_ID.UIASSETS__BabySkillLearning:
            BabySkillLearning.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_ProfessionPanel:
            ProfessionPanel.SwithShowMe();
            //UIBase.AsyncLoad(UIASSETS_ID.UIASSETS_ProfessionPanel);
            break;

        case UIASSETS_ID.UIASSETS_ExchangePanel:
            Exchange.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS__LearningUI:
            if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Bar))
            {
                LearningUI.SwithShowMe();
            }
            break;

        case UIASSETS_ID.UIASSETS_FamilyPanel:
            FamilyPanelUI.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_FamilinfoPanel:
            MyFamilyInfo.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_FamilShopPanel:
            FamilyShopUI.SwithShowMe(true);
            break;

        case UIASSETS_ID.UIASSETS__StoreUI:
            if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Shop))
            {
                StoreUI.SwithShowMe(2);
            }
            break;

        case UIASSETS_ID.UIASSETS__Arena:
            if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_JJC))
            {
                ArenaUI.SwithShowMe();
            }
            else
            {
                int level = 0;
                GlobalValue.Get(Constant.C_PVPJJCOpenlevel, out level);
                if (GamePlayer.Instance.GetIprop(PropertyType.PT_Level) < level)
                {
                    PopText.Instance.Show(LanguageManager.instance.GetValue("EN_OpenBaoXiangLevel"));
                    return;
                }
            }
            break;

        case UIASSETS_ID.UIASSETS_ArenaPvpPanel:
            if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_PVPJJC))
            {
                bool isOpen = ActivitySystem.Instance.GetInfoState(7) == ActivitySystem.ActivityInfo.ActivityState.AS_Open;
                if (!isOpen)
                {
                    PopText.Instance.Show(LanguageManager.instance.GetValue("jjcmeikai"));
                    return;
                }

                if (TeamSystem.IsInTeam())
                {
                    if (!TeamSystem.IsTeamLeader())
                    {
                        PopText.Instance.Show(LanguageManager.instance.GetValue("teamopen"));
                        return;
                    }

                    COM_SimplePlayerInst[] team = TeamSystem.GetTeamMembers();
                    if (team == null || team.Length < 3)
                    {
                        PopText.Instance.Show(LanguageManager.instance.GetValue("arenapvpnum"));
                        return;
                    }
                    if (team != null && team.Length > 0)
                    {
                        for (int i = 0; i < team.Length; i++)
                        {
                            if (team[i].isLeavingTeam_)
                            {
                                PopText.Instance.Show(LanguageManager.instance.GetValue("teamMemberLeavingNoopen"));
                                return;
                            }
                        }

                        int level = 0;
                        GlobalValue.Get(Constant.C_PVPJJCOpenlevel, out level);
                        for (int i = 0; i < team.Length; i++)
                        {
                            if (team[i].properties_[(int)PropertyType.PT_Level] < level)
                            {
                                PopText.Instance.Show(LanguageManager.instance.GetValue("duiyuandengji"));
                                return;
                            }
                        }
                    }
                }
                else
                {
                    PopText.Instance.Show(LanguageManager.instance.GetValue("pvpzudui"));
                    return;
                }

                NetConnection.Instance.joinWarriorchoose();

                //NetConnection.Instance.requestpvprank();
                //NetConnection.Instance.requestMyJJCTeamMsg();
                //ArenaPvpPanelUI.SwithShowMe();
            }
            else
            {
                int level = 0;
                GlobalValue.Get(Constant.C_PVPJJCOpenlevel, out level);
                if (GamePlayer.Instance.GetIprop(PropertyType.PT_Level) < level)
                {
                    PopText.Instance.Show(LanguageManager.instance.GetValue("EN_OpenBaoXiangLevel"));
                    return;
                }
            }
            break;

        case UIASSETS_ID.UIASSETS__WordMapUI:
            WorldMap.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_GatherPanel:
            SkillViewUI.SwithShowMe(1);
            break;

        case UIASSETS_ID.UIASSETS_AuctionHousePanel:
            if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_AuctionHouse))
            {
                if (AuctionHouseSystem.Open_ == false)
                {
                    PopText.Instance.Show(LanguageManager.instance.GetValue("AuctionHouseClosed"), PopText.WarningType.WT_Warning);
                    return;
                }
                AuctionHousePanel.SwithShowMe();
            }
            break;

        case UIASSETS_ID.UIASSETS_HundredUI:
            if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Hundred))
            {
                HundredUI.SwithShowMe();
            }
            break;

        case UIASSETS_ID.UIASSETS_EmailPanel:
            EmailUI.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_LookchiPanel:
            LookTreeUI.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_PetTemple:
            PetTemple.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_FanilyBank:
            FanilyBankUI.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_FamilyCollection:
            FamilyCollectionUI.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_GuildBattlePanel:
            GuildBattleEnterScene.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_FamilyMonster:
        {
            if (FamilySystem.instance.GuildMember != null && (int)GuildSystem.GetGuildMemberSelf((int)GamePlayer.Instance.InstId).job_ >= (int)GuildJob.GJ_VicePremier)
            {
                FamilyMonsterUI.SwithShowMe();
            }
            else
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("EN_CommandPositionLess"));
            }
        }
        break;

        case UIASSETS_ID.UIASSETS_CopyOpenPanel:
            CopyOpenUI.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_EmployeeTask:
            NetConnection.Instance.requestEmployeeQuest();
            break;

        case UIASSETS_ID.UIASSETS_EquipUIPanel:
            EquipUIPanel.SwithShowMe();
            break;
        }
    }