mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[unity] Minor: example script documentation improved (CustomMaterialOverride).
This commit is contained in:
parent
dcb593489b
commit
689daa147a
@ -47,6 +47,13 @@ namespace Spine.Unity.Examples {
|
|||||||
MaterialPropertyBlock mpb;
|
MaterialPropertyBlock mpb;
|
||||||
|
|
||||||
void Start () {
|
void Start () {
|
||||||
|
// Use the code below to programmatically query the original material.
|
||||||
|
// Note: using MeshRenderer.material will fail since it creates an instance copy of the Material,
|
||||||
|
// MeshRenderer.sharedMaterial might also fail when called too early or when no Attachments
|
||||||
|
// are visible in the initial first frame.
|
||||||
|
if (originalMaterial == null)
|
||||||
|
originalMaterial = skeletonAnimation.SkeletonDataAsset.atlasAssets[0].PrimaryMaterial;
|
||||||
|
|
||||||
previousEnabled = replacementEnabled;
|
previousEnabled = replacementEnabled;
|
||||||
SetReplacementEnabled(replacementEnabled);
|
SetReplacementEnabled(replacementEnabled);
|
||||||
mpb = new MaterialPropertyBlock();
|
mpb = new MaterialPropertyBlock();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user