Class Sprite
스프라이트를 생성 및 출력해주는 클래스
네임스페이스: Game.Scripts.Graphics
어셈블리: Assembly-CSharp.dll
Syntax
[MoonSharpUserData]
public class Sprite : ScriptTweening
생성자
Sprite()
스프라이트를 생성 및 출력해주는 클래스
선언
protected Sprite()
변수
_go
스프라이트를 생성 및 출력해주는 클래스
선언
protected GameObject _go
필드 값
타입 | 설명 |
---|---|
UnityEngine.GameObject |
_originSize
스프라이트를 생성 및 출력해주는 클래스
선언
protected Vector2 _originSize
필드 값
타입 | 설명 |
---|---|
UnityEngine.Vector2 |
_renderer
스프라이트를 생성 및 출력해주는 클래스
선언
protected SpriteRenderer _renderer
필드 값
타입 | 설명 |
---|---|
UnityEngine.SpriteRenderer |
_rt
스프라이트를 생성 및 출력해주는 클래스
선언
protected RectTransform _rt
필드 값
타입 | 설명 |
---|---|
UnityEngine.RectTransform |
프로퍼티
color
스프라이트 색상
선언
public Color color { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
Color |
flipX
스프라이트 X축 플립
선언
public bool flipX { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
bool |
flipY
스프라이트 Y축 플립
선언
public bool flipY { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
bool |
height
스프라이트의 세로 크기
선언
public float height { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
float |
pivotX
스프라이트의 피벗값 X
선언
public float pivotX { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
float |
pivotY
스프라이트의 피벗값 Y
선언
public float pivotY { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
float |
sortOrder
출력 순서 지정 값이 높아지면 먼저 출력
선언
public int sortOrder { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
int |
width
스프라이트의 가로 크기
선언
public float width { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
float |
x
스프라이트의 위치 X
선언
public float x { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
float |
y
스프라이트의 위치 Y
선언
public float y { get; set; }
프로퍼티 값
타입 | 설명 |
---|---|
float |
함수
__pairs(Sprite)
스프라이트를 생성 및 출력해주는 클래스
선언
[MoonSharpUserDataMetamethod("__pairs")]
public static DynValue __pairs(Sprite self)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
Sprite | self |
반환
타입 | 설명 |
---|---|
MoonSharp.Interpreter.DynValue |
AttachToUnit(Point, Unit)
유닛에 스프라이트 추가하기
선언
public void AttachToUnit(Point position, Unit unit)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
Point | position | 생성될 위치 |
Unit | unit | 대상 유닛 |
AttachToUnitID(Point, long)
유닛에 스프라이트 추가하기
선언
public void AttachToUnitID(Point position, long id)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
Point | position | 생성될 위치 |
long | id | 유닛ID |
CreateGameObject(Sprite, Rect)
스프라이트를 생성 및 출력해주는 클래스
선언
protected void CreateGameObject(Sprite sprite, Rect rect)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
UnityEngine.Sprite | sprite | |
Rect | rect |
Destroy()
스프라이트 오브젝트를 제거
선언
public void Destroy()
DOColor(Color, float)
색깔을 target의 색깔로 duration 동안 바꾼다.
선언
public virtual ScriptTweener DOColor(Color target, float duration)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
Color | target | 바꿀 컬러 |
float | duration | 시간 (초) |
반환
타입 | 설명 |
---|---|
ScriptTweener |
New(string, Rect)
Sprite 생성하기
선언
public static Sprite New(string path, Rect rect = null)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
string | path | Sprite 경로 |
Rect | rect | Rect 범위 |
반환
타입 | 설명 |
---|---|
Sprite |
연산자
implicit operator Sprite(DropItem)
스프라이트를 생성 및 출력해주는 클래스
선언
public static implicit operator Sprite(DropItem dropItem)
매개 변수(인자)
타입 | 이름 | 설명 |
---|---|---|
DropItem | dropItem |
반환
타입 | 설명 |
---|---|
Sprite |