예제 #1
0
    protected override void OnDestroy()
    {
        base.OnDestroy();

        SceneCommon.initalizeMenuFps();

        BattleParam.clearValues();
    }
예제 #2
0
    protected override void Awake()
    {
        base.Awake();

        SceneCommon.initalizeMenuFps();
    }
예제 #3
0
    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
    }