C# 클래스 SpriteExploder, Unity-2D-Destruction

상속: MonoBehaviour
파일 보기 프로젝트 열기: mjholtzem/Unity-2D-Destruction 1 사용 예제들

공개 메소드들

메소드 설명
GenerateTriangularPieces ( GameObject source, int extraPoints, int subshatterSteps, Material mat = null ) : List
GenerateVoronoiPieces ( GameObject source, int extraPoints, int subshatterSteps, Material mat = null ) : List

비공개 메소드들

메소드 설명
calcPivotCenterDiff ( GameObject target ) : Vector3

calculates the distance between the targets pivot and it's actual center

calcPolyColliderPoints ( List points, Vector2 offset ) : Vector2[]
calcTriangles ( Voronoi, region ) : int[]
calcUV ( Vector3 vertices, MeshRenderer mRend, Transform sTransform ) : Vector2[]
calcUV ( Vector3 vertices, SpriteRenderer sRend, Transform sTransform ) : Vector2[]

calculates the UV coordinates for the given vertices based on the provided Sprite

calcVerts ( Voronoi, region ) : Vector3[]
centerMeshPivot ( GameObject target, Vector3 diff ) : void

Sets the pivot of the target object to it's center

createFragmentMaterial ( GameObject source ) : Material
generateTriangularPiece ( GameObject source, List tri, Vector2 origVelocity, Vector3 origScale, Quaternion origRotation, Material mat ) : GameObject
generateVoronoiPiece ( GameObject source, List region, Vector2 origVelocity, Vector3 origScale, Quaternion origRotation, Material mat ) : GameObject
getPoints ( BoxCollider2D collider ) : List

generates a list of points from a box collider

getPoints ( PolygonCollider2D collider ) : List

generates a list of points from a polygon collider

getRect ( GameObject source ) : Rect

generates a rectangle based on the rendering bounds of the object

getRect ( List region ) : Rect
getRendererPoints ( GameObject source ) : List
getUVRange ( Vector2 &min, Vector2 &max, Vector2 uv ) : void
scaleRange ( float target, float oldMin, float oldMax, float newMin, float newMax ) : float
setFragmentMaterial ( GameObject newSprite, GameObject source ) : void

assigns a new material for a fragment

메소드 상세

GenerateTriangularPieces() 공개 정적인 메소드

public static GenerateTriangularPieces ( GameObject source, int extraPoints, int subshatterSteps, Material mat = null ) : List
source GameObject
extraPoints int
subshatterSteps int
mat Material
리턴 List

GenerateVoronoiPieces() 공개 정적인 메소드

public static GenerateVoronoiPieces ( GameObject source, int extraPoints, int subshatterSteps, Material mat = null ) : List
source GameObject
extraPoints int
subshatterSteps int
mat Material
리턴 List