- Home /
Question by
polite1233 · Dec 13, 2021 at 06:38 AM ·
touch controls
Unity New Input System on Android not receive touch event after execute time consuming function
this is demo vedio https://www.youtube.com/watch?v=2YeNwtXaC_0, the project is the New Input System Demo:Touch Sample I add a time consuming function:
public void DelayTime()
{
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
while (stopwatch.ElapsedTicks < 10000000)
{
var vector3 = new Vector3(1.0254452f, 1544.454f, 846.2342412f);
var magnitude = vector3.magnitude + vector3.sqrMagnitude;
magnitude += Vector3.Angle(Random.insideUnitSphere, Random.insideUnitSphere);
}
stopwatch.Stop();
}
When click the button,this function will be called.
The problem is when click the button one or more times,means android will freeze .When android freeze,I touch the screen a little times,and then the screen will never receive touch event from new input system.
qq图片20211213130857.png
(65.5 kB)
Comment
Your answer
Follow this Question
Related Questions
Dodgy Touch Controls / Performance Issues on iOS 1 Answer
Possible to get touch area data? 1 Answer
2D car game touch control 0 Answers
Trouble having character face direction moving 2 Answers
Shump Touch Control 1 Answer