Beispiel #1
0
        /// <summary>
        /// Based on the type of state info pass it through to the mesh renderer
        /// </summary>
        private void SetCursorState(MeshCursorDatum stateDatum)
        {
            // Return if we do not have an animator
            if (TargetRenderer != null)
            {
                var filter = TargetRenderer.gameObject.GetComponent <MeshFilter>();
                if (filter != null && stateDatum.CursorMesh != null)
                {
                    filter.mesh = stateDatum.CursorMesh;
                }

                TargetRenderer.transform.localPosition = stateDatum.LocalOffset;
                TargetRenderer.transform.localScale    = stateDatum.LocalScale;
            }
        }
        /// <summary>
        /// Based on the type of state info pass it through to the mesh renderer
        /// </summary>
        /// <param name="stateDatum"></param>
        private void SetCursorState(MeshCursorDatum stateDatum)
        {
            // Return if we do not have an animator
            if (TargetRenderer != null)
            {
                MeshFilter mf = TargetRenderer.gameObject.GetComponent<MeshFilter>();
                if(mf != null && stateDatum.CursorMesh != null)
                {
                    mf.mesh = stateDatum.CursorMesh;
                }

                TargetRenderer.transform.localPosition = stateDatum.LocalOffset;
                TargetRenderer.transform.localScale = stateDatum.LocalScale;
            }
        }