mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-09 00:30:12 +08:00
Merge branch '3.6' into 3.7-beta
This commit is contained in:
commit
101a3ebe2b
@ -745,7 +745,7 @@ void _spAttachmentTimeline_apply (const spTimeline* timeline, spSkeleton* skelet
|
||||
spSlot* slot = skeleton->slots[self->slotIndex];
|
||||
|
||||
if (direction == SP_MIX_DIRECTION_OUT && pose == SP_MIX_POSE_SETUP) {
|
||||
attachmentName = slot->data->attachmentName;
|
||||
const char* attachmentName = slot->data->attachmentName;
|
||||
spSlot_setAttachment(slot, attachmentName ? spSkeleton_getAttachmentForSlotIndex(skeleton, self->slotIndex, attachmentName) : 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -180,7 +180,7 @@ void _spEventQueue_drain (_spEventQueue* self) {
|
||||
self->drainDisabled = 0;
|
||||
}
|
||||
|
||||
// These two functions are needed in the UE4 runtime, see #1037
|
||||
/* These two functions are needed in the UE4 runtime, see #1037 */
|
||||
void _spAnimationState_enableQueue(spAnimationState* self) {
|
||||
_spAnimationState* internal = SUB_CAST(_spAnimationState, self);
|
||||
internal->queue->drainDisabled = 0;
|
||||
|
||||
@ -307,8 +307,9 @@ static spAnimation* _spSkeletonBinary_readAnimation (spSkeletonBinary* self, con
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
for (iii = 0; iii < kv_size(timelines); ++iii)
|
||||
spTimeline_dispose(kv_A(timelines, iii));
|
||||
int i;
|
||||
for (i = 0; i < kv_size(timelines); ++i)
|
||||
spTimeline_dispose(kv_A(timelines, i));
|
||||
kv_destroy(timelines);
|
||||
_spSkeletonBinary_setError(self, "Invalid timeline type for a slot: ", skeletonData->slots[slotIndex]->name);
|
||||
return 0;
|
||||
@ -369,8 +370,9 @@ static spAnimation* _spSkeletonBinary_readAnimation (spSkeletonBinary* self, con
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
for (iii = 0; iii < kv_size(timelines); ++iii)
|
||||
spTimeline_dispose(kv_A(timelines, iii));
|
||||
int i;
|
||||
for (i = 0; i < kv_size(timelines); ++i)
|
||||
spTimeline_dispose(kv_A(timelines, i));
|
||||
kv_destroy(timelines);
|
||||
_spSkeletonBinary_setError(self, "Invalid timeline type for a bone: ", skeletonData->bones[boneIndex]->name);
|
||||
return 0;
|
||||
@ -480,9 +482,9 @@ static spAnimation* _spSkeletonBinary_readAnimation (spSkeletonBinary* self, con
|
||||
spVertexAttachment* attachment = SUB_CAST(spVertexAttachment,
|
||||
spSkin_getAttachment(skin, slotIndex, attachmentName));
|
||||
if (!attachment) {
|
||||
int iiii;
|
||||
for (iiii = 0; iiii < kv_size(timelines); ++iiii)
|
||||
spTimeline_dispose(kv_A(timelines, iiii));
|
||||
int i;
|
||||
for (i = 0; i < kv_size(timelines); ++i)
|
||||
spTimeline_dispose(kv_A(timelines, i));
|
||||
kv_destroy(timelines);
|
||||
_spSkeletonBinary_setError(self, "Attachment not found: ", attachmentName);
|
||||
FREE(attachmentName);
|
||||
@ -599,7 +601,7 @@ static spAnimation* _spSkeletonBinary_readAnimation (spSkeletonBinary* self, con
|
||||
animation = spAnimation_create(name, 0);
|
||||
FREE(animation->timelines);
|
||||
animation->duration = duration;
|
||||
animation->timelinesCount = (int)kv_size(timelines);
|
||||
animation->timelinesCount = kv_size(timelines);
|
||||
animation->timelines = kv_array(timelines);
|
||||
return animation;
|
||||
}
|
||||
@ -663,11 +665,11 @@ static void _readVertices(spSkeletonBinary* self, _dataInput* input, spVertexAtt
|
||||
}
|
||||
|
||||
kv_trim(float, weights);
|
||||
attachment->verticesCount = (int)kv_size(weights);
|
||||
attachment->verticesCount = kv_size(weights);
|
||||
attachment->vertices = kv_array(weights);
|
||||
|
||||
kv_trim(int, bones);
|
||||
attachment->bonesCount = (int)kv_size(bones);
|
||||
attachment->bonesCount = kv_size(bones);
|
||||
attachment->bones = kv_array(bones);
|
||||
}
|
||||
|
||||
|
||||
@ -94,8 +94,7 @@ static float toColor (const char* value, int index) {
|
||||
int color;
|
||||
|
||||
if (index >= strlen(value) / 2)
|
||||
return -1;
|
||||
|
||||
return -1;
|
||||
value += index * 2;
|
||||
|
||||
digits[0] = *value;
|
||||
@ -404,33 +403,33 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
|
||||
|
||||
for (valueMap = timelineMap->child, frameIndex = 0; valueMap; valueMap = valueMap->next, ++frameIndex) {
|
||||
Json* vertices = Json_getItem(valueMap, "vertices");
|
||||
float* deform2;
|
||||
float* deform;
|
||||
if (!vertices) {
|
||||
if (weighted) {
|
||||
deform2 = tempDeform;
|
||||
deform = tempDeform;
|
||||
memset(deform, 0, sizeof(float) * deformLength);
|
||||
} else
|
||||
deform2 = attachment->vertices;
|
||||
deform = attachment->vertices;
|
||||
} else {
|
||||
int v, start = Json_getInt(valueMap, "offset", 0);
|
||||
Json* vertex;
|
||||
deform2 = tempDeform;
|
||||
deform = tempDeform;
|
||||
memset(deform, 0, sizeof(float) * start);
|
||||
if (self->scale == 1) {
|
||||
for (vertex = vertices->child, v = start; vertex; vertex = vertex->next, ++v)
|
||||
deform2[v] = vertex->valueFloat;
|
||||
deform[v] = vertex->valueFloat;
|
||||
} else {
|
||||
for (vertex = vertices->child, v = start; vertex; vertex = vertex->next, ++v)
|
||||
deform2[v] = vertex->valueFloat * self->scale;
|
||||
deform[v] = vertex->valueFloat * self->scale;
|
||||
}
|
||||
memset(deform + v, 0, sizeof(float) * (deformLength - v));
|
||||
if (!weighted) {
|
||||
float* verticesAttachment = attachment->vertices;
|
||||
float* vertices = attachment->vertices;
|
||||
for (v = 0; v < deformLength; ++v)
|
||||
deform2[v] += verticesAttachment[v];
|
||||
deform[v] += vertices[v];
|
||||
}
|
||||
}
|
||||
spDeformTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0), deform2);
|
||||
spDeformTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0), deform);
|
||||
readCurve(valueMap, SUPER(timeline), frameIndex);
|
||||
}
|
||||
FREE(tempDeform);
|
||||
@ -446,16 +445,16 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
|
||||
spDrawOrderTimeline* timeline = spDrawOrderTimeline_create(drawOrder->size, skeletonData->slotsCount);
|
||||
for (valueMap = drawOrder->child, frameIndex = 0; valueMap; valueMap = valueMap->next, ++frameIndex) {
|
||||
int ii;
|
||||
int* drawOrder2 = 0;
|
||||
int* drawOrder = 0;
|
||||
Json* offsets = Json_getItem(valueMap, "offsets");
|
||||
if (offsets) {
|
||||
Json* offsetMap;
|
||||
int* unchanged = MALLOC(int, skeletonData->slotsCount - offsets->size);
|
||||
int originalIndex = 0, unchangedIndex = 0;
|
||||
|
||||
drawOrder2 = MALLOC(int, skeletonData->slotsCount);
|
||||
drawOrder = MALLOC(int, skeletonData->slotsCount);
|
||||
for (ii = skeletonData->slotsCount - 1; ii >= 0; --ii)
|
||||
drawOrder2[ii] = -1;
|
||||
drawOrder[ii] = -1;
|
||||
|
||||
for (offsetMap = offsets->child; offsetMap; offsetMap = offsetMap->next) {
|
||||
int slotIndex = spSkeletonData_findSlotIndex(skeletonData, Json_getString(offsetMap, "slot", 0));
|
||||
@ -468,7 +467,7 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
|
||||
while (originalIndex != slotIndex)
|
||||
unchanged[unchangedIndex++] = originalIndex++;
|
||||
/* Set changed items. */
|
||||
drawOrder2[originalIndex + Json_getInt(offsetMap, "offset", 0)] = originalIndex;
|
||||
drawOrder[originalIndex + Json_getInt(offsetMap, "offset", 0)] = originalIndex;
|
||||
originalIndex++;
|
||||
}
|
||||
/* Collect remaining unchanged items. */
|
||||
@ -476,11 +475,11 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
|
||||
unchanged[unchangedIndex++] = originalIndex++;
|
||||
/* Fill in unchanged items. */
|
||||
for (ii = skeletonData->slotsCount - 1; ii >= 0; ii--)
|
||||
if (drawOrder2[ii] == -1) drawOrder2[ii] = unchanged[--unchangedIndex];
|
||||
if (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex];
|
||||
FREE(unchanged);
|
||||
}
|
||||
spDrawOrderTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0), drawOrder2);
|
||||
FREE(drawOrder2);
|
||||
spDrawOrderTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0), drawOrder);
|
||||
FREE(drawOrder);
|
||||
}
|
||||
animation->timelines[animation->timelinesCount++] = SUPER_CAST(spTimeline, timeline);
|
||||
animation->duration = MAX(animation->duration, timeline->frames[drawOrder->size - 1]);
|
||||
@ -874,7 +873,7 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
|
||||
spAttachment* attachment;
|
||||
const char* skinAttachmentName = attachmentMap->name;
|
||||
const char* attachmentName = Json_getString(attachmentMap, "name", skinAttachmentName);
|
||||
const char* attachmentPath = Json_getString(attachmentMap, "path", attachmentName);
|
||||
const char* path = Json_getString(attachmentMap, "path", attachmentName);
|
||||
const char* color;
|
||||
Json* entry;
|
||||
|
||||
@ -898,7 +897,7 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
|
||||
return 0;
|
||||
}
|
||||
|
||||
attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, attachmentName, attachmentPath);
|
||||
attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, attachmentName, path);
|
||||
if (!attachment) {
|
||||
if (self->attachmentLoader->error1) {
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
@ -911,7 +910,7 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
|
||||
switch (attachment->type) {
|
||||
case SP_ATTACHMENT_REGION: {
|
||||
spRegionAttachment* region = SUB_CAST(spRegionAttachment, attachment);
|
||||
if (path) MALLOC_STR(region->path, attachmentPath);
|
||||
if (path) MALLOC_STR(region->path, path);
|
||||
region->x = Json_getFloat(attachmentMap, "x", 0) * self->scale;
|
||||
region->y = Json_getFloat(attachmentMap, "y", 0) * self->scale;
|
||||
region->scaleX = Json_getFloat(attachmentMap, "scaleX", 1);
|
||||
@ -938,7 +937,7 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
|
||||
case SP_ATTACHMENT_LINKED_MESH: {
|
||||
spMeshAttachment* mesh = SUB_CAST(spMeshAttachment, attachment);
|
||||
|
||||
MALLOC_STR(mesh->path, attachmentPath);
|
||||
MALLOC_STR(mesh->path, path);
|
||||
|
||||
color = Json_getString(attachmentMap, "color", 0);
|
||||
if (color) {
|
||||
@ -998,19 +997,19 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
|
||||
break;
|
||||
}
|
||||
case SP_ATTACHMENT_PATH: {
|
||||
spPathAttachment* pathAttatchment = SUB_CAST(spPathAttachment, attachment);
|
||||
spPathAttachment* path = SUB_CAST(spPathAttachment, attachment);
|
||||
int vertexCount = 0;
|
||||
pathAttatchment->closed = Json_getInt(attachmentMap, "closed", 0);
|
||||
pathAttatchment->constantSpeed = Json_getInt(attachmentMap, "constantSpeed", 1);
|
||||
path->closed = Json_getInt(attachmentMap, "closed", 0);
|
||||
path->constantSpeed = Json_getInt(attachmentMap, "constantSpeed", 1);
|
||||
vertexCount = Json_getInt(attachmentMap, "vertexCount", 0);
|
||||
_readVertices(self, attachmentMap, SUPER(pathAttatchment), vertexCount << 1);
|
||||
_readVertices(self, attachmentMap, SUPER(path), vertexCount << 1);
|
||||
|
||||
pathAttatchment->lengthsLength = vertexCount / 3;
|
||||
pathAttatchment->lengths = MALLOC(float, pathAttatchment->lengthsLength);
|
||||
path->lengthsLength = vertexCount / 3;
|
||||
path->lengths = MALLOC(float, path->lengthsLength);
|
||||
|
||||
curves = Json_getItem(attachmentMap, "lengths");
|
||||
for (curves = curves->child, ii = 0; curves; curves = curves->next, ++ii) {
|
||||
pathAttatchment->lengths[ii] = curves->valueFloat * self->scale;
|
||||
path->lengths[ii] = curves->valueFloat * self->scale;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -152,9 +152,8 @@ spShortArray* spTriangulator_triangulate(spTriangulator* self, spFloatArray* ver
|
||||
spShortArray_ensureCapacity(triangles, MAX(0, vertexCount - 2) << 2);
|
||||
|
||||
while (vertexCount > 3) {
|
||||
int previous = vertexCount - 1, next = 1;
|
||||
int previous = vertexCount - 1, i = 0, next = 1;
|
||||
int previousIndex, nextIndex;
|
||||
i = 0;
|
||||
while (1) {
|
||||
if (!isConcave[i]) {
|
||||
int p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1;
|
||||
|
||||
@ -114,6 +114,8 @@ void SkeletonAnimation::initialize () {
|
||||
_state = spAnimationState_create(spAnimationStateData_create(_skeleton->data));
|
||||
_state->rendererObject = this;
|
||||
_state->listener = animationCallback;
|
||||
|
||||
_spAnimationState* stateInternal = (_spAnimationState*)_state;
|
||||
}
|
||||
|
||||
SkeletonAnimation::SkeletonAnimation ()
|
||||
|
||||
@ -146,8 +146,8 @@ void SkeletonBatch::reset() {
|
||||
|
||||
cocos2d::TrianglesCommand* SkeletonBatch::nextFreeCommand() {
|
||||
if (_commandsPool.size() <= _nextFreeCommand) {
|
||||
size_t newSize = _commandsPool.size() * 2 + 1;
|
||||
for (size_t i = _commandsPool.size(); i < newSize; i++) {
|
||||
unsigned int newSize = _commandsPool.size() * 2 + 1;
|
||||
for (int i = _commandsPool.size(); i < newSize; i++) {
|
||||
_commandsPool.push_back(new TrianglesCommand());
|
||||
}
|
||||
}
|
||||
|
||||
@ -282,8 +282,8 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t
|
||||
trianglesTwoColor.indexCount = attachmentVertices->_triangles->indexCount;
|
||||
trianglesTwoColor.verts = twoColorBatch->allocateVertices(attachmentVertices->_triangles->vertCount);
|
||||
trianglesTwoColor.vertCount = attachmentVertices->_triangles->vertCount;
|
||||
for (int ii = 0; ii < trianglesTwoColor.vertCount; ii++) {
|
||||
trianglesTwoColor.verts[ii].texCoords = attachmentVertices->_triangles->verts[ii].texCoords;
|
||||
for (int i = 0; i < trianglesTwoColor.vertCount; i++) {
|
||||
trianglesTwoColor.verts[i].texCoords = attachmentVertices->_triangles->verts[i].texCoords;
|
||||
}
|
||||
spRegionAttachment_computeWorldVertices(attachment, slot->bone, (float*)trianglesTwoColor.verts, 0, 7);
|
||||
}
|
||||
@ -311,8 +311,8 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t
|
||||
trianglesTwoColor.indexCount = attachmentVertices->_triangles->indexCount;
|
||||
trianglesTwoColor.verts = twoColorBatch->allocateVertices(attachmentVertices->_triangles->vertCount);
|
||||
trianglesTwoColor.vertCount = attachmentVertices->_triangles->vertCount;
|
||||
for (int ii = 0; ii < trianglesTwoColor.vertCount; ii++) {
|
||||
trianglesTwoColor.verts[ii].texCoords = attachmentVertices->_triangles->verts[ii].texCoords;
|
||||
for (int i = 0; i < trianglesTwoColor.vertCount; i++) {
|
||||
trianglesTwoColor.verts[i].texCoords = attachmentVertices->_triangles->verts[i].texCoords;
|
||||
}
|
||||
spVertexAttachment_computeWorldVertices(SUPER(attachment), slot, 0, trianglesTwoColor.vertCount * sizeof(V3F_C4B_C4B_T2F) / 4, (float*)trianglesTwoColor.verts, 0, 7);
|
||||
}
|
||||
|
||||
@ -336,8 +336,8 @@ void SkeletonTwoColorBatch::reset() {
|
||||
|
||||
TwoColorTrianglesCommand* SkeletonTwoColorBatch::nextFreeCommand() {
|
||||
if (_commandsPool.size() <= _nextFreeCommand) {
|
||||
size_t newSize = _commandsPool.size() * 2 + 1;
|
||||
for (size_t i = _commandsPool.size(); i < newSize; i++) {
|
||||
unsigned int newSize = _commandsPool.size() * 2 + 1;
|
||||
for (int i = _commandsPool.size(); i < newSize; i++) {
|
||||
_commandsPool.push_back(new TwoColorTrianglesCommand());
|
||||
}
|
||||
}
|
||||
|
||||
@ -387,6 +387,9 @@ namespace Spine.Unity.Editor {
|
||||
}
|
||||
|
||||
EditorGUILayout.LabelField("Name", " Duration");
|
||||
bool nonessential = m_skeletonData.ImagesPath != null;
|
||||
float fps = m_skeletonData.Fps;
|
||||
if (nonessential && fps == 0) fps = 30;
|
||||
foreach (Spine.Animation animation in m_skeletonData.Animations) {
|
||||
using (new GUILayout.HorizontalScope()) {
|
||||
if (m_skeletonAnimation != null && m_skeletonAnimation.state != null) {
|
||||
@ -403,7 +406,8 @@ namespace Spine.Unity.Editor {
|
||||
} else {
|
||||
GUILayout.Label("-", GUILayout.Width(24));
|
||||
}
|
||||
EditorGUILayout.LabelField(new GUIContent(animation.Name, Icons.animation), SpineInspectorUtility.TempContent(animation.Duration.ToString("f3") + "s" + ("(" + (Mathf.RoundToInt(animation.Duration * 30)) + ")").PadLeft(12, ' ')));
|
||||
string frameCountString = (fps > 0) ? ("(" + (Mathf.RoundToInt(animation.Duration * fps)) + ")").PadLeft(12, ' ') : string.Empty;
|
||||
EditorGUILayout.LabelField(new GUIContent(animation.Name, Icons.animation), SpineInspectorUtility.TempContent(animation.Duration.ToString("f3") + "s" + frameCountString));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,15 +74,16 @@ namespace Spine.Unity.Editor {
|
||||
return;
|
||||
}
|
||||
|
||||
var dataField = property.FindBaseOrSiblingProperty(TargetAttribute.dataField);
|
||||
SerializedProperty dataField = property.FindBaseOrSiblingProperty(TargetAttribute.dataField);
|
||||
if (dataField != null) {
|
||||
if (dataField.objectReferenceValue is SkeletonDataAsset) {
|
||||
skeletonDataAsset = (SkeletonDataAsset)dataField.objectReferenceValue;
|
||||
} else if (dataField.objectReferenceValue is ISkeletonComponent) {
|
||||
var skeletonComponent = (ISkeletonComponent)dataField.objectReferenceValue;
|
||||
var objectReferenceValue = dataField.objectReferenceValue;
|
||||
if (objectReferenceValue is SkeletonDataAsset) {
|
||||
skeletonDataAsset = (SkeletonDataAsset)objectReferenceValue;
|
||||
} else if (objectReferenceValue is ISkeletonComponent) {
|
||||
var skeletonComponent = (ISkeletonComponent)objectReferenceValue;
|
||||
if (skeletonComponent != null)
|
||||
skeletonDataAsset = skeletonComponent.SkeletonDataAsset;
|
||||
} else {
|
||||
} else if (objectReferenceValue != null) {
|
||||
EditorGUI.LabelField(position, "ERROR:", "Invalid reference type");
|
||||
return;
|
||||
}
|
||||
@ -95,7 +96,12 @@ namespace Spine.Unity.Editor {
|
||||
}
|
||||
|
||||
if (skeletonDataAsset == null) {
|
||||
EditorGUI.LabelField(position, "ERROR:", "Must have reference to a SkeletonDataAsset");
|
||||
if (TargetAttribute.fallbackToTextField) {
|
||||
EditorGUI.PropertyField(position, property); //EditorGUI.TextField(position, label, property.stringValue);
|
||||
} else {
|
||||
EditorGUI.LabelField(position, "ERROR:", "Must have reference to a SkeletonDataAsset");
|
||||
}
|
||||
|
||||
skeletonDataAsset = property.serializedObject.targetObject as SkeletonDataAsset;
|
||||
if (skeletonDataAsset == null) return;
|
||||
}
|
||||
|
||||
@ -345,7 +345,7 @@ VertexOutput vert(VertexInput input)
|
||||
output.color = calculateVertexColor(input.color);
|
||||
output.texcoord = float3(calculateTextureCoord(input.texcoord), 0);
|
||||
|
||||
float3 viewPos = UnityObjectViewPos(input.vertex); //float3 viewPos = mul(UNITY_MATRIX_MV, input.vertex);
|
||||
float3 viewPos = UnityObjectToViewPos(input.vertex); //float3 viewPos = mul(UNITY_MATRIX_MV, input.vertex); //
|
||||
#if defined(FIXED_NORMALS_BACKFACE_RENDERING) || defined(_RIM_LIGHTING)
|
||||
float4 powWorld = calculateWorldPos(input.vertex);
|
||||
#endif
|
||||
|
||||
@ -10,127 +10,78 @@ Material:
|
||||
m_Shader: {fileID: 4800000, guid: fa95b0fb6983c0f40a152e6f9aa82bfb, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 5
|
||||
m_CustomRenderQueue: 3000
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 2
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- first:
|
||||
name: _BumpMap
|
||||
second:
|
||||
- _AlphaTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- first:
|
||||
name: _DetailAlbedoMap
|
||||
second:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- first:
|
||||
name: _DetailMask
|
||||
second:
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- first:
|
||||
name: _DetailNormalMap
|
||||
second:
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- first:
|
||||
name: _EmissionMap
|
||||
second:
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- first:
|
||||
name: _MainTex
|
||||
second:
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- first:
|
||||
name: _MetallicGlossMap
|
||||
second:
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- first:
|
||||
name: _OcclusionMap
|
||||
second:
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- first:
|
||||
name: _ParallaxMap
|
||||
second:
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- first:
|
||||
name: _BumpScale
|
||||
second: 1
|
||||
- first:
|
||||
name: _ColorMask
|
||||
second: 15
|
||||
- first:
|
||||
name: _Cutoff
|
||||
second: 0.5
|
||||
- first:
|
||||
name: _DetailNormalMapScale
|
||||
second: 1
|
||||
- first:
|
||||
name: _DstBlend
|
||||
second: 0
|
||||
- first:
|
||||
name: _Glossiness
|
||||
second: 0.5
|
||||
- first:
|
||||
name: _Metallic
|
||||
second: 0
|
||||
- first:
|
||||
name: _Mode
|
||||
second: 0
|
||||
- first:
|
||||
name: _OcclusionStrength
|
||||
second: 1
|
||||
- first:
|
||||
name: _Parallax
|
||||
second: 0.02
|
||||
- first:
|
||||
name: _SrcBlend
|
||||
second: 1
|
||||
- first:
|
||||
name: _Stencil
|
||||
second: 0
|
||||
- first:
|
||||
name: _StencilComp
|
||||
second: 8
|
||||
- first:
|
||||
name: _StencilOp
|
||||
second: 0
|
||||
- first:
|
||||
name: _StencilReadMask
|
||||
second: 255
|
||||
- first:
|
||||
name: _StencilWriteMask
|
||||
second: 255
|
||||
- first:
|
||||
name: _UVSec
|
||||
second: 0
|
||||
- first:
|
||||
name: _UseUIAlphaClip
|
||||
second: 0
|
||||
- first:
|
||||
name: _ZWrite
|
||||
second: 1
|
||||
- PixelSnap: 0
|
||||
- _BumpScale: 1
|
||||
- _ColorMask: 15
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _EnableExternalAlpha: 0
|
||||
- _Glossiness: 0.5
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SrcBlend: 1
|
||||
- _Stencil: 0
|
||||
- _StencilComp: 8
|
||||
- _StencilOp: 0
|
||||
- _StencilReadMask: 255
|
||||
- _StencilWriteMask: 255
|
||||
- _UVSec: 0
|
||||
- _UseUIAlphaClip: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- first:
|
||||
name: _Color
|
||||
second: {r: 1, g: 1, b: 1, a: 1}
|
||||
- first:
|
||||
name: _EmissionColor
|
||||
second: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _Flip: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
|
||||
@ -112,4 +112,4 @@ Shader "Spine/SkeletonGraphic (Premultiply Alpha)"
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -41,6 +41,7 @@ namespace Spine.Unity {
|
||||
public string dataField = "";
|
||||
public string startsWith = "";
|
||||
public bool includeNone = true;
|
||||
public bool fallbackToTextField = false;
|
||||
}
|
||||
|
||||
public class SpineSlot : SpineAttributeBase {
|
||||
@ -52,15 +53,17 @@ namespace Spine.Unity {
|
||||
/// <param name="startsWith">Filters popup results to elements that begin with supplied string.</param>
|
||||
/// <param name="containsBoundingBoxes">Disables popup results that don't contain bounding box attachments when true.</param>
|
||||
/// <param name = "includeNone">If true, the dropdown list will include a "none" option which stored as an empty string.</param>
|
||||
/// <param name = "fallbackToTextField">If true, and an animation list source can't be found, the field will fall back to a normal text field. If false, it will show an error.</param>
|
||||
/// <param name="dataField">If specified, a locally scoped field with the name supplied by in dataField will be used to fill the popup results.
|
||||
/// Valid types are SkeletonDataAsset and SkeletonRenderer (and derivatives).
|
||||
/// If left empty and the script the attribute is applied to is derived from Component, GetComponent<SkeletonRenderer>() will be called as a fallback.
|
||||
/// </param>
|
||||
public SpineSlot(string startsWith = "", string dataField = "", bool containsBoundingBoxes = false, bool includeNone = true) {
|
||||
public SpineSlot (string startsWith = "", string dataField = "", bool containsBoundingBoxes = false, bool includeNone = true, bool fallbackToTextField = false) {
|
||||
this.startsWith = startsWith;
|
||||
this.dataField = dataField;
|
||||
this.containsBoundingBoxes = containsBoundingBoxes;
|
||||
this.includeNone = includeNone;
|
||||
this.fallbackToTextField = fallbackToTextField;
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,12 +75,14 @@ namespace Spine.Unity {
|
||||
/// <param name = "includeNone">If true, the dropdown list will include a "none" option which stored as an empty string.</param>
|
||||
/// <param name="dataField">If specified, a locally scoped field with the name supplied by in dataField will be used to fill the popup results.
|
||||
/// Valid types are SkeletonDataAsset and SkeletonRenderer (and derivatives).
|
||||
/// If left empty and the script the attribute is applied to is derived from Component, GetComponent<SkeletonRenderer>() will be called as a fallback.
|
||||
/// If left empty and the script the attribute is applied to is derived from Component, GetComponent(SkeletonRenderer)() will be called as a fallback.
|
||||
/// </param>
|
||||
public SpineEvent(string startsWith = "", string dataField = "", bool includeNone = true) {
|
||||
/// <param name="fallbackToTextField">If true, and an animation list source can't be found, the field will fall back to a normal text field. If false, it will show an error.</param>
|
||||
public SpineEvent (string startsWith = "", string dataField = "", bool includeNone = true, bool fallbackToTextField = false) {
|
||||
this.startsWith = startsWith;
|
||||
this.dataField = dataField;
|
||||
this.includeNone = includeNone;
|
||||
this.fallbackToTextField = fallbackToTextField;
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,12 +94,14 @@ namespace Spine.Unity {
|
||||
/// <param name = "includeNone">If true, the dropdown list will include a "none" option which stored as an empty string.</param>
|
||||
/// <param name="dataField">If specified, a locally scoped field with the name supplied by in dataField will be used to fill the popup results.
|
||||
/// Valid types are SkeletonDataAsset and SkeletonRenderer (and derivatives).
|
||||
/// If left empty and the script the attribute is applied to is derived from Component, GetComponent<SkeletonRenderer>() will be called as a fallback.
|
||||
/// If left empty and the script the attribute is applied to is derived from Component, GetComponent(SkeletonRenderer)() will be called as a fallback.
|
||||
/// </param>
|
||||
public SpineIkConstraint(string startsWith = "", string dataField = "", bool includeNone = true) {
|
||||
/// <param name = "fallbackToTextField">If true, and an animation list source can't be found, the field will fall back to a normal text field. If false, it will show an error.</param>
|
||||
public SpineIkConstraint (string startsWith = "", string dataField = "", bool includeNone = true, bool fallbackToTextField = false) {
|
||||
this.startsWith = startsWith;
|
||||
this.dataField = dataField;
|
||||
this.includeNone = includeNone;
|
||||
this.fallbackToTextField = fallbackToTextField;
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,12 +113,13 @@ namespace Spine.Unity {
|
||||
/// <param name = "includeNone">If true, the dropdown list will include a "none" option which stored as an empty string.</param>
|
||||
/// <param name="dataField">If specified, a locally scoped field with the name supplied by in dataField will be used to fill the popup results.
|
||||
/// Valid types are SkeletonDataAsset and SkeletonRenderer (and derivatives).
|
||||
/// If left empty and the script the attribute is applied to is derived from Component, GetComponent<SkeletonRenderer>() will be called as a fallback.
|
||||
/// If left empty and the script the attribute is applied to is derived from Component, GetComponent(SkeletonRenderer)() will be called as a fallback.
|
||||
/// </param>
|
||||
public SpinePathConstraint(string startsWith = "", string dataField = "", bool includeNone = true) {
|
||||
public SpinePathConstraint (string startsWith = "", string dataField = "", bool includeNone = true, bool fallbackToTextField = false) {
|
||||
this.startsWith = startsWith;
|
||||
this.dataField = dataField;
|
||||
this.includeNone = includeNone;
|
||||
this.fallbackToTextField = fallbackToTextField;
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,14 +129,16 @@ namespace Spine.Unity {
|
||||
/// </summary>
|
||||
/// <param name="startsWith">Filters popup results to elements that begin with supplied string.</param>
|
||||
/// <param name = "includeNone">If true, the dropdown list will include a "none" option which stored as an empty string.</param>
|
||||
/// <param name = "fallbackToTextField">If true, and an animation list source can't be found, the field will fall back to a normal text field. If false, it will show an error.</param>
|
||||
/// <param name="dataField">If specified, a locally scoped field with the name supplied by in dataField will be used to fill the popup results.
|
||||
/// Valid types are SkeletonDataAsset and SkeletonRenderer (and derivatives).
|
||||
/// If left empty and the script the attribute is applied to is derived from Component, GetComponent<SkeletonRenderer>() will be called as a fallback.
|
||||
/// </param>
|
||||
public SpineTransformConstraint(string startsWith = "", string dataField = "", bool includeNone = true) {
|
||||
public SpineTransformConstraint (string startsWith = "", string dataField = "", bool includeNone = true, bool fallbackToTextField = false) {
|
||||
this.startsWith = startsWith;
|
||||
this.dataField = dataField;
|
||||
this.includeNone = includeNone;
|
||||
this.fallbackToTextField = fallbackToTextField;
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,14 +148,16 @@ namespace Spine.Unity {
|
||||
/// </summary>
|
||||
/// <param name="startsWith">Filters popup results to elements that begin with supplied string.</param>
|
||||
/// <param name = "includeNone">If true, the dropdown list will include a "none" option which stored as an empty string.</param>
|
||||
/// <param name = "fallbackToTextField">If true, and an animation list source can't be found, the field will fall back to a normal text field. If false, it will show an error.</param>
|
||||
/// <param name="dataField">If specified, a locally scoped field with the name supplied by in dataField will be used to fill the popup results.
|
||||
/// Valid types are SkeletonDataAsset and SkeletonRenderer (and derivatives)
|
||||
/// If left empty and the script the attribute is applied to is derived from Component, GetComponent<SkeletonRenderer>() will be called as a fallback.
|
||||
/// </param>
|
||||
public SpineSkin(string startsWith = "", string dataField = "", bool includeNone = true) {
|
||||
public SpineSkin (string startsWith = "", string dataField = "", bool includeNone = true, bool fallbackToTextField = false) {
|
||||
this.startsWith = startsWith;
|
||||
this.dataField = dataField;
|
||||
this.includeNone = includeNone;
|
||||
this.fallbackToTextField = fallbackToTextField;
|
||||
}
|
||||
}
|
||||
public class SpineAnimation : SpineAttributeBase {
|
||||
@ -153,15 +165,17 @@ namespace Spine.Unity {
|
||||
/// Smart popup menu for Spine Animations
|
||||
/// </summary>
|
||||
/// <param name="startsWith">Filters popup results to elements that begin with supplied string.</param>
|
||||
/// <param name="dataField">If specified, a locally scoped field with the name supplied by in dataField will be used to fill the popup results.
|
||||
/// <param name = "fallbackToTextField">If true, and an animation list source can't be found, the field will fall back to a normal text field. If false, it will show an error.</param>
|
||||
/// <param name="includeNone">If true, the dropdown list will include a "none" option which stored as an empty string.</param>
|
||||
/// <param name="dataField">If specified, a locally scoped field with the name supplied by in dataField will be used to fill the popup results.
|
||||
/// Valid types are SkeletonDataAsset and SkeletonRenderer (and derivatives)
|
||||
/// If left empty and the script the attribute is applied to is derived from Component, GetComponent<SkeletonRenderer>() will be called as a fallback.
|
||||
/// </param>
|
||||
public SpineAnimation(string startsWith = "", string dataField = "", bool includeNone = true) {
|
||||
public SpineAnimation (string startsWith = "", string dataField = "", bool includeNone = true, bool fallbackToTextField = false) {
|
||||
this.startsWith = startsWith;
|
||||
this.dataField = dataField;
|
||||
this.includeNone = includeNone;
|
||||
this.fallbackToTextField = fallbackToTextField;
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,11 +195,12 @@ namespace Spine.Unity {
|
||||
/// <param name="slotField">If specified, a locally scoped field with the name supplied by in slotField will be used to limit the popup results to children of a named slot</param>
|
||||
/// <param name="skinField">If specified, a locally scoped field with the name supplied by in skinField will be used to limit the popup results to entries of the named skin</param>
|
||||
/// <param name="includeNone">If true, the dropdown list will include a "none" option which stored as an empty string.</param>
|
||||
/// <param name = "fallbackToTextField">If true, and an animation list source can't be found, the field will fall back to a normal text field. If false, it will show an error.</param>
|
||||
/// <param name="dataField">If specified, a locally scoped field with the name supplied by in dataField will be used to fill the popup results.
|
||||
/// Valid types are SkeletonDataAsset and SkeletonRenderer (and derivatives)
|
||||
/// If left empty and the script the attribute is applied to is derived from Component, GetComponent<SkeletonRenderer>() will be called as a fallback.
|
||||
/// </param>
|
||||
public SpineAttachment (bool currentSkinOnly = true, bool returnAttachmentPath = false, bool placeholdersOnly = false, string slotField = "", string dataField = "", string skinField = "", bool includeNone = true) {
|
||||
public SpineAttachment (bool currentSkinOnly = true, bool returnAttachmentPath = false, bool placeholdersOnly = false, string slotField = "", string dataField = "", string skinField = "", bool includeNone = true, bool fallbackToTextField = false) {
|
||||
this.currentSkinOnly = currentSkinOnly;
|
||||
this.returnAttachmentPath = returnAttachmentPath;
|
||||
this.placeholdersOnly = placeholdersOnly;
|
||||
@ -193,6 +208,7 @@ namespace Spine.Unity {
|
||||
this.dataField = dataField;
|
||||
this.skinField = skinField;
|
||||
this.includeNone = includeNone;
|
||||
this.fallbackToTextField = fallbackToTextField;
|
||||
}
|
||||
|
||||
public static SpineAttachment.Hierarchy GetHierarchy (string fullPath) {
|
||||
@ -241,15 +257,17 @@ namespace Spine.Unity {
|
||||
/// Smart popup menu for Spine Bones
|
||||
/// </summary>
|
||||
/// <param name="startsWith">Filters popup results to elements that begin with supplied string.</param>
|
||||
/// /// <param name="includeNone">If true, the dropdown list will include a "none" option which stored as an empty string.</param>
|
||||
/// <param name="includeNone">If true, the dropdown list will include a "none" option which stored as an empty string.</param>
|
||||
/// <param name = "fallbackToTextField">If true, and an animation list source can't be found, the field will fall back to a normal text field. If false, it will show an error.</param>
|
||||
/// <param name="dataField">If specified, a locally scoped field with the name supplied by in dataField will be used to fill the popup results.
|
||||
/// Valid types are SkeletonDataAsset and SkeletonRenderer (and derivatives)
|
||||
/// If left empty and the script the attribute is applied to is derived from Component, GetComponent<SkeletonRenderer>() will be called as a fallback.
|
||||
/// </param>
|
||||
public SpineBone(string startsWith = "", string dataField = "", bool includeNone = true) {
|
||||
public SpineBone (string startsWith = "", string dataField = "", bool includeNone = true, bool fallbackToTextField = false) {
|
||||
this.startsWith = startsWith;
|
||||
this.dataField = dataField;
|
||||
this.includeNone = includeNone;
|
||||
this.fallbackToTextField = fallbackToTextField;
|
||||
}
|
||||
|
||||
public static Spine.Bone GetBone(string boneName, SkeletonRenderer renderer) {
|
||||
@ -265,7 +283,7 @@ namespace Spine.Unity {
|
||||
public class SpineAtlasRegion : PropertyAttribute {
|
||||
public string atlasAssetField;
|
||||
|
||||
public SpineAtlasRegion(string atlasAssetField = "") {
|
||||
public SpineAtlasRegion (string atlasAssetField = "") {
|
||||
this.atlasAssetField = atlasAssetField;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user