This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
[RequireComponent(typeof(CharacterController))] | |
public class AdvancedCharacterController : MonoBehaviour | |
{ | |
[SerializeField] private float _speed = 5.0f; // Скорость передвижения персонажа | |
[SerializeField] private float _gravity = 9.8f; // Гравитация, влияющая на падение персонажа | |
[SerializeField] private float _jumpForce = 8.0f; // Сила прыжка персонажа | |
[SerializeField] private float _slopeForce = 5.0f; // Сила, добавляемая для движения по наклонным поверхностям | |
[SerializeField] private float _slopeRayLength = 1.5f; // Длина луча, используемая для определения наклонной поверхности |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class MathfAbsExample : MonoBehaviour | |
{ | |
[SerializeField] private int _number = -5; | |
private void Start() | |
{ | |
Debug.Log(Mathf.Abs(_number)); // выведет: 5 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class Vector3StaticMethods : MonoBehaviour | |
{ | |
[SerializeField] private Vector3 _vector1 = new Vector3(1f, 0f, 0f); | |
[SerializeField] private Vector3 _vector2 = new Vector3(0f, 1f, 0f); | |
private float _angle; | |
private void Start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class VectorOperations : MonoBehaviour | |
{ | |
[SerializeField] private Vector3 _vectorA; | |
[SerializeField] private Vector3 _vectorB; | |
[SerializeField] private Vector3 _vectorC; | |
private Vector3 _side1; | |
private Vector3 _side2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class VectorOperations : MonoBehaviour | |
{ | |
[SerializeField] private Vector3 _playerPosition = new Vector2(3, 1); | |
[SerializeField] private Vector3 _guardPosition = new Vector2(1, 2); | |
private float _dotResult; | |
private Vector3 _fieldOfView = new Vector2(1, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
[RequireComponent(typeof(BoxCollider))] | |
public class Block : MonoBehaviour | |
{ | |
public void Destroy() | |
{ | |
Destroy(gameObject); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class TrigonometricFunctions : MonoBehaviour | |
{ | |
[SerializeField] private Transform _obj; //объект, который будет двигаться | |
[SerializeField] private float _speed = 2.0f; | |
[SerializeField] private float _amplitudeX = 1.0f; | |
[SerializeField] private float _amplitudeY = 1.0f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Circumference : MonoBehaviour | |
{ | |
[SerializeField] private Transform _target; | |
[SerializeField] private List<Transform> _surrounders; | |
[SerializeField] private float _radius; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class AmbientListener : MonoBehaviour | |
{ | |
// Start is called before the first frame update | |
void Start() | |
{ | |