private void DrawInspector(SVGCameraBehaviour svgCamera) { // show dimensions in pixel and world units EditorGUILayout.LabelField("Width (pixel units)", svgCamera.PixelWidth.ToString()); EditorGUILayout.LabelField("Height (pixel units)", svgCamera.PixelHeight.ToString()); EditorGUILayout.LabelField("Width (world units)", svgCamera.WorldWidth.ToString()); EditorGUILayout.LabelField("Height (world units)", svgCamera.WorldHeight.ToString()); }
public override void OnInspectorGUI() { // get the target object SVGCameraBehaviour camera = target as SVGCameraBehaviour; if (camera != null) { this.DrawInspector(camera); } }
// Reset is called when the user hits the Reset button in the Inspector's context menu or when adding the component the first time. // This function is only called in editor mode. Reset is most commonly used to give good default values in the inspector. void Reset() { this.Camera = null; this.Background = null; this.Atlas = null; this.Cards = null; this.m_SelectedCard0 = null; this.m_SelectedCard1 = null; this.m_Animating = false; }
void Start() { // start with the "idle" animation this.m_Animator = this.gameObject.GetComponent<Animator>(); this.IdleAnimation(); // move the background at world origin and get the reference to its monobehaviour script if (this.Background != null) { this.Background.transform.position = new Vector3(0, 0, 0); this.Background = this.Background.GetComponent<SVGBackgroundBehaviour>(); } // register handler for device orientation change this.Camera = (this.Camera != null) ? this.Camera.GetComponent<SVGCameraBehaviour>() : null; if (this.Camera != null) { // register ourself for receiving resize events this.Camera.OnResize += this.OnResize; // now fire a resize event by hand this.Camera.Resize(true); } }