Example #1
0
    void Awake()
    {
        var components = GetComponents <MonoBehaviour>();

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