示例#1
0
        private int lastLod;                 // Track when the lod has been changed

        private void Start()
        {
            if (!characterRoot)
            {
                characterRoot = gameObject;
            }

            if (characterRoot)
            {
                // Get RandomEyes3D reference from the character root
                res = characterRoot.GetComponents <RandomEyes3D>();
                for (int i = 0; i < res.Length; i++)
                {
                    if (res[i].useCustomShapesOnly)
                    {
                        reCustomShapes = res[i];
                    }
                }
                // Get CM_AutoDeskSync reference from the character root
                autodeskSync = characterRoot.GetComponent <CM_AutodeskSync>();

                if (autodeskSync)
                {
                    GetCroudLOD();
                    GetLowLOD();
                    GetMidLOD();
                    GetHighLOD();
                }
            }
        }
        private float percentageWidth = 30f;  // Percentage

        public void OnEnable()
        {
            // Get reference
            autodeskSync = target as CM_AutodeskSync;

            // Initialize
            if (autodeskSync.initialize)
            {
                autodeskSync.GetSalsa3D();
                autodeskSync.GetRandomEyes3D();
                autodeskSync.GetBody();
                autodeskSync.GetTeeth();
                autodeskSync.GetEyeBones();
                if (autodeskSync.saySmall == null)
                {
                    autodeskSync.saySmall = new List <CM_ShapeGroup>();
                }
                if (autodeskSync.sayMedium == null)
                {
                    autodeskSync.sayMedium = new List <CM_ShapeGroup>();
                }
                if (autodeskSync.sayLarge == null)
                {
                    autodeskSync.sayLarge = new List <CM_ShapeGroup>();
                }
                autodeskSync.GetShapeNames();
                autodeskSync.SetDefaultSmall();
                autodeskSync.SetDefaultMedium();
                autodeskSync.SetDefaultLarge();
                autodeskSync.initialize = false;
            }
        }