コード例 #1
0
        public void DrawWorkerAnimated(Vector3 loc, Rot4 rot, int index, float extraRotation, bool rotatePoints = false)
        {
            Mesh       mesh       = MeshAt(rot);
            Vector3    newLoc     = loc;
            Quaternion quaternion = QuatFromRot(rot);

            if (extraRotation != 0f)
            {
                quaternion *= Quaternion.Euler(Vector3.up * extraRotation);
            }
            Vector3 offset = DrawOffset(rot);

            if (rotatePoints && extraRotation != 0)
            {
                offset = Ext_Math.RotatePoint(offset, Vector3.zero, extraRotation);
            }
            newLoc += offset;

            Material mat = SubGraphicForIndex(index).MatSingle;

            DrawMeshInt(mesh, newLoc, quaternion, mat);
            if (ShadowGraphic != null)
            {
                ShadowGraphic.DrawWorker(newLoc, rot, null, null, extraRotation);
            }
        }