--- tenth game began to write articles
Today mainly wrote these things:
Yesterday remaining a problem that backpack equipment -> Wear -> backpack worn equipment did not go away.
This is resolved after wearing the equipment, so the equipment worn by the disappearance of the code changes differences:
By the way also optimized some code writing.
But they encountered a problem backpack -> worn equipment -> bar equipment being replaced equipment -> equipment was replaced join backpack -> The equipment can not be replaced issue pop-up menu:
There are several reasons:
1, the type of equipment to join inconsistencies
2, the scene-based logic code sequence error
Solution to the problem:
1, the type of equipment to join inconsistencies
Inconsistent type of equipment to join, mainly before writing add functionality backpack, using a class is ItemInfo copy method, using a new Iteminfo to create a new object.
And now with the equipment category Equip, then there is a conflict. Before copying method can not be applied.
Finally, by reflection, with a string to generate a solution to the object.
TS string generated by an object, several of the online search, finally found a better solution.
2, the scene-based logic code sequence error
As for this problem, because of my personal mistakes, write code more, his mind a little chaos caused.
Ituri logic is correct, before I get this in reverse order of the two codes. . .
Before I write logic is:
Backpack article is worn -> to put on the role of equipment panel components and equipment -> Delete backpack worn items
This logic should be the fishes:
Backpack article is worn -> Delete backpack worn items -> to put on the role of equipment panel assembly equipment
This is the normal effect:
Today it first here.