Files
hw-pixelone-course-creating…/HW02 - Base programming/Assets/Scripts/Hw2P1.cs
2023-06-11 00:35:07 +03:00

21 lines
886 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
public class Hw2P1 : MonoBehaviour {
public int sideOfSquare = 2;
public int sideAofRectangle = 3;
public int sideBOfRectangle = 4;
public float circleRadius = 3.5f;
// Start is called before the first frame update
void Start() {
int squareArea = sideOfSquare * sideOfSquare;
int rectangleArea = sideAofRectangle * sideBOfRectangle;
float circleArea = Mathf.PI * circleRadius * circleRadius;
Debug.Log($"Площадь квадрата со стороной {sideOfSquare} равна {squareArea}");
Debug.Log($"Площадь прямоугольника сооронами A = {sideAofRectangle} и B = {sideBOfRectangle} равна {rectangleArea}");
Debug.Log($"Площадь окружности с радиусом R = {circleRadius} равна {circleArea}");
}
}