public void InitPartOfBodyUI(PartOfBodyModel model, PartOfBodyController bodyController = null)
        {
            this.model = model;

            this.nodeControllers = new List <PartOfBodyNodeController>();

            // 初始化关节点
            for (int y = 0; y < model.height; y++)
            {
                for (int x = 0; x < model.weight; x++)
                {
                    PartOfBodyNodeController nodeController = Instantiate(this.PartOfBodyNodePrefab, this.transform).GetComponent <PartOfBodyNodeController>();

                    nodeController.model = model.GetPartOfBodyNodeModel(x, y);

                    nodeController.InitNodeUI();

                    this.nodeControllers.Add(nodeController);
                }
            }

            // 关节点连接
            if (model.type != PartOfBodyType.Body)
            {
                if (bodyController != null)
                {
                    this.transform.localPosition += this.CalculatePartOfBodyPosition(bodyController);
                }
                else
                {
                    Debug.LogError("InitPartOfBodyUI Error : bodyModel is null!");
                }
            }
        }
        private Vector3 CalculatePartOfBodyPosition(PartOfBodyController bodyController)
        {
            // 找到连接节点
            Vector2 bodyJoinPoint = bodyController.model.GetBodyJoinPoint(this.model.type);

            PartOfBodyNodeController bodyJoinNodeController = bodyController.GetNodeControllerWithJoin(bodyJoinPoint);
            PartOfBodyNodeController partJoinNodeController = this.GetNodeControllerWithJoin(this.model.joinPoint);

            // 判断连接方向
            PartOfBodyJoinDirection joinDirection = this.CalculateJoinDirection(this.model.joinPoint, bodyJoinPoint);

            // 得到部位节点世界坐标
            Vector3 joinNodeTargetLocalPosition = bodyJoinNodeController.transform.localPosition;

            switch (joinDirection)
            {
            case PartOfBodyJoinDirection.Left_Right:
                joinNodeTargetLocalPosition += Vector3.right * PartOfBodyNodeController.NodeSize;
                break;

            case PartOfBodyJoinDirection.Right_Left:
                joinNodeTargetLocalPosition += Vector3.left * PartOfBodyNodeController.NodeSize;
                break;

            case PartOfBodyJoinDirection.Up_Down:
                joinNodeTargetLocalPosition += Vector3.down * PartOfBodyNodeController.NodeSize;
                break;

            case PartOfBodyJoinDirection.Down_Up:
                joinNodeTargetLocalPosition += Vector3.up * PartOfBodyNodeController.NodeSize;
                break;

            default:
                break;
            }

            Vector3 joinNodeTargetWorldPosition = bodyController.transform.TransformPoint(joinNodeTargetLocalPosition);

            joinNodeTargetLocalPosition = this.transform.InverseTransformPoint(joinNodeTargetWorldPosition);
            // 得到部位坐标
            Vector3 offset = joinNodeTargetLocalPosition - partJoinNodeController.transform.localPosition;

            return(offset);
        }