This file contains hidden or 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; | |
class CharController : MonoBehaviour | |
{ | |
//Ссылка на компонент - CharacterController | |
public static CharacterController unityController; | |
//Ссылка на себя - на класс CharController | |
public static CharController instance; | |
//Результат - вектор движения. | |
public Vector3 move; |
This file contains hidden or 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
public class CharMotor : MonoBehaviour | |
{ | |
public static CharMotor instance; | |
public float speed = 10.0f; | |
void Awake() | |
{ | |
instance = this; | |
} |
This file contains hidden or 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; | |
class CharTPSCamera : MonoBehaviour | |
{ | |
public static CharTPSCamera instance; | |
public Transform target; | |
void Awake() | |
{ |
This file contains hidden or 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; | |
class CharTPSCamera : MonoBehaviour | |
{ | |
public static CharTPSCamera instance; | |
public Transform target; | |
public float Distance { get; set; } | |
//Минимальное расстояние от камеры до персонажа. |
This file contains hidden or 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; | |
class CharTPSCamera : MonoBehaviour | |
{ | |
public static CharTPSCamera instance; | |
public Transform target; | |
public float Distance { get; set; } |
This file contains hidden or 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; | |
class CharTPSCamera : MonoBehaviour | |
{ | |
public static CharTPSCamera instance; | |
public Transform target; | |
public float Distance { get; set; } |
This file contains hidden or 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; | |
class CharTPSCamera : MonoBehaviour | |
{ | |
public static CharTPSCamera instance; | |
public Transform target; | |
public float Distance { get; set; } |
This file contains hidden or 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
//Говорим CharMotor, что пора двигаться | |
CharMotor.instance.UpdateMotor(move); |
This file contains hidden or 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
/// <summary> | |
/// Делегат, представляющий метод обработки события. | |
/// </summary> | |
/// <param name="sender">Объект, вызвавший это событие</param> | |
/// <param name="data">Данные для обработки события.</param> | |
public delegate void EventHandler(object sender, object data); | |
//[Serializable] | |
public class Messenger | |
{ |