8 public void SetOwnerAsChara()
10 this.owner = (this.owner as
Chara);
14 public override void OnSetOwner()
16 this.SetOwnerAsChara();
17 this.sr.sprite = this.owner.GetSprite(0);
18 this.mpb.SetTexture(
"_MainTex", this.sr.sprite.texture);
23 public override void NextFrame()
29 public override void RefreshSprite()
31 Sprite sprite = this.sr.sprite;
32 Texture2D texture = sprite.texture;
33 Rect textureRect = sprite.textureRect;
34 Vector4 value =
new Vector4(textureRect.x / (
float)texture.width, textureRect.min.y / (
float)texture.height, textureRect.max.x / (
float)texture.width, textureRect.max.y / (
float)texture.height);
35 this.mpb.SetVector(
"_Rect", value);
36 this.mpb.SetFloat(
"_PixelHeight", sprite.rect.height);
40 public new Chara owner;