KeyboardLock | Just do | Keyboard library
kandi X-RAY | KeyboardLock Summary
kandi X-RAY | KeyboardLock Summary
Do you want to clean your keyboard? Just do it!.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of KeyboardLock
KeyboardLock Key Features
KeyboardLock Examples and Code Snippets
Community Discussions
Trending Discussions on KeyboardLock
QUESTION
Unity Error Show
StackOverflowException CheckWord.GettingLength (UnityEngine.GameObject obj) (at Assets/Scripts/Player/CheckWord.cs:906)
Function is getting inner child count of a game object:-
...ANSWER
Answered 2018-Jan-27 at 10:57Replace Destroy()
with DestroyImmediate()
in your script.
Here is a detailed explanation:
If you use the Destroy()
function to destroy a GameObject
, Unity doesn't destroy it right away. What it actually does is just mark it as null
and destroy it in later frames. So if you destroy a GameObject
in one frame, and query for the child count in exact the same frame, the number you get will not be decremented. If you do it with DestroyImmediate()
, the GameObject
, as it is marked in the function signature, will be immediately destroyed, and the child count will be decremented instantaneously.
In your case, the CreateWords()
function destroys the created letter object if there is already another letter same as the one you've created, and then call the function itself again. However, even if the letter object is destroyed, the child count still increases by 1. At last, the function will find that every panel has more than 6 letters (while actually there aren't), causing an infinite recursive loop which crash the program.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install KeyboardLock
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page