mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] Fix SkeletonGraphic.OverrideTexture.
This commit is contained in:
parent
4139546b87
commit
02d1bfc465
@ -122,11 +122,18 @@ namespace Spine.Unity {
|
|||||||
|
|
||||||
#region Internals
|
#region Internals
|
||||||
// This is used by the UI system to determine what to put in the MaterialPropertyBlock.
|
// This is used by the UI system to determine what to put in the MaterialPropertyBlock.
|
||||||
public Texture OverrideTexture { get; set; }
|
Texture overrideTexture;
|
||||||
|
public Texture OverrideTexture {
|
||||||
|
get { return overrideTexture; }
|
||||||
|
set {
|
||||||
|
canvasRenderer.SetTexture(value);
|
||||||
|
overrideTexture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
public override Texture mainTexture {
|
public override Texture mainTexture {
|
||||||
get {
|
get {
|
||||||
// Fail loudly when incorrectly set up.
|
// Fail loudly when incorrectly set up.
|
||||||
if (OverrideTexture != null) return OverrideTexture;
|
if (overrideTexture != null) return overrideTexture;
|
||||||
return skeletonDataAsset == null ? null : skeletonDataAsset.atlasAssets[0].materials[0].mainTexture;
|
return skeletonDataAsset == null ? null : skeletonDataAsset.atlasAssets[0].materials[0].mainTexture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user