Beispiel #1
0
        private void Awake()
        {
            _hand = GetComponent <Hand>();
            _boneConnectorsVisualizers = new List <BoneBounds>();
            _skeleton = new GameObject("SkeletonVisualizer");
            _skeleton.transform.SetParent(transform, false);
            _skeletonMaterial = Instantiate(_skeletonMaterial) as Material;
            StartCoroutine(BuildSkeletonVis());

            _handMaterialModifier = new HandMaterialModifier(_skeletonMaterial);
        }
        void Awake()
        {
            _skinnedMeshRenderer = GetComponent <SkinnedMeshRenderer>();
            if (!_skinnedMeshRenderer)
            {
                _skinnedMeshRenderer = gameObject.AddComponent <SkinnedMeshRenderer>();
            }
            _meshFilter = GetComponent <MeshFilter>();
            if (!_meshFilter)
            {
                _meshFilter = gameObject.AddComponent <MeshFilter>();
            }
            Mesh = new Mesh();
            _meshFilter.sharedMesh = Mesh;

            _hand                 = GetComponent <Hand>();
            _material             = _skinnedMeshRenderer.material;
            _handMaterialModifier = new HandMaterialModifier(_material);
        }