Esempio n. 1
0
    public void jump(int hp, int mp, GameSkillResutlType type, GameSkillOtherEffect otherType, OnEventOver over)
    {
        clear();

        gameObject.SetActive(true);

        onEventOver = over;

        jumpCount = 0;

        RectTransform trans = GetComponent <RectTransform>();

        position = trans.anchoredPosition;

        string str = GameDefine.getBigInt(hp.ToString());

        if (mp != 0)
        {
            str = GameDefine.getBigInt(mp.ToString());
        }

        float ox = 6.0f * str.Length / 2.0f;

        for (int i = 0; i < str.Length; i++)
        {
            GameObject obj = Instantiate <GameObject>(Resources.Load <GameObject>("Prefab/TextUI"));

            trans = obj.GetComponent <RectTransform>();
            trans.SetParent(transform);
            trans.anchoredPosition = new Vector2(-ox + i * 6.0f, 0.0f);
            trans.localScale       = new Vector3(0.5f, 0.5f, 0.5f);

            GameBattleJumpHPUIText jumpText = obj.GetComponent <GameBattleJumpHPUIText>();
            jumpText.jump(-i * 0.1f, onJumpOver);

            Text text = obj.GetComponent <Text>();
            text.text = str.Substring(i, 1);

            if (type == GameSkillResutlType.Cure ||
                otherType == GameSkillOtherEffect.HealAll)
            {
                text.color = new Color(0.0f, 1.0f, 0.0f);
            }

            if (hp < 0 || mp < 0)
            {
                text.color = new Color(0.0f, 1.0f, 0.0f);
            }

            if (mp > 0)
            {
                text.color = new Color(0.0f, 0.9f, 1.0f);
            }

            objs.Add(obj);
        }
    }
Esempio n. 2
0
    public bool checkEffectOther(GameSkillOtherEffect e)
    {
        for (int i = 0; i < effects.Count; i++)
        {
            if (effects[i].OtherEffect == e)
            {
                return(true);
            }
        }

        return(false);
    }