15 public SpriteRenderer
sr;
17 public SpriteRenderer
sr2;
21 public MaterialPropertyBlock
mpb;
23 public MaterialPropertyBlock
mpb2;
41 public virtual bool isPCC =>
false;
52 base.gameObject.SetActive(value:
true);
56 mpb =
new MaterialPropertyBlock();
61 sr.SetPropertyBlock(
mpb);
67 mpb2 =
new MaterialPropertyBlock();
73 if (Application.isEditor)
107 this.SetActive(enable:
true);
127 num = p.dir % 2 == 1;
134 tempV.x = p.x + data.offset.x + current.
offset.x;
135 tempV.y = p.y + data.offset.y + current.
offset.y;
136 tempV.z = p.z + data.offset.z + current.
offset.z;
143 tempV.x = (float)(
int)(tempV.x * 100f) * 0.01f;
144 tempV.y = (float)(
int)(tempV.y * 100f) * 0.01f;
145 tempV2.x = charaActorPCC.provider.vCurrent.source.size.x * current.
scale.x;
146 tempV2.y = charaActorPCC.provider.vCurrent.source.size.y * current.
scale.y;
147 tempV2.z = renderDataPcc._scale.z * current.
scale.z;
148 base.transform.localRotation = current.
rotation;
152 tempV2.x = originalScale.x * current.
scale.x;
153 tempV2.y = originalScale.y * current.
scale.y;
154 tempV2.z = originalScale.z * current.
scale.z;
160 sr2.transform.localPosition =
new Vector3(0f, -0.005f * floatY,
sr2.transform.localPosition.z);
173 else if (floatY < 3f)
181 num2 = ((floatV == 1) ? ((!(floatY < 0f)) ? ((floatY < 3f) ? 1 : 2) : 0) : ((!(floatY < 2f)) ? ((!(floatY < 5f)) ? 2 : 3) : 0));
184 base.transform.position =
tempV;
185 base.transform.localScale =
tempV2;
190 sr.SetPropertyBlock(
mpb);
193 if ((
bool)
sr2.sprite)
195 mpb2.SetTexture(
"_MainTex",
sr2.sprite.texture);
197 mpb2.SetTexture(
"_MaskTex",
sr.sprite.texture);
209 if (p.
snow && replacer.
suffixes.TryGetValue(
"_snow", out var value))
213 if (spriteData.
frame <= 1)
229 mpb.SetTexture(
"_MainTex",
sr.sprite.texture);
234 tempV.x = p.x + data.offsetBack.x + current.
offset.x;
235 tempV.y = p.y + data.offsetBack.y + current.
offset.y;
236 tempV.z = p.z + data.offsetBack.z + current.
offset.z;
260 sr2.transform.SetLocalScale(traitCanvas.Scale, traitCanvas.Scale, 1f);
261 mpb2.SetFloat(
"_PortraitFilterStrength", traitCanvas.UsePortraitFilter ? 1 : 0);
272 case Type.MultiSprite:
282 sr.flipX = dir == 1 || dir == 3;
283 mpb.SetTexture(
"_MainTex", sprite.texture);
284 Vector4 value =
new Vector4(sprite.textureRect.min.x / (
float)sprite.texture.width, sprite.textureRect.min.y / (
float)sprite.texture.height, sprite.textureRect.max.x / (
float)sprite.texture.width, sprite.textureRect.max.y / (
float)sprite.texture.height);
285 mpb.SetVector(
"_Rect", value);
286 mpb.SetFloat(
"_PixelHeight", sprite.rect.height);
291 if ((
bool)
sr2.sprite && (
bool)
sr2.sprite.texture)
293 sr2.flipX = dir == 1 || dir == 3;
297 _ = sprite.textureRect;
298 value =
new Vector4(sprite.textureRect.min.x / (
float)sprite.texture.width, sprite.textureRect.min.y / (
float)sprite.texture.height, sprite.textureRect.max.x / (
float)sprite.texture.width, sprite.textureRect.max.y / (
float)sprite.texture.height);
299 mpb2.SetTexture(
"_MainTex", sprite.texture);
300 mpb2.SetVector(
"_Rect", value);
301 mpb2.SetFloat(
"_PixelHeight", sprite.rect.height);
void SetVisible(bool enable)
virtual void OnRender(RenderParam p)
SpriteReplacerAnimation srAnime
MaterialPropertyBlock mpb2
virtual void RefreshSprite()
MaterialPropertyBlock mpb
virtual void OnSetOwner()
virtual void ReloadSprite()
SourceMaterial.Row material
virtual Sprite GetSprite(int dir=0)
virtual CardRow sourceCard
UD_String_MatData matColors
static float gameDeltaNoPause
static ColorProfile Colors
static void Despawn(Component c)
Dictionary< string, SpriteData > suffixes
bool HasSprite(string id, RenderData renderData=null)
static SubPassData Current
bool TryGetValue(TKey key, out TValue value)