This project was developed as part of the Programming Techniques I course in the Computer Science program. The application is a basic calculator, built using the Unity Engine, with the goal of applying fundamental concepts of object-oriented programming (OOP), programming logic, and graphical user interface development.
The calculator includes the following basic operations:
- Addition: Sum of two numbers.
- Subtraction: Difference between two numbers.
- Multiplication: Product of two numbers.
- Division: Quotient of two numbers (with division by zero handling).
- Reset: Clears values and resets the interface.
In addition to the basic operations, the project includes:
- Graphical User Interface (UI): Developed in Unity with buttons and dynamic displays to show numbers and operation results.
- Error Handling: Validation of invalid input and prevention of impossible operations (such as division by zero).
- Modular Code: Organized into separate scripts for operations and UI control, following good OOP practices.
- Unity Engine: Main tool used for project development.
- C#: Programming language used to write the calculator scripts.
- Unity UI: UI system used for buttons and calculator display.
-
Clone this repository to your local machine:
git clone https://github.com/pedroestevaodev/unity-calc-tp.git
-
Open the project in Unity:
- Open Unity Hub.
- Click "Add" and navigate to the cloned project folder.
-
Open the main scene:
- Navigate to the Assets/Scenes directory.
- Open the SampleScene scene.
-
Run the project in Unity by clicking Play.
-
Use the graphical interface to input numbers and perform operations.
- Click the number buttons to enter values.
- Use the operation buttons (+, -, *, /) to perform calculations.
- The C button clears the screen and resets the calculator.
This project provided an opportunity to apply concepts learned in the Programming Techniques I course, such as:
- Implementing basic algorithms in C#.
- Manipulating graphical interfaces using Unity UI.
- Using Unity as a tool for building non-game applications.
- Applying OOP concepts to modularize code and improve project maintainability.
This project is open to contributions. If you have suggestions for improvements or new features, feel free to open issues or submit pull requests.
Developed for academic purposes 🎓