protected void Start() { if (this.levelObject != null) { return; } this.levelObject = new LevelObject(base.inspectablePosition, base.inspectableRotation, base.inspectableScale, 0, null, this.GUID, this.placementOrigin, this.instanceID, this.customMaterialOverride, true); if (this.levelObject.transform == null) { Debug.LogError(string.Concat(new object[] { "Failed to create LevelObject - GUID: ", this.GUID.ToString("N"), " InstanceID: ", this.instanceID, " Position: ", base.transform.position }), base.gameObject); this.levelObject = new LevelObject(base.inspectablePosition, base.inspectableRotation, base.inspectableScale, 0, null, new Guid("62f7de571873436a8c9a203e6304bd8a"), this.placementOrigin, this.instanceID, AssetReference <MaterialPaletteAsset> .invalid, true); } base.gameObject.tag = "Large"; base.gameObject.layer = this.levelObject.transform.gameObject.layer; this.levelObject.transform.parent = base.transform; this.levelObject.transform.localPosition = Vector3.zero; this.levelObject.transform.localRotation = Quaternion.identity; this.levelObject.transform.localScale = Vector3.one; if (this.levelObject.skybox != null) { this.levelObject.skybox.transform.parent = base.transform; this.levelObject.skybox.transform.localPosition = Vector3.zero; this.levelObject.skybox.transform.localRotation = Quaternion.identity; this.levelObject.skybox.transform.localScale = Vector3.one; } LevelObjects.registerDevkitObject(this.levelObject, out this.x, out this.y); }
protected void OnEnable() { LevelHierarchy.addItem(this); if (this.levelObject != null) { LevelObjects.registerDevkitObject(this.levelObject, out this.x, out this.y); } }