C# 클래스 TextSceneDeserializer, UnityTextScene

Class reading and populating a scene based on text-based scene files.
파일 보기 프로젝트 열기: terravision/UnityTextScene 1 사용 예제들

공개 메소드들

메소드 설명
Load ( string path ) : string

Loads a new scene from path. Path is absolute.

Load ( string path, TempSceneSaved callback ) : string
Load ( ) : void

Loads a TextScene into a clean scene. Will ask user for path.

LoadAdditive ( TextAsset asset, GameObject parent ) : void

Additively loads a TextScene. All objects from the TextScene will be children of the passed parent, if any. The TextScene will be added with a link to its original source asset, so it can easily be treated as a prefab, or scene-in-scene link.

LoadContext ( ) : void

Loads the currently selected TextScene. Will fail and notify user if the selected file is not a text file.

LoadNewScene ( string path ) : string
LoadNewScene ( string path, TempSceneSaved callback ) : string
LoadSafe ( string path ) : string
LoadScene ( string path ) : bool

Loads objects from TextScene file into the currently open scene.

비공개 메소드들

메소드 설명
AssignValue ( object comp, string fieldType, string fieldName, object parameter ) : void
ConvertFloat ( string s ) : float
Deserialize ( StreamReader stream, GameObject parent ) : void

Main function for deserializing the scene from file.

DeserializeGameObject ( StreamReader stream, string name, GameObject parent ) : void
DeserializePrefab ( StreamReader stream, string name, GameObject parent ) : void
DeserializeTextScene ( StreamReader stream, string name, GameObject parent ) : void
DeserializeTransform ( StreamReader stream, Transform transform ) : void
ProcessLine ( StreamReader stream, string line, GameObject parent ) : void
ProcessValueLine ( StreamReader stream, string name, object obj ) : bool
ReadComponentValue ( StreamReader stream, string fieldEditorType, string fieldObjectType, string fieldValue, object &parameter ) : bool
SetupBuiltinMeshes ( ) : void

Instantiates and destroys the built-in primitives so we can get a reference to their meshes. FIXME: It would be a lot better if we could get these mesh references in a less hack-ish way!

TextSceneDeserializer ( ) : System.Collections.Generic
TextSceneDeserializer ( GameObject container ) : System.Collections.Generic
TextSceneDeserializer ( GameObject container, string recursionGuard ) : System.Collections.Generic

메소드 상세

Load() 공개 정적인 메소드

Loads a new scene from path. Path is absolute.
public static Load ( string path ) : string
path string
리턴 string

Load() 공개 정적인 메소드

public static Load ( string path, TempSceneSaved callback ) : string
path string
callback TempSceneSaved
리턴 string

Load() 공개 정적인 메소드

Loads a TextScene into a clean scene. Will ask user for path.
public static Load ( ) : void
리턴 void

LoadAdditive() 공개 정적인 메소드

Additively loads a TextScene. All objects from the TextScene will be children of the passed parent, if any. The TextScene will be added with a link to its original source asset, so it can easily be treated as a prefab, or scene-in-scene link.
public static LoadAdditive ( TextAsset asset, GameObject parent ) : void
asset UnityEngine.TextAsset
parent GameObject
리턴 void

LoadContext() 공개 정적인 메소드

Loads the currently selected TextScene. Will fail and notify user if the selected file is not a text file.
public static LoadContext ( ) : void
리턴 void

LoadNewScene() 공개 메소드

public LoadNewScene ( string path ) : string
path string
리턴 string

LoadNewScene() 공개 메소드

public LoadNewScene ( string path, TempSceneSaved callback ) : string
path string
callback TempSceneSaved
리턴 string

LoadSafe() 공개 정적인 메소드

public static LoadSafe ( string path ) : string
path string
리턴 string

LoadScene() 공개 메소드

Loads objects from TextScene file into the currently open scene.
public LoadScene ( string path ) : bool
path string
리턴 bool