- Home /
how back button works in unity calculator?
Hi, I am almost beginner in unity and trying to develop a calculator, but i am facing a problem with "Back Button". My Code For Back Button is:
public void Back_Button(){ screen.text = screen.text.Remove (screen.text.Length-1,1); } when i remove the digit at the required index,its removed. But the problem is that when i press another key e.g. 1,2,3. it restore the previous deleted key along with the new pressed key. for more brief i explain it as: suppose i type 12345 on calculator screen.when i remove 5 from right most side,its removed,and now if i type 6, its again restore the 5. i.e its generate 123456, but it should only generate 12346.
please help me in this regards. i will be thankful.
Your answer
Follow this Question
Related Questions
I have a problem putting ads 1 Answer
unity 2D with delay run and jump 0 Answers
Canvas Element become small on simulator 0 Answers
Bullet in editor does not behave the same in build. 1 Answer