Created
November 18, 2024 09:00
-
-
Save thatalextaylor/b82ede78e005aaa34720a61ac0981118 to your computer and use it in GitHub Desktop.
Higher resolution Sprite Shapes than unity allows in the normal editor. Cranking it too high can lead to tesselation errors. If there are errors, turn it down a little.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.U2D; | |
[DisallowMultipleComponent] | |
public class HighResSpline : MonoBehaviour | |
{ | |
[Range(4,128)] | |
public int resolution = 16; | |
void Start() | |
{ | |
var controller = GetComponent<SpriteShapeController>(); | |
controller.splineDetail = resolution; | |
controller.colliderDetail = resolution; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment