So here is my set up, I am creating a stealth game in which part of the AI functions on timers. As an example, for chase, I have one public float called ChaseTimerSet where I can specify in the inspector how long I want the AI to be in this chase state while the player is not in their view, and another variable called float _chaseTimer that does the actual countdown. What I want however is for two things;
First is I only want ChaseTimerSet to be alterable outside of runtime, so nothing else outside of the script itself can change it.
Second, I want to make it so the only other script that can access and alter _chasetimer is a set of NPC states that takes in the NPC_Guard script containing everything as an argument to understand what it needs to do every frame.
I read one person suggesting that I create some private variables that just read the inspector visible ones on awake, but I want to see if there is a more elegant solution to this problem.
I thought of using Protected, but the state scripts do not derive from NPC_Guard.