android - Don't want TouchPhase.Ended to execute -



android - Don't want TouchPhase.Ended to execute -

i'm new unity,but still...:) here need: when tap on screen (press , release),my console should "do material" when move (touch,move,release),my console should lots of "do rotation" what have: when tap on screen (press , release),my console says "do material" when move (touch,move,release),my console says lots of "do rotation" , "do material" when release finger. pls help me figure out how stop executing touchphase.ended after touchphase.moved

if (input.touchcount == 1) { t = input.gettouch (0); if (t.phase == touchphase.moved ) debug.log ("do rotation"); if (t.phase == touchphase.ended && t.tapcount == 1 ) debug.log ("do material"); }

thank in advance quick response

if utilize bool can results looking for, im pretty sure havent tryed it, like

public bool touched = false; if (input.touchcount == 1) { t = input.gettouch (0); if(t.phase == touchphase.began){ touched = true; } if (t.phase == touchphase.moved ){ debug.log ("do rotation"); touched = false; } if (t.phase == touchphase.ended && t.tapcount == 1 && touched) debug.log ("do material"); }

android ios unity3d

Comments

Popular posts from this blog

java Multi query from Mysql using netbeans -

c# - DotNetZip fails with "stream does not support seek operations" -

c++ - StartServiceCtrlDispatcher don't can access 1063 error -