x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

父子界面的设置在使用偶尔会崩溃

我们做界面的时候,遇到一种崩溃的情况。具体是: 做了两个界面(A,B),我们将B设置为A的子界面(子窗口)。在独立窗口模式下运行游戏,主界面A加载完毕后,我们测试发现子界面B的构造函数并没有调用,但是子界面B这个对象又存在,接着对其进行数据操作就崩溃了。 我们现在用了如下一个方式来解决:重新做一个B1界面,逻辑和B完全一样,接着在设置为A的子界面,就OK了。但是目前我们也没有找到B界面的构造函数不调用的原因,以及如何避免这个问题的产生。

 (这个问题只发生于独立窗口中,编辑器中是没有问题的。)
Product Version: UE 4.14
Tags:
more ▼

asked Jan 23 '17 at 02:12 AM in Chinese

avatar image

zhangyuxing1980
26 1 2 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

这是因为子界面的行为本身并没有成为引用关系,以至于实际上子界面并没有被加载。gxy的第二种方式是比较常规的方法。使用时检测是否valid,不是的话构造创建。

more ▼

answered Feb 27 '17 at 10:04 AM

avatar image

Mi.Wang STAFF
150 12 4 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

也遇到过类似的问题,可以考虑的替代解决方式有两个,一个是在tick里Do Once的运行一遍构造函数,第二种方式是在A界面调用B界面的时候手动检测B界面是否valid,然后对于valid为否的情况创建并调用构造函数。

more ▼

answered Jan 23 '17 at 03:53 AM

avatar image

gxy
1 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question