Пример #1
0
    public void Init(LayoutManager layout_mng)
    {
        m_camera        = LayoutTool.CreateCamera(true);
        m_normal_camera = true;

        m_background = LayoutTool.CreateBackground(true);

        m_preview_tex          = new RenderTexture(ConfigTool.Instance.target_width, ConfigTool.Instance.target_height, 32);
        m_camera.targetTexture = m_preview_tex;
        m_view_rect            = new Rect(0, 0, ConfigTool.Instance.target_width, ConfigTool.Instance.target_height);

        m_target_view_rect    = new Vector3[4];
        m_target_view_rect[0] = new Vector3(LayoutTool.s_editor_default_x - ConfigTool.Instance.target_width / 2, LayoutTool.s_editor_default_y - ConfigTool.Instance.target_height / 2);
        m_target_view_rect[1] = new Vector3(LayoutTool.s_editor_default_x - ConfigTool.Instance.target_width / 2, LayoutTool.s_editor_default_y + ConfigTool.Instance.target_height / 2);
        m_target_view_rect[2] = new Vector3(LayoutTool.s_editor_default_x + ConfigTool.Instance.target_width / 2, LayoutTool.s_editor_default_y + ConfigTool.Instance.target_height / 2);
        m_target_view_rect[3] = new Vector3(LayoutTool.s_editor_default_x + ConfigTool.Instance.target_width / 2, LayoutTool.s_editor_default_y - ConfigTool.Instance.target_height / 2);

        m_view_controller = new Controller(this);
        m_layout_mng      = layout_mng;

        BackColor   = LayoutTool.DefaultBackColor;
        BackTexture = EditorPrefs.GetString("BackTexture");

        nResWidth  = ConfigTool.Instance.target_width;
        nResHeight = ConfigTool.Instance.target_height;
    }