Dawn/assets/games/liminal/prefabs/EthPrefab.xml

49 lines
1.3 KiB
XML

<prefab name="EthPrefab" type="">
<asset type="texture" name="texture_eth_faces_day" ref="faceTexture" />
<asset type="texture" name="texture_eth_poses_day" ref="bodyTexture" />
<item>
<MeshRenderer />
<QuadMeshHost />
<SimpleBillboardedMaterial texture="faceTexture" ref="faceMaterial" />
<TiledSprite tile="0" ref="faceSprite" sizeType="TILED_SPRITE_SIZE_TYPE_HEIGHT_RATIO" size="0.5" />
</item>
<item>
<MeshRenderer />
<QuadMeshHost />
<SimpleBillboardedMaterial texture="bodyTexture" ref="bodyMaterial" />
<TiledSprite tile="0" ref="bodySprite" sizeType="TILED_SPRITE_SIZE_TYPE_HEIGHT_RATIO" size="0.5" />
</item>
<code type="properties">
TilesetGrid gridFace;
TilesetGrid gridBody;
StateProperty&lt;float_t&gt; alpha;
</code>
<code type="init">
alpha = 0.0f;
this->gridFace = TilesetGrid(
1, 9,
faceTexture->texture.getWidth(), faceTexture->texture.getHeight(),
0, 0,
0, 0
);
faceSprite->tileset = &amp;gridFace;
this->gridBody = TilesetGrid(
1, 5,
bodyTexture->texture.getWidth(), bodyTexture->texture.getHeight(),
0, 0,
0, 0
);
bodySprite->tileset = &amp;gridBody;
useEffect([&amp;]{
this->faceMaterial->color.a = alpha;
this->bodyMaterial->color.a = alpha;
}, alpha);
</code>
</prefab>