SpriteRenderer SpriteRenderer=spriteToCrop. GetComponent
Sprite spriteToCropSprite=spriteRenderer. Sprite;
Texture2D spriteTexture=spriteToCropSprite. Texture;
for(int i=0; i <8; I++)
{
For (int j=0; J & lt; 8; J++)
{
Sprite newSprite=Sprite. The Create (spriteTexture, new the Rect (I * 64, j * 64, 64, 64), the new Vector2 (0.5 f to 0.5 f));
GameObject n=new GameObject ();
SpriteRenderer sr=n.a. ddComponent
The sr. Sprite=newSprite;
N.t ransform. Position=new Vector3 (I * 2, j * 2, 0).
N.t ransform. Parent=spriteToCrop. Transform;
}
CodePudding user response:
Do more than the game will use dynamic partitioning polygon Sprite, please directly!