// Use this for initialization
    void Start()
    {
        Decision_text   = GameTextUtil.GetText("common_button7");
        Hero_select_msg = GameTextUtil.GetText("mastr_select");

        if (SafeAreaControl.HasInstance)
        {
            SafeAreaControl.Instance.enebleMask(m_TopMask, m_BottomMask);

            int bottom_space_height = SafeAreaControl.Instance.bottom_space_height;
            int bar_height          = SafeAreaControl.Instance.bar_height;
            if (bottom_space_height > 0)
            {
                int space = bottom_space_height + bar_height;

                RectTransform rect = m_BottomMask.GetComponent <RectTransform>();
                rect.AddLocalPositionY(space * -1);

                rect           = GetComponent <RectTransform>();
                rect.offsetMin = new Vector2(rect.offsetMin.x, rect.offsetMin.y + space);

                rect = m_BackGround.GetComponent <RectTransform>();
                rect.AddLocalPositionY((space / 2) * -1);

                rect           = m_HeroSelect.GetComponent <RectTransform>();
                rect.sizeDelta = new Vector2(rect.sizeDelta.x, rect.sizeDelta.y - 120);
            }
        }
    }
        protected internal override void OnUpdate(float elapseSeconds, float realElapseSeconds)
        {
            base.OnUpdate(elapseSeconds, realElapseSeconds);

            m_Transform.AddLocalPositionY(m_ScrollSpeed * elapseSeconds);
            if (m_Transform.localPosition.y > m_Transform.sizeDelta.y - m_InitPosition)
            {
                m_Transform.SetLocalPositionY(m_InitPosition);
            }
        }
Beispiel #3
0
    void Start()
    {
        if (SafeAreaControl.HasInstance)
        {
            SafeAreaControl.Instance.enebleMask(m_TopMask, m_BottomMask);

            int bottom_space_height = SafeAreaControl.Instance.bottom_space_height;
            if (bottom_space_height > 0)
            {
                int bar_height = SafeAreaControl.Instance.bar_height;

                RectTransform rect = m_TopMask.GetComponent <RectTransform>();
                rect.AddLocalPositionY(bar_height);

                rect = m_BottomMask.GetComponent <RectTransform>();
                rect.AddLocalPositionY(bottom_space_height * -1);
            }
        }
    }
        public override void OnUpdate()
        {
            base.OnUpdate();

            m_RectTransform.AddLocalPositionY(m_ScrollSpeed * HotfixEntry.deltaTime);       //累加Y坐标
            if (m_RectTransform.localPosition.y > m_RectTransform.sizeDelta.y - m_InitPosition)
            {
                m_RectTransform.SetLocalPositionY(m_InitPosition);      //复位
            }
        }
    protected override void Start()
    {
        base.Start();

        if (SafeAreaControl.HasInstance)
        {
            RectTransform rect = m_CardMask.GetComponent <RectTransform>();
            if (rect != null)
            {
                float bottom_space_height = SafeAreaControl.Instance.bottom_space_height;
                if (bottom_space_height > 0)
                {
                    rect.AddLocalPositionY((bottom_space_height / 2) * -1);
                    rect.sizeDelta = new Vector2(rect.sizeDelta.x,
                                                 rect.sizeDelta.y + bottom_space_height);
                }
            }
        }

        SceneCommon.initalizeGameFps();

        m_PartsGroup1.SetActive(false);
        m_PartsGroup2.SetActive(false);
        m_BattleScenePhase         = BattleScenePhase.NOT_BATTLE;
        m_IsChangeBattleScenePhase = true;

        {
            float      camera_fov = m_BattleCameraNear.fieldOfView;
            Quaternion camera_rot = m_BattleCameraNear.transform.localRotation;
            BattleSceneUtil.getAdjustScreenInfo(ref camera_fov, ref camera_rot);

            m_BattleCameraNear.fieldOfView             = camera_fov;
            m_BattleCameraNear.transform.localRotation = camera_rot;

            m_BattleCameraFar.fieldOfView             = camera_fov;
            m_BattleCameraFar.transform.localRotation = camera_rot;
        }

        m_GuideDispTransform = m_UICanvas.transform.Find("ImageGuide");

        GameObject teacher_hand_prefab = Resources.Load <GameObject>("Prefab/BattleScene/TutorialHand");

        if (teacher_hand_prefab != null)
        {
            m_OverrideTouchHand = GameObject.Instantiate(teacher_hand_prefab);
            if (m_OverrideTouchHand != null)
            {
                m_OverrideTouchHand.transform.SetParent(m_UICanvas.transform, false);
                m_OverrideTouchHand.SetActive(false);
            }
        }

#if BUILD_TYPE_DEBUG
        {
            GameObject debug_menu_prefab = Resources.Load <GameObject>("Prefab/Debug/BattleDebugMenu");
            if (debug_menu_prefab != null)
            {
                GameObject debug_menu_object = GameObject.Instantiate(debug_menu_prefab);
                if (debug_menu_object != null)
                {
                    debug_menu_object.transform.SetParent(transform, false);
                    Transform canvas_trans = debug_menu_object.transform.Find("Canvas");
                    if (canvas_trans != null)
                    {
                        Canvas canvas = canvas_trans.GetComponent <Canvas>();
                        if (canvas != null)
                        {
                            canvas.renderMode    = RenderMode.ScreenSpaceCamera;
                            canvas.worldCamera   = m_BattleCameraNear;
                            canvas.planeDistance = 0.5f;
                        }
                    }
                }
            }
        }
#endif
    }