-
I have two entity which are identical. I have each separated sync script for ObjectA and ObjectB entity in project. ObjectA ---- > ObjectA.cs
ObjectB ---- > ObjectB.cs
Output is:
Instead of:
Problem is that derived classes are"sharing" parrent instances (obviously). Any suggestion how to solve this behaviour? Instead of coping content of ObjectBase to each script ? Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Can you share the code for your base class? |
Beta Was this translation helpful? Give feedback.
-
My code is horible and definitely needs some refactoring. I know I have private vars as static... Historical remains... Yes. I use lot of static so if it's problem It's good to know what consequences are. I will rewrite to non static approach with events. Clone of entity will not copy separate instance of script, right ? Thank you. |
Beta Was this translation helpful? Give feedback.
-
@manio143 Thank you so much. Static variables of course were the issue. |
Beta Was this translation helpful? Give feedback.
Can you share the code for your base class?
Component don't share state across instances unless you use static fields which then makes that state global.