Documentation
¶
Index ¶
Constants ¶
View Source
const ( OpReparent = "reparent" OpDelete = "delete" )
Op tags supported in a v2 ops[] patch. Mixing multiple ops in one patch is deliberately out of scope; a patch carries exactly one op.
View Source
const ( ReasonNeedPrefabGUID = "NEED_PREFAB_GUID" AppendOpAppend = "append" )
View Source
const FileSchemaVersion = 1
View Source
const FileSchemaVersionV2 = 2
FileSchemaVersionV2 is the ops[] patch schema introduced for structural scene mutations (S4a reparent). v1 (place_prefab append) and v2 (ops[]) coexist; readers dispatch on schema_version.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppendIntent ¶
type File ¶
type File struct {
SchemaVersion int `json:"schema_version"`
core.Result
PatchPlan PlacePrefabPlan `json:"patch_plan"` // v1 (place_prefab)
Ops []Op `json:"ops,omitempty"`
}
type Op ¶ added in v0.8.0
type Op struct {
Op string `json:"op"`
Target int64 `json:"target"`
NewParent int64 `json:"new_parent"`
OldParent int64 `json:"old_parent"`
Cascade bool `json:"cascade,omitempty"`
}
Op is one structural mutation in a v2 ops[] patch.
For reparent:
- Target is the Transform being moved.
- NewParent is its new m_Father (0 = move to scene root).
- OldParent is its current m_Father captured at plan time (0 = was at root).
For delete:
- Target is the GameObject being removed (its Transform and components go with it; NewParent/OldParent are unused and must be 0).
- Cascade removes the whole Transform subtree; without it, deleting an object that still has children is refused (would orphan them).
type PlacePrefabPlan ¶
type PlacePrefabPlan struct {
Status Status `json:"status"`
Reason string `json:"reason,omitempty"`
PrefabPath string `json:"prefab_path"`
PrefabGUID string `json:"prefab_guid,omitempty"`
Position bounds.Vec3 `json:"position"`
OverlapIDs []int64 `json:"overlap_ids"`
ReservedFileIDs []int64 `json:"reserved_file_ids"`
Appends []AppendIntent `json:"appends"`
}
func PlanPlacePrefab ¶
func PlanPlacePrefab(req PlacePrefabRequest) (PlacePrefabPlan, error)
type PlacePrefabRequest ¶
type PrefabReference ¶
type PrefabReference struct {
GUID string `json:"guid"`
}
Click to show internal directories.
Click to hide internal directories.