コード例 #1
0
	private void ExecuteChangeSpriteCommand(ChangeSpriteCommand command)
	{
        if (command.newSprite != null)
        {
            StartCoroutine(WaitForChangeSprite(command));
        }
    }
コード例 #2
0
        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();
        }
コード例 #3
0
 private IEnumerator WaitForChangeSprite(ChangeSpriteCommand command)
 {
     yield return new WaitForSeconds(command.delay);
     gameObject.GetComponent<SpriteRenderer>().sprite = command.newSprite;
 }
コード例 #4
0
 private static string GetCommandText(ChangeSpriteCommand command, MapInstance map)
 {
     return(Strings.EventCommandList.setsprite.ToString(command.Sprite));
 }