Would Creating TIny Scripts which inherit monobehaviour adversly impact performance noticeably???

Example 1 – I have One Single player controller script which controls

  1. Player Movement
  2. Player health
  3. Player Score
  4. Player Animation
  5. Player Footstep sound

Example 2 — I have many player controller scripts which (probablyhave to) inherti monobehaviour but each are meant for separate concern

  1. Script 1 controls player movement
  2. Script 2 controlls animation
    3… Script 3 controlls player health death etc
    and so on …

So my question is in both above Examples

  1. Are they equivalent in performance
  2. Example 2 feels very easy to manage to me but concern is it noticeably less efficient than example 1 since each script inherits monobehaviour?
    Your thoughts and suggestions please,

Don’t pay any attention to performance just yet. Do what comes to you naturally. If you encounter some performance issues and you actually measure it and turns out that many scripts is a problem (doubt it… it needs to be a very big game with many objects), then you can refactor it later.

2 Likes

Ohh… I think I can split logic through use of partial class here too! :slight_smile: