Exemplo n.º 1
0
    private bool CheckAvaliablity(Ability action)
    {
        Unit unit = action.m_Owner;

        if (unit == null)
        {
            Debug.Log("Not a real unit");
            return(false);
        }
        else if (unit.m_Position.m_Block == null)
        {
            GameMessage.Instance.Display(Text_NotOnBoard.ToString());
            return(false);
        }
        else if (!unit.PlayerControl())
        {
            GameMessage.Instance.Display(Text_CantControl.ToString());
            return(false);
        }
        else if (action.m_CurrentCD > 0)
        {
            GameMessage.Instance.Display(Text_Cooldown.ToString());
            return(false);
        }
        else if (action.m_ManaCost > 0)
        {
            Player player = PlayerManager.Instance.GetPlayer(unit.m_PlayerID);
            if (action.m_ManaCost > player.m_Mana.currentMana)
            {
                GameMessage.Instance.Display(Text_Mana.ToString());
                return(false);
            }
        }
        return(true);
    }
Exemplo n.º 2
0
    public void Show()
    {
        m_Label.text = m_LabelText.ToString();

        gameObject.SetActive(true);
        callback = null;
    }
Exemplo n.º 3
0
    private void ShowInfo()
    {
        m_ActionMessage.Display(Text_Confirm.ToString());

        m_ConfirmButton.Show();
        m_ConfirmButton.callback += Confirm;

        m_Action.HighlightInfo();
    }
Exemplo n.º 4
0
 public virtual string GetDescription()
 {
     if (m_Description != null)
     {
         return(m_Description.ToString());
     }
     else
     {
         return("");
     }
 }
        public void GameStart()
        {
            if (m_DeckDisplay.Warning.activeSelf)
            {
                GameMessage.Instance.Display(m_Text.ToString());
            }
            else
            {
                m_GameData.playerId = PlayerID.Player1;
                m_GameData.decks[0] = m_DeckDisplay.deck;
                m_GameData.decks[1] = m_EnemyDecks.GetDeck();

                UnityEngine.SceneManagement.SceneManager.LoadScene(m_SceneIndex);
            }
        }
    protected override void TriggerEnterEvent()
    {
        TooltipData data = new TooltipData();

        if (m_text == null)
        {
            data.m_Message = m_Tooltip;
        }
        else
        {
            data.m_Message = m_text.ToString();
        }

        data.m_Switch = true;

        m_Event.Trigger(data);
    }
    private void ChangeTootltip(UnitStatsProperty statsProperty)
    {
        //Debug.Log("Change Tooltip");
        if (tooltip == null)
        {
            return;
        }

        TextProperty tip = StatsDisplayReference.Instance.tooltipList[(int)statsProperty];

        if (tip == null)
        {
            tooltip.enabled = false;
        }
        else
        {
            tooltip.enabled   = true;
            tooltip.m_Tooltip = tip.ToString();
        }
    }
Exemplo n.º 8
0
    IEnumerator GetPlayerChoice()
    {
        m_PlayerSelect.m_Num     = 1;
        m_PlayerSelect.m_Message = m_Message.ToString();
        m_PlayerSelect.GetInfo(Cancel);

        while (!m_PlayerSelect.m_Done)
        {
            yield return(new WaitForSeconds(.1f));
        }

        if (m_PlayerSelect.m_selectedCardPreviewList.Count > 0)
        {
            Summon();
        }

        HideWindow();

        ExitPhase();
    }
    void Display(GameEventData data)
    {
        if (data == null)
        {
            gameObject.SetActive(true);
            text.text = endText.ToString();
        }
        else
        {
            SingleUnitData unitData = data.CastDataType <SingleUnitData>();
            if (unitData == null)
            {
                return;
            }

            PlayerID loseId = unitData.m_Unit.m_PlayerID;

            TextProperty word = loseId == PlayerManager.Instance.GetLocalPlayerID() ? loseText : winText;

            gameObject.SetActive(true);
            text.text = word.ToString();
        }
    }
Exemplo n.º 10
0
    public void Trigger(GameEventData eventData)
    {
        if (busy)
        {
            return;
        }

        data = eventData.CastDataType <RankUpData>();
        if (data == null)
        {
            return;
        }

        //Debug.Log("Receive");

        List <RankUpCondition> conditions = RankUpManagerCheckPhase.GetAllConditions(data.data1, data.data2, data.block);

        if (conditions.Count <= 0)
        {
            GameMessage.Instance.Display(Text_NoOption.ToString());
            return;
        }

        //Debug.Log("Get Choice");
        //foreach(RankUpCondition rankUpCondition in conditions)
        //{
        //    Debug.Log("\t" + rankUpCondition.name);
        //}

        EnterPhase();

        DisplayOptions(conditions);

        coroutine = GetPlayerChoice();
        StartCoroutine(coroutine);
    }
Exemplo n.º 11
0
        public MarqueeLabel setTextProperty(TextProperty attr, object o)
        {
            Subtitle sub = Prop as Subtitle;

            Console.WriteLine("set " + attr.ToString() + " => " + o);
            Font f = Mlabel.Font;

            switch (attr)
            {
            case TextProperty.FontName:
                sub.fontname = (string)o;

                //System.Drawing.Text.PrivateFontCollection privateFonts = new System.Drawing.Text.PrivateFontCollection();
                //string fn = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ttf", sub.fontname);
                //Console.WriteLine("font ==> " + fn );
                //privateFonts.AddFontFile(fn );
                //System.Drawing.Font font = new Font(privateFonts.Families[0], 12);

                Mlabel.Font = new Font(FontEx.getFontFamily(sub.fontname), f.Size, f.Style);
                break;

            case TextProperty.FontSize:
                sub.fontsize = (int)(o);
                Mlabel.Font  = new Font(f.Name, sub.fontsize / 2, f.Style | FontStyle.Regular);
                break;

            case TextProperty.Bold:
                sub.bold = (bool)o;
                if (sub.bold)
                {
                    Mlabel.Font = new Font(f.FontFamily, f.Size, f.Style | FontStyle.Bold);
                }
                else
                {
                    Mlabel.Font = new Font(f.FontFamily, f.Size, f.Style & ~FontStyle.Bold);
                }
                break;

            case TextProperty.Italic:
                sub.italic = (bool)o;
                if (sub.italic)
                {
                    Mlabel.Font = new Font(f.FontFamily, f.Size, f.Style | FontStyle.Italic);
                }
                else
                {
                    Mlabel.Font = new Font(f.FontFamily, f.Size, f.Style & ~FontStyle.Italic);
                }
                break;

            case TextProperty.Underline:
                sub.underline = (bool)o;
                if (sub.underline)
                {
                    Mlabel.Font = new Font(f.FontFamily, f.Size, f.Style | FontStyle.Underline);
                }
                else
                {
                    Mlabel.Font = new Font(f.FontFamily, f.Size, f.Style & ~FontStyle.Underline);
                }
                break;

            case TextProperty.Direction:
                lastDirection    = sub.direction = (Direction)o;
                Mlabel.direction = sub.direction;
                break;

            case TextProperty.Speed:
                sub.speed    = (int)o;
                Mlabel.Speed = sub.speed;
                if (sub.speed == 0)
                {
                    sub.direction    = Direction.Static;
                    Mlabel.direction = sub.direction;
                }
                else
                {
                    setTextProperty(TextProperty.Direction, lastDirection);
                }
                break;

            case TextProperty.Text:
                sub.text    = (string)o;
                Mlabel.Text = sub.text;
                break;

            case TextProperty.FontColor:
                Mlabel.ForeColor = (Color)o;
                sub.fontcolor    = ColorEx.ColorToHex(Mlabel.ForeColor);
                break;

            case TextProperty.BackColor:
                Mlabel.BackColor = (Color)o;
                sub.backcolor    = ColorEx.ColorToHex(Mlabel.BackColor);
                sub.transparent  = false;
                if (Mlabel.BackColor == Color.Transparent)
                {
                    sub.transparent = true;
                    sub.backcolor   = "#null";
                }
                break;

            default:
                break;
            }

            //sub.BackColor = ColorTranslator.FromHtml(txtAttr.Bgcolor);
            //sub.ForeColor = ColorTranslator.FromHtml(txtAttr.Color);
            //mlabel.BackColor = Color.Transparent;
            // mlabel.Text = "谁的手机发斯里兰卡哗啦哗啦就好了";
            //sub.Direction = txtAttr.Direction;
            //sub.Speed = txtAttr.Speed;
            //int x = ToFormX(txtAttr.X);
            //int y = ToFormY(txtAttr.Y);
            //sub.Location = new Point(x, y);
            // mlabel.Width = (int)base.Path.GetBounds().Width;
            // mlabel.Height = (int)base.Path.GetBounds().Height;
            //sub.X = txtAttr.X;
            //sub.Y = txtAttr.Y;
            //sub.W = txtAttr.W;
            //sub.H = txtAttr.H;
            //sub.fontname = txtAttr.Fontname;
            //sub.fontsize = txtAttr.Fontsize;
            //sub.transparent = txtAttr.Transparent;
            //sub.Font = new Font("宋体", float.Parse(txtAttr.Fontsize), FontStyle.Regular);
            // mlabel.Location = new Point((int)(base.Path.GetBounds().Location.X), (int)(base.Path.GetBounds().Location.Y));

            return(Mlabel);
        }
Exemplo n.º 12
0
 public virtual void Start()
 {
     m_DrawCardComponent = new DeckDrawCard(this, m_PlayerSelect, m_DisplayCardOptionEvent, message.ToString());
 }
Exemplo n.º 13
0
 public void ChangeLanguage(int index)
 {
     PlayerPrefs.SetInt(AllText.PrefLanguageKey, index);
     Debug.Log(GameMessage.Instance);
     GameMessage.Instance.Display(m_Text.ToString());
 }