Menu Close

Addition Calculator in Unity | Add Two Numbers in Unity | Game Development Tutorial 18 | Urdu/Hindi

0 0
Read Time:24 Second

👉 Description: In this Video You’ll Learn Addition Calculator In Unity 3D . Also You’ll get an idea of making Complete Calculator.

C# Script For Addition Calculator:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;


public class Addition : MonoBehaviour
{
    [SerializeField] InputField field1, field2;
    [SerializeField] Text textView;

    public void Add()
    {
        int num1 = int.Parse(field1.text);
        int num2 = int.Parse(field2.text);
        int Ans = num1 + num2;
        textView.text = "Ans: " + Ans;
    }
}
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Related Posts

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

Your email address will not be published.

%d bloggers like this: