C# 클래스 RTSObjectFactory, ES2015C

Utility class used to easily get prefab references for the various objects available in the game.
파일 보기 프로젝트 열기: jgirald/ES2015C

공개 메소드들

메소드 설명
GetObjectCost ( RTSObjectType type, PlayerCivilization civilization ) : int

Get the cost of creating the specified object for the specified civilization.

GetObjectIconSprite ( RTSObjectType type, PlayerCivilization civilization ) : Sprite

Get the preview icon sprite the specified object for the specified civilization.

GetObjectTemplate ( RTSObjectType type, PlayerCivilization civilization, bool useFallback = false ) : GameObject

Get the default object resource prefab for the specified civilization.

PrintAvailableObjectTable ( StreamWriter sw ) : void

Prints a table to the log showing which objects are available for each civilization.

비공개 메소드들

메소드 설명
GetObjectInfo ( RTSObjectType type, PlayerCivilization civilization ) : ObjectInfo,

Memoize, if required, the information for the specified object and civilization which is initialized on the start script.

LoadAndCheckPrefab ( string prefabPath, bool warnNotExisting ) : GameObject

Loads a prefab (as in Resources.Load) and checks that the prefab is correctly configured.

메소드 상세

GetObjectCost() 공개 정적인 메소드

Get the cost of creating the specified object for the specified civilization.
public static GetObjectCost ( RTSObjectType type, PlayerCivilization civilization ) : int
type RTSObjectType The type of the object to create.
civilization PlayerCivilization The civilization of the object to create.
리턴 int

GetObjectIconSprite() 공개 정적인 메소드

Get the preview icon sprite the specified object for the specified civilization.
public static GetObjectIconSprite ( RTSObjectType type, PlayerCivilization civilization ) : Sprite
type RTSObjectType The type of the object.
civilization PlayerCivilization The civilization of the object.
리턴 Sprite

GetObjectTemplate() 공개 정적인 메소드

Get the default object resource prefab for the specified civilization.
public static GetObjectTemplate ( RTSObjectType type, PlayerCivilization civilization, bool useFallback = false ) : GameObject
type RTSObjectType The type of object to load.
civilization PlayerCivilization The civilization of the player.
useFallback bool If resource is not available for given civilization, return an equivalent for another civilization.
리턴 GameObject

PrintAvailableObjectTable() 공개 정적인 메소드

Prints a table to the log showing which objects are available for each civilization.
public static PrintAvailableObjectTable ( StreamWriter sw ) : void
sw StreamWriter
리턴 void