-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCameraToolOptions.cs
36 lines (31 loc) · 1.01 KB
/
CameraToolOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System.Windows.Forms;
using Caravel.Core.Entity;
namespace CaravelEditor
{
public partial class CameraToolOptions : UserControl
{
private EditorApp m_EditorApp;
private Cv_Entity m_EditorCamera;
public CameraToolOptions()
{
InitializeComponent();
}
public void Initialize(EditorApp app)
{
m_EditorApp = app;
var sceneRoot = m_EditorApp.Logic.GetSceneRoot(m_EditorApp.Logic.GetSceneID("/Root"));
m_EditorCamera = sceneRoot.GetEntity("/_editorCamera");
if (m_EditorCamera != null)
{
zoomTextBox.Text = ((int)(m_EditorCamera.GetComponent<Cv_CameraComponent>().Zoom * 100)).ToString() + "%";
}
}
public void RefreshInfo()
{
if (m_EditorCamera != null)
{
zoomTextBox.Text = ((int)(m_EditorCamera.GetComponent<Cv_CameraComponent>().Zoom * 100)).ToString() + "%";
}
}
}
}