void Awake() { var components = GetComponents <MonoBehaviour>(); mainCamera = (IMainCamera)components.FirstOrDefault(x => x is IMainCamera); physicsControl = (IPhysicsControl)components.FirstOrDefault(x => x is IPhysicsControl); }
public PlayerMovement( IPlayer player, IPlayerSettings playerSettings, IInputManager inputManager, IMainCamera mainCamera) { this.player = player; this.playerSettings = playerSettings; this.inputManager = inputManager; this.mainCamera = mainCamera; }
private void Awake() => camera = GameObject.FindWithTag(Tags.MainCamera).GetComponent <IMainCamera>();
private void Awake() { camera = GameObject.FindWithTag(Tags.MainCamera).GetComponent <IMainCamera>(); spriteRenderer = GetComponent <SpriteRenderer>(); }