本文整理汇总了C#中VirtualMachine.ProgressProgramCounter方法的典型用法代码示例。如果您正苦于以下问题:C# VirtualMachine.ProgressProgramCounter方法的具体用法?C# VirtualMachine.ProgressProgramCounter怎么用?C# VirtualMachine.ProgressProgramCounter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VirtualMachine
的用法示例。
在下文中一共展示了VirtualMachine.ProgressProgramCounter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SkipText
/// <summary>
/// Skips the text.
/// </summary>
/// <param name='vm'>
/// Vm.
/// </param>
public override void SkipText( VirtualMachine vm )
{
if( vm.m_MsgTargetTextBox == null ){
ViNoDebugger.LogWarning( "Current ViNoTextBox is null." );
vm.ProgressProgramCounter( 1 );
return;
}
if( ! vm.m_MsgTargetTextBox.reachedEnd ){
vm.m_MsgTargetTextBox.DispTextQuick();
}
else{
// Stop Voice.
ISoundPlayer pl = ISoundPlayer.Instance;
if( pl != null ){
if( pl.IsPlayingVoice() ){
pl.StopVoice();
}
}
vm.ProgressProgramCounter( 1 );
}
}
示例2: HandleAOpcode
/*
public void HandleAOpcode( VM vm , byte op ){
vm.code = new byte[ 1 ];
vm.code[ 0 ] = op;
HandleOpcode( vm );
}
//*/
/// <summary>
/// Handles the opcode.
/// </summary>
/// <returns>
/// The opcode.
/// </returns>
/// <param name='vm'>
/// If set to <c>true</c> vm.
/// </param>
public override bool HandleOpcode( VirtualMachine vm )
{
m_Vm = vm;
switch( vm.code[ vm.pc ] ){
case OpcodeMessaging.PUNCH_POSITION: vm.scriptBinder.PUNCH_POSITION( vm ); break;
case OpcodeMessaging.SIZE: vm.scriptBinder.SIZE ( vm ); break;
case OpcodeMessaging.LOAD_IMAGE: vm.scriptBinder.LOAD_IMAGE( vm.tweenDataCached ); break;
case OpcodeMessaging.CHANGE_IMAGE: vm.scriptBinder.CHANGE_IMAGE( vm.tweenDataCached ); break;
case OpcodeMessaging.MSG_TARGET:
GameObject obj = vm.tweenDataCached.tweenTarget;
vm.scriptBinder.MSG_TARGET( obj );
break;
case OpcodeMessaging.SET_TEXT: vm.scriptBinder.SET_TEXT( vm ); break;
case OpcodeMessaging.SET_RESOURCE_AS_TEXTURE:
Texture2D image = vm.loadedResource as Texture2D;
MeshRenderer ren = vm.tweenDataCached.tweenTarget.GetComponent<MeshRenderer>();
if( ren != null ){
ren.sharedMaterial.mainTexture = image;
ren.transform.localScale = new Vector3( image.width , image.height , 1f );
// VinoSceneNode component is needed.
vm.tweenDataCached.tweenTarget.SendMessage( "OnChangeTexture" , vm.loadedResourcePath , SendMessageOptions.DontRequireReceiver );
}
else{
Debug.LogError( "MeshRenderer not Found." );
}
break;
case OpcodeMessaging.SET_RESOURCE_AS_TRANSITION_TEXTURE1:
image = vm.loadedResource as Texture2D;
ren = vm.tweenDataCached.tweenTarget.GetComponent<MeshRenderer>();
if( ren != null ){
ren.sharedMaterial.SetTexture( "_tex0" , image );
}
else{
Debug.LogError( "MeshRenderer not Found." );
}
break;
case OpcodeMessaging.SET_RESOURCE_AS_TRANSITION_TEXTURE2:
image = vm.loadedResource as Texture2D;
ren = vm.tweenDataCached.tweenTarget.GetComponent<MeshRenderer>();
if( ren != null ){
ren.sharedMaterial.SetTexture( "_tex1" , image );
}
else{
Debug.LogError( "MeshRenderer not Found." );
}
break;
case OpcodeMessaging.FADE_PANEL: vm.update = false; vm.scriptBinder.FADE_PANEL( vm.tweenDataCached ); break;
case OpcodeMessaging.CROSS_FADE: vm.update = false; vm.scriptBinder.CROSS_FADE( vm.tweenDataCached ); break;
case OpcodeMessaging.TWEEN: vm.update = false; vm.scriptBinder.TWEEN( vm.tweenDataCached ); break;
case OpcodeMessaging.DESTROY: GameObject.Destroy( vm.tweenDataCached.tweenTarget ); break;
case OpcodeMessaging.DESTROY_CHILDREN: ViNoGOExtensions.FindAndDestroyChildren( vm.messagingTargetName ); break;
case OpcodeMessaging.TARGET: vm.m_CurrTarget = GameObject.Find( VM.loadedTextLiteralString ); break;
case OpcodeMessaging.LOAD_LEVEL: Application.LoadLevel( VM.loadedTextLiteralString ); break;
case OpcodeMessaging.LOAD_SCENE_XML: vm.scriptBinder.LOAD_SCENE_XML( vm ); break;
case OpcodeMessaging.PLAY_SOUND:
if( ISoundPlayer.Instance == null ){
vm.ProgressProgramCounter(1);
ViNoDebugger.LogError( "VM" , "PLAY_SOUND : ISoundPlayer.Instance NOT FOUND." );
return false;
}
string soundName = vm.paramHash[ "name" ] as string;
string soundCat = vm.paramHash[ "category" ] as string;
string delayStr = vm.paramHash[ "delay" ] as string;
float delay = float.Parse( delayStr );
if( ISoundPlayer.Instance != null ){
ISoundPlayer.Instance.PlaySoundCallback( soundName , soundCat , 1f , delay );
}
break;
case OpcodeMessaging.STOP_SOUND:
if( ISoundPlayer.Instance == null ){
vm.ProgressProgramCounter(1);
ViNoDebugger.LogWarning( "ISoundPlayer.Instance NOT FOUND." );
return false;
}
soundName = vm.paramHash[ "name" ] as string;
soundCat = vm.paramHash[ "category" ] as string;
string fadeStr = vm.paramHash[ "fadeOutSeconds" ] as string;
float fadeOutSeconds = float.Parse( fadeStr );
//.........这里部分代码省略.........