UnityEditor.Undo in runtime - unity3d-editor

I want to know what such a UnityEditor.Undo Destroy, AddComponent functions, it operates correctly even on the device runtime.
For example the following code works fine in the editor on the PC. I wonder if this be the same result in the devices.
public void Click()
{
Undo.DestroyObjectImmediate(this.GetComponent<BoxCollider2D>());
}

The Undo class is from the UnityEditor namespace. This means that it won't work on any device or build. The only reason it is working now is because you are running it in the Editor.
Any Unity API that starts with UnityEditor will never work on any device or build. It is designed to allow programmers make a custom Editor plugin which runs on the Editor only.
Although, you can implement your own Undo class by using Stack.

Related

Define input type for Windows 10 touch keyboard from a JavaFX application

I have a working JavaFX app running on windows 10.
I would like to use the touch-keyboard in a similar to MSDN user input scope to change the touch keyboard
HOWEVER there is no way to interact with it. All textfieeds open the Default keyboard.
I would like to find the closest to JavaFX as possible solution.
Things I have tries so far:
Tried to use the WM_MESSAGE to trick the OS, see Here. This is a messy workaround that does not work on windows 10.
Encapsulating the WM_MESSAGE or InputScope object in an executable, and calling it from JNI only creates a one-way transition from app to keyboard. it will not suffice.
Using a custom keyboard or the JAvaFX touch keyboard (see here is not a valid solution as these keyboards look a bit messy, and they require some twirking we already know exist.
set-numeric-layout-for-windows-onscreen-keyboard-programmatically not working.
activating-touch-enabled-controls-in-javafx is irrelevant.

How to install a eventFilter to a WinOS window in Qt?

I have got the handle of a WinOS window,eg. Internet Explorer window, in Qt.I did it in this way:m_hwndUnderCursor= WindowFromPoint(curPoint);
How can I install a eventFilter to m_hwndUnderCursor by QWidget::find(m_hwndUnderCursor)->installEventFilter(this); successfully,so that I can watch m_hwndUnderCursor in Qt without HOOK technology.
I know because m_hwndUnderCursor a pointer to a WinOS window so QWidget::find(m_hwndUnderCursor) always return NULL.Is there a way to make it?
A quick answer is: you cannot do this.
A more detailed answer:
The QObject::installEventFilter() works basing on Qt's events engine (the event loop, events propagation, etc). This is Qt's internal stuff and this is not available to other windows, outside the Qt application. It will only work with windows that are part of the same application that you're calling installEventFilter() from.
For similar reason the QWidget::find() will never give you an existing QWidget in result if you try to find non-Qt window. It works only with windows created within your Qt application. Also see this: Can QWidget::find find widgets from a different process?
You will have to deal with it using native Windows API.

How to make own input method in Qt application?

I would like to make an input method which is used only for Qt desktop application.
It like Chinese(Pinyin) input method in windows. Include script processing, rendering of words.
As it includes rendering of words, it can't be created with Keyboard Layout.
More over, when built-in with application, it can be use cross over other platform.
But, It not like on-screen keyboard.
Thanks for all
The Qt way to implement this is to provide an input method plugin, see general plugin development docs and the input method specific base class.
With this you should be able to implement your own input method. Stuff like script processing and rendering is then up to your own plugin.

How to regenerate service super-class in Flash Builder

So my problem is exactly the same as this guy's here: http://www.pubbs.net/201003/flex/61462-flexcoders-flash-builder-super-class-regeneration.html , but unfortunately, he got no answer.
After initially generating service classes connecting with PHP, I modified the PHP, added new call specifically.
While the Data/Services window successfully made notice of the changes, including new function in the list, the service super-class didn't change whatsoever. Which baffles me, since all super-classes in generated service and valueObject packages contain an annotation like this:
This is a generated class and is not intended for modification. To customize behavior
of this service wrapper you may modify the generated sub-class of this class - SomethingService.as.
And also the sub-class contains something about "regeneration of the super-class". So obviously, my goal is to force the mentioned regeneration. Any thoughts?
Just had a similar problem and it was driving me nuts. In my case, I am using an Eclipse plug-in for Team Foundation Server (a source control repository). In TFS, files are kept read-only until you check them out. Usually when something behind the scenes tries to modify a file that I have open, the plug-in will check out the file automatically and let it make the changes. For some reason, it didn't in this case.
So for me, all I had to do was check out the file and it would then be able to regenerate (which translates to making the file writable for the rest of you who might have the same issue).
I find that most code generators work once to generate classes, but do not work well updating them. It's really hard (I've worked on them).
Can you correct your classes by hand?

How to pass custom variables to Flex applications

I'm trying to write an application where parameters have to be passed to the application. In Flex builder I modified the and tags in the index.template.html, but when debugging I still don't see the variables passed (using from as3 the Application.application.parameters object)...
after reading a post i found that I had made a stupid mistake. I had added the
"flashvars", "var1=blah&var2=blah..." to the first
AC_FL_RunContent() which installs the Flash Player. My bad. As soon
as I modified the index.template.html to add the "flashVars" to the
2nd AC_FL_RunContent(), it worked like a charm.

Resources