Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (m_HandArea != null)
        {
            for (int idx = 0; idx < m_HandArea.getCardMaxCount(); idx++)
            {
                BattleScene.BattleCard battle_card = m_HandArea.getCard(idx);
                if (battle_card != null)
                {
                    if (battle_card.getChangeCause() == BattleScene.BattleCard.ChangeCause.NEW_CARD)
                    {
                        battle_card.resetChageCause();
                        battle_card.setPhase(BattleScene.BattleCard.Phase.HAND_AREA);
                        battle_card.m_ViewControl.transform.SetParent(getBattleCardTransform(idx, TransformType.NEXT_AREA), false);
                        battle_card.m_ViewControl.transform.localPosition = Vector3.zero;
                        battle_card.m_ViewControl.transform.localRotation = Quaternion.identity;
                        battle_card.m_ViewControl.transform.localScale    = Vector3.one;
                    }

                    if (battle_card.isChangePhase())
                    {
                        float hold_time = battle_card.m_HoldMoveTime;
                        battle_card.resetChangePhase();
                        battle_card.m_ViewControl.gameObject.SetActive(true);
                        battle_card.m_ViewControl.setSnapToParent(getBattleCardTransform(idx, TransformType.HAND_AREA), 0.1f, hold_time);
                    }
                }
            }
        }

        if (m_NextArea != null)
        {
            for (int idx = 0; idx < m_NextArea.getCardMaxCount(); idx++)
            {
                BattleScene.BattleCard battle_card = m_NextArea.getCard(idx);
                if (battle_card != null)
                {
                    if (battle_card.getChangeCause() == BattleScene.BattleCard.ChangeCause.NEW_CARD)
                    {
                        battle_card.resetChageCause();
                        battle_card.setPhase(BattleScene.BattleCard.Phase.NEXT_AREA);
                        battle_card.m_ViewControl.transform.SetParent(getBattleCardTransform(idx, TransformType.APPEAR_AREA), false);
                        battle_card.m_ViewControl.transform.localPosition = Vector3.zero;
                        battle_card.m_ViewControl.transform.localRotation = Quaternion.identity;
                        battle_card.m_ViewControl.transform.localScale    = Vector3.one;
                    }

                    if (battle_card.isChangePhase())
                    {
                        battle_card.resetChangePhase();
                        battle_card.m_ViewControl.gameObject.SetActive(true);
                        battle_card.m_ViewControl.setSnapToParent(getBattleCardTransform(idx, TransformType.NEXT_AREA), 0.1f);
                    }
                }
            }
        }
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        if (m_InHandArea != null)
        {
            float   hand_z = BattleTouchInput.Instance.getScreenPosition(transform.position).z;
            Vector3 hand_world_position = BattleTouchInput.Instance.getWorldPosition(hand_z);
            m_InHandObject.transform.position = hand_world_position;

            for (int card_idx = 0; card_idx < m_InHandArea.getCardCount(); card_idx++)
            {
                BattleScene.BattleCard battle_card = m_InHandArea.getCard(card_idx);
                if (battle_card != null)
                {
                    if (battle_card.isChangePhase())
                    {
                        battle_card.resetChangePhase();
                        battle_card.m_ViewControl.gameObject.SetActive(true);
                        battle_card.m_ViewControl.setSnapToParent(getBattleCardTransform(card_idx), 0.0f);
                    }
                }
            }
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (m_FieldAreas != null)
        {
            bool is_update_field_view = false;

            // 復活可能かどうか更新
            if (m_FieldAreas.m_IsResurrectMode != m_IsResurrectMode)
            {
                m_IsResurrectMode    = m_FieldAreas.m_IsResurrectMode;
                is_update_field_view = false;
            }

            // 定期的更新の確認
            m_BasePanelUpdateCounter--;
            if (m_BasePanelUpdateCounter <= 0)
            {
                is_update_field_view = true;
            }

            // BOOST・FULLが更新されたかを更新
            if (is_update_field_view == false)
            {
                for (int field_idx = 0; field_idx < m_FieldAreas.getFieldAreaCountMax(); field_idx++)
                {
                    FieldArea field_area = m_FieldAreas.getFieldArea(field_idx);
                    if (field_area != null)
                    {
                        if (m_ViewObjects[field_idx].m_Boost.IsActive() != field_area.m_IsBoost ||
                            m_ViewObjects[field_idx].m_Full.IsActive() != field_area.isFull()
                            )
                        {
                            is_update_field_view = true;
                            break;
                        }
                    }
                }
            }

            if (is_update_field_view)
            {
                m_BasePanelUpdateCounter = 30;
            }

            for (int field_idx = 0; field_idx < m_FieldAreas.getFieldAreaCountMax(); field_idx++)
            {
                FieldArea field_area = m_FieldAreas.getFieldArea(field_idx);
                if (field_area != null)
                {
                    // カード表示を更新
                    for (int card_idx = 0; card_idx < field_area.getCardCount(); card_idx++)
                    {
                        BattleScene.BattleCard battle_card = field_area.getCard(card_idx);
                        if (battle_card != null)
                        {
                            if (battle_card.isChangePhase())
                            {
                                battle_card.resetChangePhase();
                                float duration = 0.05f;
                                if (battle_card.m_ViewControl.gameObject.IsActive() == false)
                                {
                                    battle_card.m_ViewControl.gameObject.SetActive(true);
                                    duration = 0.0f;
                                }
                                battle_card.m_ViewControl.setSnapToParent(getBattleCardTransform(field_idx, card_idx), duration);
                            }
                        }
                    }

                    // 下地パネル・BOOST・FULL表示を更新
                    if (is_update_field_view)
                    {
                        if (m_SelectedField != field_idx)
                        {
                            if (m_IsResurrectMode &&
                                field_area.m_IsBoost
                                )
                            {
                                m_ViewObjects[field_idx].m_PanelBase.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelSelect.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelRBase.SetActive(true);
                                m_ViewObjects[field_idx].m_PanelRSelect.SetActive(false);
                            }
                            else
                            {
                                m_ViewObjects[field_idx].m_PanelBase.SetActive(true);
                                m_ViewObjects[field_idx].m_PanelSelect.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelRBase.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelRSelect.SetActive(false);
                            }
                        }
                        else
                        {
                            if (m_IsResurrectMode &&
                                field_area.m_IsBoost
                                )
                            {
                                m_ViewObjects[field_idx].m_PanelBase.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelSelect.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelRBase.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelRSelect.SetActive(true);
                            }
                            else
                            {
                                m_ViewObjects[field_idx].m_PanelBase.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelSelect.SetActive(true);
                                m_ViewObjects[field_idx].m_PanelRBase.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelRSelect.SetActive(false);
                            }
                        }

                        m_ViewObjects[field_idx].m_Boost.SetActive(field_area.m_IsBoost);
                        m_ViewObjects[field_idx].m_Full.SetActive(field_area.isFull());
                    }
                }
            }
        }
    }