Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (m_BattleCard != null)
        {
            if (m_BattleCard.getPhase() == BattleScene.BattleCard.Phase.UNUSED)
            {
                m_ElementType = MasterDataDefineLabel.ElementType.NONE;
                m_IsOn        = false;
            }

            if (m_BattleCard.getElementType() != m_ElementType ||
                m_BattleCard.m_IsOn != m_IsOn
                )
            {
                _updateSprite();
            }

#if BUILD_TYPE_DEBUG
            if (m_BattleCard.getPhase() != BattleScene.BattleCard.Phase.UNUSED)
            {
                // 開発中はエラーであることをわかりやすくするための表示
                if (m_ElementType <= MasterDataDefineLabel.ElementType.NONE || m_ElementType >= MasterDataDefineLabel.ElementType.MAX)
                {
                    m_SpriteRenderer.enabled = true;
                    m_SpriteRenderer.sprite  = m_SpritesOff[RandManager.GetRand(1, 7)];
                }
            }
#endif
        }

        // カード配りアニメーション
        if (m_AnimWait > 0.0f)
        {
            const float ANIM_TIME = 0.1f;
            m_AnimWait -= Time.deltaTime;
            if (m_AnimWait > ANIM_TIME)
            {
                m_SpriteRenderer.enabled = false;
                transform.localPosition  = Vector3.zero;
                transform.localRotation  = Quaternion.Euler(new Vector3(0.0f, 90.0f, 0.0f));
            }
            else
            if (m_AnimWait > 0.0f)
            {
                m_SpriteRenderer.enabled = true;
                transform.localPosition  = new Vector3(0.0f, 0.0f, -1.0f * (1.0f - m_AnimWait / ANIM_TIME));
                transform.localRotation  = Quaternion.Euler(new Vector3(0.0f, 90.0f * (m_AnimWait / ANIM_TIME), 0.0f));
            }
            else
            {
                m_AnimWait = 0.0f;
                m_SpriteRenderer.enabled = true;
                transform.localPosition  = Vector3.zero;
                transform.localRotation  = Quaternion.Euler(new Vector3(0.0f, 0.0f, 0.0f));
            }
        }

        m_MyTween.update(Time.deltaTime);
    }
Ejemplo n.º 2
0
        /// <summary>
        /// プールの中から未使用カードを取得
        /// </summary>
        /// <returns></returns>
        public BattleCard getUnusedCard()
        {
            for (int idx = 0; idx < m_BattleCards.Length; idx++)
            {
                BattleCard battle_card = m_BattleCards[idx];
                if (battle_card.getPhase() == BattleCard.Phase.UNUSED)
                {
                    return(battle_card);
                }
            }

            return(null);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 場などからカードを取り省く
        /// </summary>
        /// <param name="battle_card"></param>
        /// <param name="is_unuse_card"></param>
        public void removeCard(BattleCard battle_card, bool is_unuse_card)
        {
            switch (battle_card.getPhase())
            {
            case BattleCard.Phase.NEXT_AREA:
                m_NextArea.removeCard(battle_card, is_unuse_card);
                break;

            case BattleCard.Phase.HAND_AREA:
                m_HandArea.removeCard(battle_card, is_unuse_card);
                break;

            case BattleCard.Phase.IN_HAND:
                m_InHandArea.removeCard(battle_card, is_unuse_card);
                break;

            case BattleCard.Phase.FIELD_AREA:
                m_FieldAreas.removeCard(battle_card, is_unuse_card);
                break;
            }
        }