C# Class CSharpInterpreter, CSharp-Interpreter-for-Unity-3D

Implements a hosting environment for the C# Interpreter as a Component that can be attached to a GameObject in Unity 3D.
Inheritance: MonoBehaviour, CSI.IConsole
显示文件 Open project: keyword/CSharp-Interpreter-for-Unity-3D Class Usage Examples

Public Properties

Property Type Description
bottomMargin float
includeAsset UnityEngine.Object
includeFile string
leftMargin float
maxHistorySize int
maxOutputLineCount int
maxOutputLineWidth int
maxOutputSize int
queuedAsset UnityEngine.Object
rightMargin float
showInteractiveGUI bool
showOutputAsEditorSelection bool
showOutputText bool
showTooltipText bool
splitterFraction float
toolboxWidth int
topMargin float

Public Methods

Method Description
AddGlobal ( string name, object value ) : object

Adds the specified global variable to the interpreter environment.

CSI ( CSI callback ) : void
ClearHistory ( ) : void
ClearHistory ( string &history ) : void
ClearOutput ( ) : void
ClearOutput ( string &outputText ) : void
ExecuteCode ( string inputText ) : bool

Execute the specified code in the interpreter environment.

ExecuteFile ( string inputFilename ) : bool

Execute the specified file in the interpreter environment.

GetHistory ( ) : string[]
GetLastExecuteResult ( ) : object
GetOutput ( ) : string
HasGlobal ( string name ) : bool
Invoke ( Action action ) : void

Implements a helper method that can be used to execute a statement and hide the result from the interpreter output windows.

IsEditorAvailable ( ) : bool
RemoveGlobal ( string name ) : bool
Select ( GameObject gameObject ) : bool
Select ( IEnumerable unityObjects ) : bool
Select ( Transform transform ) : bool
Select ( UnityEngine unityObject ) : bool
Select ( object obj ) : bool

Private Methods

Method Description
Awake ( ) : void
CSI ( ) : int
CSI ( string s ) : string
EnforceParameterLimits ( ) : void
ForceWarning ( string message ) : void
ForceWarning ( string message, UnityEngine context ) : void
GetAssetText ( object asset, string &assetName ) : string
GetDefaultIncludeFilename ( ) : string
GetFullPathOfAssembly ( Assembly assembly ) : string
OnDrawGUI ( ) : void

Called when the GUI needs to be drawn.

OnExecuteInput ( ) : void

Called when the input text need to be executed (e.g., when Enter is pressed).

OnGUI ( ) : void

Draws the GUI and execute its interaction logic; called by Unity on a frequent basis.

OnGetUnknownItem ( object key ) : object
OnMetaRequest ( ) : bool

Called when metadata should be displayed (e.g., when Alt+F1 is pressed).

OnNavigateHistory ( bool useTrueForOlderOrFalseForNewerOrNullForUndo ) : void

Called when the history needs ot be navigated (e.g., when the up-arrow, down-arrow or escape key is pressed).

PromptForInput ( string prompt ) : void
Reinitialize ( ) : bool

Performs initialization of this instance, which can be called at startup or in play mode when the Unity Editor rebuilds scripts.

Reset ( ) : void
ResolveFilename ( string filename ) : string
Select ( string selectionPropertyName, object selectionPropertyValue ) : bool
SetUnityEditorProperty ( string objectTypeName, string propertyName, object propertyValue ) : bool
Start ( ) : void

Performs one-time initialization of this instance; called by Unity.

Update ( ) : void

Perform the update logic; called by Unity on every frame.

Method Details

AddGlobal() public method

Adds the specified global variable to the interpreter environment.
public AddGlobal ( string name, object value ) : object
name string
value object
return object

CSI() public method

public CSI ( CSI callback ) : void
callback CSI
return void

ClearHistory() public method

public ClearHistory ( ) : void
return void

ClearHistory() public method

public ClearHistory ( string &history ) : void
history string
return void

ClearOutput() public method

public ClearOutput ( ) : void
return void

ClearOutput() public method

public ClearOutput ( string &outputText ) : void
outputText string
return void

ExecuteCode() public method

Execute the specified code in the interpreter environment.
public ExecuteCode ( string inputText ) : bool
inputText string
return bool

ExecuteFile() public method

Execute the specified file in the interpreter environment.
public ExecuteFile ( string inputFilename ) : bool
inputFilename string
return bool

GetHistory() public method

public GetHistory ( ) : string[]
return string[]

GetLastExecuteResult() public method

public GetLastExecuteResult ( ) : object
return object

GetOutput() public method

public GetOutput ( ) : string
return string

HasGlobal() public method

public HasGlobal ( string name ) : bool
name string
return bool

Invoke() public method

Implements a helper method that can be used to execute a statement and hide the result from the interpreter output windows.
public Invoke ( Action action ) : void
action Action The action delegate to be executed.
return void

IsEditorAvailable() public method

public IsEditorAvailable ( ) : bool
return bool

RemoveGlobal() public method

public RemoveGlobal ( string name ) : bool
name string
return bool

Select() public method

public Select ( GameObject gameObject ) : bool
gameObject GameObject
return bool

Select() public method

public Select ( IEnumerable unityObjects ) : bool
unityObjects IEnumerable
return bool

Select() public method

public Select ( Transform transform ) : bool
transform Transform
return bool

Select() public method

public Select ( UnityEngine unityObject ) : bool
unityObject UnityEngine
return bool

Select() public method

public Select ( object obj ) : bool
obj object
return bool

Property Details

bottomMargin public_oe property

public float bottomMargin
return float

includeAsset public_oe property

public Object,UnityEngine includeAsset
return UnityEngine.Object

includeFile public_oe property

public string includeFile
return string

leftMargin public_oe property

public float leftMargin
return float

maxHistorySize public_oe property

public int maxHistorySize
return int

maxOutputLineCount public_oe property

public int maxOutputLineCount
return int

maxOutputLineWidth public_oe property

public int maxOutputLineWidth
return int

maxOutputSize public_oe property

public int maxOutputSize
return int

queuedAsset public_oe property

public Object,UnityEngine queuedAsset
return UnityEngine.Object

rightMargin public_oe property

public float rightMargin
return float

showInteractiveGUI public_oe property

public bool showInteractiveGUI
return bool

showOutputAsEditorSelection public_oe property

public bool showOutputAsEditorSelection
return bool

showOutputText public_oe property

public bool showOutputText
return bool

showTooltipText public_oe property

public bool showTooltipText
return bool

splitterFraction public_oe property

public float splitterFraction
return float

toolboxWidth public_oe property

public int toolboxWidth
return int

topMargin public_oe property

public float topMargin
return float