Closed moepi2k closed 4 months ago
i found out that u need to have a scriptable setted up same like buildingentity and add to database like: https://gyazo.com/fcdc430984ff3d5d0ed7ab66f2e01bc3
when u dont do it the formulas never loaded. is it possible to do it without this extra step. i dont need all those building items for scene objects since the palyer are not able to build it anyway
You have to add formula data to game database, you may try to do it in awake function, that is it.
Ohh i see, call this in awake
public override void PrepareRelatesData()
{
base.PrepareRelatesData();
if (CacheItemCraftFormulas.Count > 0)
GameInstance.AddItemCraftFormulas(SourceId, CacheItemCraftFormulas.Values);
}
Will check when at pc, thanks you
mh the PrepareRelatesData is already called by gameinstance. so it should load the formulas to db.
Did you try to debug and make sure that it was called?
oh yea it never gets called O.o so why?
i put it in awake now and its working
It is because not all game entity will be listed in game instance an call the function by game instance.
I have a question regarding building stuff which are pre placed in scene like workbench. it works fine when its inherit from a buildingentity. but since my workbenchs are permanent and i wanna get rid of all the unneccesery stuff of syncfields like hp and so on i made a new class which inherit from basegameentity directly and only add the queuedworkbench part like
whith this i can interact with the workbench and the queued ui opens, but i dont get any formulas. formulas only loading when i inherit from buildingentity. can u lead me in the right way what i miss here?
thanks in advance