コード例 #1
0
ファイル: BaseHandle.cs プロジェクト: lbm7926/Imp
 private void Start()
 {
     m_input = GetComponent <BaseHandleInput>();
     if (m_input == null || m_input.Handle != this)
     {
         m_input        = gameObject.AddComponent <BaseHandleInput>();
         m_input.Handle = this;
     }
     OnStartOverride();
 }
コード例 #2
0
        protected override void Start()
        {
            m_input = GetComponent <BaseHandleInput>();
            if (m_input == null || m_input.Handle != this)
            {
                m_input        = gameObject.AddComponent <BaseHandleInput>();
                m_input.Handle = this;
            }

            IRTEGraphicsLayer graphicsLayer = Window.IOCContainer.Resolve <IRTEGraphicsLayer>();

            if (graphicsLayer != null)
            {
                m_rteCamera = graphicsLayer.Camera;
            }

            if (m_rteCamera == null && Window.Camera != null)
            {
                IRTEGraphics graphics = IOC.Resolve <IRTEGraphics>();
                if (graphics != null)
                {
                    m_rteCamera = graphics.GetOrCreateCamera(Window.Camera, CameraEvent.AfterImageEffectsOpaque);
                }

                if (m_rteCamera == null)
                {
                    m_rteCamera       = Window.Camera.gameObject.AddComponent <RTECamera>();
                    m_rteCamera.Event = CameraEvent.AfterImageEffectsOpaque;
                }
            }

            if (Model == null && m_rteCamera != null)
            {
                m_prevScale = transform.localScale;

                m_prevCamPosition          = m_rteCamera.Camera.transform.position;
                m_prevCamRotation          = m_rteCamera.Camera.transform.rotation;
                m_prevCamOrthographic      = m_rteCamera.Camera.orthographic;
                m_prevCamOrthographicsSize = m_rteCamera.Camera.orthographicSize;
                m_prevCamRect = m_rteCamera.Camera.rect;

                m_rteCamera.CommandBufferRefresh += OnCommandBufferRefresh;
                m_rteCamera.RefreshCommandBuffer();
            }

#pragma warning disable CS0618
            OnStartOverride();
#pragma warning restore CS0618
        }
コード例 #3
0
        private void Start()
        {
            m_input = GetComponent <BaseHandleInput>();
            if (m_input == null || m_input.Handle != this)
            {
                m_input        = gameObject.AddComponent <BaseHandleInput>();
                m_input.Handle = this;
            }

            IRTEGraphicsLayer graphicsLayer = Window.IOCContainer.Resolve <IRTEGraphicsLayer>();

            if (graphicsLayer != null)
            {
                m_rteCamera = graphicsLayer.Camera;
            }

            if (m_rteCamera == null && Window.Camera != null)
            {
                m_rteCamera = Window.Camera.GetComponent <IRTECamera>();
                if (m_rteCamera == null)
                {
                    m_rteCamera       = Window.Camera.gameObject.AddComponent <RTECamera>();
                    m_rteCamera.Event = UnityEngine.Rendering.CameraEvent.AfterImageEffectsOpaque;
                }
            }

            if (Model == null && m_rteCamera != null)
            {
                m_prevScale = transform.localScale;

                m_prevCamPosition          = m_rteCamera.Camera.transform.position;
                m_prevCamRotation          = m_rteCamera.Camera.transform.rotation;
                m_prevCamOrthographic      = m_rteCamera.Camera.orthographic;
                m_prevCamOrthographicsSize = m_rteCamera.Camera.orthographicSize;
                m_prevCamRect = m_rteCamera.Camera.rect;

                m_rteCamera.CommandBufferRefresh += OnCommandBufferRefresh;
                m_rteCamera.RefreshCommandBuffer();
            }

            OnStartOverride();
        }
コード例 #4
0
ファイル: PositionHandle.cs プロジェクト: lbm7926/Imp
        protected override void OnEnableOverride()
        {
            BaseHandleInput input = GetComponent <BaseHandleInput>();

            if (input == null || input.Handle != this)
            {
                input        = gameObject.AddComponent <PositionHandleInput>();
                input.Handle = this;
            }

            base.OnEnableOverride();

            m_isInVertexSnappingMode = false;
            Editor.Tools.IsSnapping  = false;
            m_handleOffset           = Vector3.zero;
            m_targetLayers           = null;
            m_snapTargets            = null;
            m_snapTargetsBounds      = null;
            m_allExposedToEditor     = null;

            Editor.Tools.IsSnappingChanged += OnSnappingChanged;
            OnSnappingChanged();
        }