private void DestroyComponents()
 {
     this.sceneObjectForComponents?.Destroy();
     this.sceneObjectForComponents = null;
     this.blueprintRenderer        = null;
     this.tilesBlueprint           = null;
 }
Пример #2
0
        private void SetupComponents()
        {
            this.DestroyComponents();

            this.sceneObjectForComponents = Client.Scene.CreateSceneObject(
                $"Scene object for {nameof(ClientComponentObjectPlacementHelper)} components");

            this.sceneObjectForComponents
            .AddComponent <SceneObjectPositionSynchronizer>()
            .Setup(this.SceneObject);

            this.blueprintRenderer = new ClientBlueprintRenderer(
                this.sceneObjectForComponents,
                isConstructionSite: false,
                this.protoStaticWorldObject.SharedGetObjectCenterWorldOffset(null));

            this.blueprintRenderer.IsEnabled = false;
            this.tilesBlueprint = new ClientBlueprintTilesRenderer(this.sceneObjectForComponents);
            this.tilesBlueprint.Setup(this.protoStaticWorldObject.Layout);
            this.tilesBlueprint.IsEnabled = false;

            if (this.isDrawConstructionGrid)
            {
                ClientConstructionGridRendererHelper.Setup(this.sceneObjectForComponents,
                                                           this.protoStaticWorldObject);
            }
        }
Пример #3
0
        private void DestroyComponents()
        {
            this.sceneObjectForComponents?.Destroy();
            this.sceneObjectForComponents = null;
            this.blueprintRenderer        = null;
            this.tilesBlueprint           = null;

            ClientLandClaimAreaManager.RemoveBlueprintRenderer();
        }