public EditorActiveToolZones(
     ApplyToolDelegate onSelected,
     OnPointedZonesChangedDelegate onPointedZonesChanged,
     Action onReleaseInput = null)
     : base(onSelected, onReleaseInput: onReleaseInput, isReactOnRightMouseButton: true)
 {
     this.currentZonesWatcher = this.SceneObject.AddComponent <ClientComponentCurrentZonesWatcher>();
     this.currentZonesWatcher.Setup(this.Component, this, onPointedZonesChanged);
 }
 public void Setup(
     ApplyToolDelegate selectedCallback,
     Func <List <Vector2Ushort>, bool> validateCallback,
     bool isRepeatOnMove,
     Action inputReleasedCallback = null)
 {
     this.selectedCallback      = selectedCallback;
     this.inputReleasedCallback = inputReleasedCallback;
     this.validateCallback      = validateCallback;
     this.isRepeatOnMove        = isRepeatOnMove;
     this.material = RenderingMaterial.Create(new EffectResource("ConstructionBlueprint"));
     this.material.EffectParameters.Set(EffectParametersDefault);
 }
Exemple #3
0
        public EditorActiveToolTileBrush(
            [NotNull] ApplyToolDelegate onSelected,
            Func <List <Vector2Ushort>, bool> validateCallback = null,
            Action onDispose                  = null,
            bool isRepeatOnMove               = true,
            bool isReactOnRightMouseButton    = false,
            [CanBeNull] Action onReleaseInput = null)
        {
            this.onDispose = onDispose;

            this.SceneObject = Api.Client.Scene.CreateSceneObject("ActiveEditorToolBrush", Vector2D.Zero);
            this.Component   = this.SceneObject.AddComponent <ClientComponentEditorToolActiveTileBrush>();
            this.Component.Setup(onSelected, validateCallback, isRepeatOnMove, inputReleasedCallback: onReleaseInput);
            this.Component.IsReactOnRightMouseButton = isReactOnRightMouseButton;
        }