コード例 #1
0
        /// <summary>
        /// Sets the crosshairs to the specified transform.
        /// </summary>
        /// <param name="crosshairs">The transform of the crosshairs.</param>
        public override void SetCrosshairs(Transform crosshairs)
        {
            m_CrosshairsTransform = crosshairs;

            if (m_CrosshairsTransform != null)
            {
                m_CrosshairsCanvas   = crosshairs.GetComponentInParent <Canvas>();
                m_CrosshairsMonitor  = crosshairs.gameObject.GetCachedComponent <UI.CrosshairsMonitor>();
                m_CrosshairsPosition = -m_CrosshairsTransform.position;
            }
        }
コード例 #2
0
ファイル: ThirdPerson.cs プロジェクト: ridleytech/CAA-Unity
        /// <summary>
        /// Sets the crosshairs to the specified transform.
        /// </summary>
        /// <param name="crosshairs">The transform of the crosshairs.</param>
        public override void SetCrosshairs(Transform crosshairs)
        {
            m_CrosshairsTransform = crosshairs;

            if (m_CrosshairsTransform != null)
            {
                m_CrosshairsCanvas   = crosshairs.GetComponentInParent <Canvas>();
                m_CrosshairsMonitor  = crosshairs.gameObject.GetCachedComponent <UI.CrosshairsMonitor>();
                m_CrosshairsPosition = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue);
            }
        }