CodePudding user response:
The code Chou Chou,CodePudding user response:
Isn't written traversal traversal all scenarios, should start from the roots of precast body traversal, each square a prefabricated bodyA better approach is to actually inside of child nodes directly into an array structure, direct deposit on precast body
Instead of each time to traverse the child nodes
CodePudding user response:
Prefabricated body is a a to generate and control the precast body,After fall below the control script is useless
Direct delete,
CodePudding user response:
Multiple objects bound to the same script, the script runs after is a different object.So you only need to write a field ids in the script, cloned objects, this ID assigned different values, respectively, and then you own distinction is which according to the ID, so that to avoid the synchronization (can be done only one operation, other uncontrolled with script)
This is a train of thought, can see understand?
CodePudding user response:
Prefab once created is relatively independent, can separateCodePudding user response:
Using a 2 d array, to describe the space distribution of cube, if is null, is empty, if not null, points to a square object,Write a Cube script, use made of prefabricated body to the Cube, the script has left/right/detection, mainly detect whether placed next to the other objects in 2 d array,
Write a Group, a script, which is used to describe a variety of shapes, shape formed by the Cube precast body, matrix or a 2 d array is used to describe the shape, the script has the function of the rotation of the Group,
This approach is easy to make a collision detection/destroyed,,
CodePudding user response:
Use a this just likeCodePudding user response:
Use a this just likeCodePudding user response:
Use a this just like