private void ExecuteChangeSpriteCommand(ChangeSpriteCommand command) { if (command.newSprite != null) { StartCoroutine(WaitForChangeSprite(command)); } }
public EventCommandChangeSprite(ChangeSpriteCommand refCommand, FrmEvent editor) { InitializeComponent(); mMyCommand = refCommand; mEventEditor = editor; InitLocalization(); cmbSprite.Items.Clear(); cmbSprite.Items.AddRange( GameContentManager.GetSmartSortedTextureNames(GameContentManager.TextureType.Entity) ); if (cmbSprite.Items.IndexOf(mMyCommand.Sprite) > -1) { cmbSprite.SelectedIndex = cmbSprite.Items.IndexOf(mMyCommand.Sprite); } else { cmbSprite.SelectedIndex = 0; } UpdatePreview(); }
private IEnumerator WaitForChangeSprite(ChangeSpriteCommand command) { yield return new WaitForSeconds(command.delay); gameObject.GetComponent<SpriteRenderer>().sprite = command.newSprite; }
private static string GetCommandText(ChangeSpriteCommand command, MapInstance map) { return(Strings.EventCommandList.setsprite.ToString(command.Sprite)); }