Exemplo n.º 1
0
    private void Start()
    {
        sys  = FindObjectOfType <WindowSystem>();
        pref = FindObjectOfType <PrefabManager>();

        LocalDataManager.instance.OnCorporationChange += OnCorpChange;

        ToolButton corp = Instantiate(buttonPrefab, buttonGrid);

        corp.SetTitle("Corp");
        corp.GetComponent <Button>().onClick.AddListener(() => OnShowCorpClic());

        ToolButton ships = Instantiate(buttonPrefab, buttonGrid);

        ships.SetTitle("Ships");
        ships.GetComponent <Button>().onClick.AddListener(() => OnMyShipClic());
        _buttonNeedingCorp.Add(ships);

        ToolButton stations = Instantiate(buttonPrefab, buttonGrid);

        stations.SetTitle("Stations");
        stations.GetComponent <Button>().onClick.AddListener(() => OnStationsClic());
        _buttonNeedingCorp.Add(stations);

        ToolButton market = Instantiate(buttonPrefab, buttonGrid);

        market.SetTitle("Market");
        market.GetComponent <Button>().onClick.AddListener(() => OnMarketClic());
        _buttonNeedingCorp.Add(market);

        ToolButton bookmarks = Instantiate(buttonPrefab, buttonGrid);

        bookmarks.SetTitle("Places");
        bookmarks.GetComponent <Button>().onClick.AddListener(() => OnBookmarkClic());
        _buttonNeedingCorp.Add(bookmarks);

        ToolButton plans = Instantiate(buttonPrefab, buttonGrid);

        plans.SetTitle("Plans");
        plans.GetComponent <Button>().onClick.AddListener(() => OnPlanClick());
        _buttonNeedingCorp.Add(plans);

        mailButton = Instantiate(buttonPrefab, buttonGrid);
        mailButton.SetTitle("Mails");
        mailButton.GetComponent <Button>().onClick.AddListener(() => OnMailsClic());
        LocalDataManager.instance.OnMailboxChange += (m) => { mailButton.SetBlinking(true); };
        _buttonNeedingCorp.Add(mailButton);

        ToolButton options = Instantiate(buttonPrefab, buttonGrid);

        options.SetTitle("Menu");
        options.GetComponent <Button>().onClick.AddListener(() => OnMenuClic());

        ToolButton console = Instantiate(buttonPrefab, buttonGrid);

        console.SetTitle("Console");
        console.GetComponent <Button>().onClick.AddListener(() => OnConsoleClic());

        OnCorpChange(null);
    }
Exemplo n.º 2
0
        public void DoShowBegin(TransitionBase transition, TransitionInputParameters transitionParameters, AppearanceParameters parameters)
        {
            var needToPlay = (this.id > 0 || this.playType == PlayType.Replace);

            if (this.playType == PlayType.Replace)
            {
                WindowSystem.AudioStop(null, this.clipType, this.id);
            }

            if (transition != null)
            {
                if (needToPlay == true)
                {
                    WindowSystem.AudioPlay(this.window, this.clipType, this.id, this.playType == PlayType.Replace);
                    transition.SetResetState(transitionParameters, this.window, null);
                    transition.Play(null, this.window, transitionParameters, forward: true, callback: () => {
                        parameters.Call();
                    });
                }
            }
            else
            {
                if (needToPlay == true)
                {
                    WindowSystem.AudioPlay(this.window, this.clipType, this.id, this.playType == PlayType.Replace);
                }
                parameters.Call();
            }
        }
    /// <summary>
    /// Initializes a new instance of the <see cref="XIVComboExpandedPlugin"/> class.
    /// </summary>
    /// <param name="pluginInterface">Dalamud plugin interface.</param>
    public XIVComboExpandedPlugin(DalamudPluginInterface pluginInterface)
    {
        FFXIVClientStructs.Resolver.Initialize();

        pluginInterface.Create <Service>();

        Service.Configuration = pluginInterface.GetPluginConfig() as PluginConfiguration ?? new PluginConfiguration();
        Service.Address       = new PluginAddressResolver();
        Service.Address.Setup();

        if (Service.Configuration.Version == 4)
        {
            this.UpgradeConfig4();
        }

        Service.ComboCache   = new CustomComboCache();
        Service.IconReplacer = new IconReplacer();

        this.configWindow = new();
        this.windowSystem = new("XIVComboExpanded");
        this.windowSystem.AddWindow(this.configWindow);

        Service.Interface.UiBuilder.OpenConfigUi += this.OnOpenConfigUi;
        Service.Interface.UiBuilder.Draw         += this.windowSystem.Draw;

        Service.CommandManager.AddHandler(Command, new CommandInfo(this.OnCommand)
        {
            HelpMessage = "Open a window to edit custom combo settings.",
            ShowInHelp  = true,
        });
    }
Exemplo n.º 4
0
        public void Create(WindowBase window, Transform root, float depth, int raycastPriority, int orderInLayer)
        {
            var instance = this.layout.Spawn();

            instance.transform.SetParent(root);
            instance.transform.localPosition = Vector3.zero;
            instance.transform.localRotation = Quaternion.identity;
            instance.transform.localScale    = Vector3.one;

            var rect = instance.transform as RectTransform;

            rect.sizeDelta        = (this.layout.transform as RectTransform).sizeDelta;
            rect.anchoredPosition = (this.layout.transform as RectTransform).anchoredPosition;

            var layoutPreferences = this.layoutPreferences;

            if (this.allowCustomLayoutPreferences == true)
            {
                layoutPreferences = WindowSystem.GetCustomLayoutPreferences() ?? this.layoutPreferences;
            }

            instance.Setup(window);
            instance.Init(depth, raycastPriority, orderInLayer);
            instance.SetLayoutPreferences(this.scaleMode, this.fixedScaleResolution, layoutPreferences);

            this.instance = instance;

            foreach (var component in this.components)
            {
                component.Create(window, instance.GetRootByTag(component.tag));
            }
        }
        private void Update_EDITOR(UnityEngine.UI.Windows.WindowLayout _target)
        {
            foreach (var element in _target.elements)
            {
                element.OnValidateEditor();
            }

            #region COMPONENTS
            _target.canvas    = ME.Utilities.FindReferenceChildren <Canvas>(_target);
            _target.raycaster = ME.Utilities.FindReferenceChildren <UnityEngine.EventSystems.BaseRaycaster>(_target);
            #endregion

            _target.initialized = (_target.canvas != null);

            #region SETUP
            if (_target.initialized == true)
            {
                WindowSystem.ApplyToSettings(_target.canvas);

                // Raycaster
                if ((_target.raycaster as GraphicRaycaster) != null)
                {
                    (_target.raycaster as GraphicRaycaster).GetType().GetField("m_BlockingMask", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).SetValue((_target.raycaster as GraphicRaycaster), (LayerMask)(1 << _target.gameObject.layer));
                }
            }
            #endregion
        }
        private IEnumerator InitModules(WindowBase window, System.Action onComplete)
        {
            var resources  = WindowSystem.GetResources();
            var targetData = WindowSystem.GetTargetData();

            for (int i = 0; i < this.modules.Length; ++i)
            {
                var moduleInfo = this.modules[i];
                if (moduleInfo.targets.IsValid(targetData) == false)
                {
                    continue;
                }
                if (moduleInfo.moduleInstance != null)
                {
                    continue;
                }

                var          order    = moduleInfo.order;
                WindowModule instance = null;
                yield return(resources.LoadAsync <WindowModule>(window, moduleInfo.module, (asset) => {
                    instance = WindowSystem.GetPools().Spawn(asset, window.transform);
                    instance.Setup(window);
                    instance.SetCanvasOrder(window.GetCanvasOrder() + order);
                    window.RegisterSubObject(instance);
                }));

                moduleInfo.moduleInstance = instance;
                this.modules[i]           = moduleInfo;
            }

            onComplete.Invoke();
        }
Exemplo n.º 7
0
    public void LateUpdate()
    {
        if (WindowSystem.IsUIHovered() == true)
        {
            return;
        }

        if (this.cam == null)
        {
            this.cam = Camera.main;
        }
        if (this.cam == null)
        {
            return;
        }

        var        ray = this.cam.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, 100f, 1 << this.gameObject.layer) == true && hit.collider.GetComponent <Example3DHover>() == this)
        {
            if (this.tip == null)
            {
                this.tip = WindowSystem.Show <UIWindowExampleTip>(this.hoverText) as TipWindowType;
                this.tip.OnHover(this.transform, hit.point, this.cam, this.offset);
            }
        }
        else if (this.tip != null)
        {
            this.tip.Hide();
            this.tip.OnLeave();
            this.tip = null;
        }
    }
Exemplo n.º 8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SomethingNeedDoingPlugin"/> class.
        /// </summary>
        /// <param name="pluginInterface">Dalamud plugin interface.</param>
        public SomethingNeedDoingPlugin(DalamudPluginInterface pluginInterface)
        {
            pluginInterface.Create <Service>();

            ClickLib.Click.Initialize();

            Service.Plugin        = this;
            Service.Configuration = SomethingNeedDoingConfiguration.Load(pluginInterface.ConfigDirectory);

            Service.ChatManager      = new ChatManager();
            Service.GameEventManager = new GameEventManager();
            Service.MacroManager     = new MacroManager();

            this.macroWindow  = new();
            this.helpWindow   = new();
            this.windowSystem = new("SomethingNeedDoing");
            this.windowSystem.AddWindow(this.macroWindow);
            this.windowSystem.AddWindow(this.helpWindow);

            Service.Interface.UiBuilder.Draw         += this.windowSystem.Draw;
            Service.Interface.UiBuilder.OpenConfigUi += this.OnOpenConfigUi;
            Service.CommandManager.AddHandler(Command, new CommandInfo(this.OnChatCommand)
            {
                HelpMessage = "Open a window to edit various settings.",
                ShowInHelp  = true,
            });
        }
Exemplo n.º 9
0
        private void Update_EDITOR(UnityEngine.UI.Windows.WindowLayout _target)
        {
            foreach (var element in _target.elements)
            {
                element.Update_EDITOR();
            }

            #region COMPONENTS
            _target.canvas = _target.GetComponentsInChildren <Canvas>(true)[0];
            var raycasters = _target.GetComponentsInChildren <UnityEngine.EventSystems.BaseRaycaster>(true);
            if (raycasters != null && raycasters.Length > 0)
            {
                _target.raycaster = raycasters[0];
            }
            #endregion

            _target.initialized = (_target.canvas != null);

            #region SETUP
            if (_target.initialized == true)
            {
                WindowSystem.ApplyToSettings(_target.canvas);

                // Raycaster
                if ((_target.raycaster as GraphicRaycaster) != null)
                {
                    (_target.raycaster as GraphicRaycaster).GetType().GetField("m_BlockingMask", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).SetValue((_target.raycaster as GraphicRaycaster), (LayerMask)(1 << _target.gameObject.layer));
                }
            }
            #endregion
        }
Exemplo n.º 10
0
        public void Init()
        {
            if (this.canvas != null && this.windowObject != null && this.windowObject.GetWindow() == null)
            {
                WindowSystem.GetEvents().Register(this.windowObject, WindowEventType.OnShowBegin, this.Init);
                WindowSystem.GetEvents().Register(this.windowObject, WindowEventType.OnWindowActive, this.Init);
                return;
            }

            WindowSystem.GetEvents().Unregister(this.windowObject, WindowEventType.OnShowBegin, this.Init);
            WindowSystem.GetEvents().Unregister(this.windowObject, WindowEventType.OnWindowActive, this.Init);

            var raycasterTemp = false;

            if (this.canvas != null && this.windowObject != null)
            {
                var window = this.windowObject.GetWindow();
                if (window == null)
                {
                                        #if UNITY_EDITOR
                    Debug.LogWarning("[ CanvasLinker ] WindowObject::GetWindow() is null", this);
                                        #endif
                    return;
                }

                //Debug.Log("[ CanvasLinker ] Initialized", this);

                this.canvas.overrideSorting  = true;
                this.canvas.sortingLayerName = window.GetSortingLayerName();
                this.canvas.sortingOrder     = window.GetSortingOrder() + this.orderDelta;

                if (this.overridePixelPerfect == true)
                {
                    this.canvas.overridePixelPerfect = true;
                    this.canvas.pixelPerfect         = this.pixelPrefect;
                }

                if (this.raycasterSource == null)
                {
                    this.raycasterSource = (window as LayoutWindowType).GetCurrentLayout().GetLayoutInstance().GetComponent <BaseRaycaster>();
                    raycasterTemp        = true;
                }
            }

            if (this.raycaster != null && this.raycasterSource != null)
            {
                var graphicRaycaster       = this.raycaster as GraphicRaycaster;
                var graphicRaycasterSource = this.raycasterSource as GraphicRaycaster;
                if (graphicRaycaster != null && graphicRaycasterSource != null)
                {
                    graphicRaycaster.blockingObjects        = graphicRaycasterSource.blockingObjects;
                    graphicRaycaster.ignoreReversedGraphics = graphicRaycasterSource.ignoreReversedGraphics;
                }

                if (raycasterTemp == true)
                {
                    this.raycasterSource = null;
                }
            }
        }
Exemplo n.º 11
0
        public GPLInfo(WindowSystem _winsys) : base(_winsys)
        {
            Title  = "GNU General Public License v3.0";
            Width  = 800;
            Height = 550;

            AddChild(_header);
            AddChild(_scroller);
            AddChild(_close);
            _scroller.AddChild(_panel);
            _panel.AddChild(_license);

            _header.Text      = "GNU GPL v3 License Information";
            _header.AutoSize  = true;
            _header.FontStyle = Plex.Engine.Themes.TextFontStyle.Header1;

            _close.Text   = "Close";
            _close.Click += (o, a) =>
            {
                Close();
            };

            _license.AutoSize  = true;
            _license.FontStyle = Plex.Engine.Themes.TextFontStyle.Mono;

            SetWindowStyle(WindowStyle.Dialog);

            _license.Text   = System.IO.File.ReadAllText(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Content", "License.txt"));
            _panel.AutoSize = true;
        }
Exemplo n.º 12
0
    public void OnStartFleet()
    {
        int hangarID = _hangar.ID;

        List <int> shipIDs = new List <int>();

        foreach (int i in _hangar.Ships)
        {
            Ship s = LocalDataManager.instance.GetShipInfo(i);
            if (s.Fleet <= 0)
            {
                shipIDs.Add(i);
            }
        }

        PrefabManager pm = FindObjectOfType <PrefabManager>();
        WindowSystem  ws = FindObjectOfType <WindowSystem>();

        FleetPlanEditorView editor = Instantiate(pm.prefabFleetPlanEditorView);

        editor.SetData(shipIDs, hangarID);

        Window w = ws.NewWindow("editFleetPlan", editor.gameObject);

        w.Show();
    }
Exemplo n.º 13
0
        internal void AddItemInternal <T, TClosure>(Resource source, TClosure closure, System.Action <T, TClosure> onComplete) where T : WindowComponent where TClosure : UnityEngine.UI.Windows.Components.IListClosureParameters
        {
            var resources = WindowSystem.GetResources();
            var data      = new AddItemClosure <T, TClosure>()
            {
                data       = closure,
                onComplete = onComplete,
                component  = this,
            };

            Coroutines.Run(resources.LoadAsync <T, AddItemClosure <T, TClosure> >(this, data, source, (asset, innerClosure) => {
                if (innerClosure.component.loadedAssets.Contains(asset) == false)
                {
                    if (asset.createPool == true)
                    {
                        WindowSystem.GetPools().CreatePool(asset);
                    }
                    innerClosure.component.loadedAssets.Add(asset);
                }

                var pools    = WindowSystem.GetPools();
                var instance = pools.Spawn(asset, innerClosure.component.GetRoot());
                innerClosure.component.RegisterSubObject(instance);
                innerClosure.component.items.Add(instance);
                innerClosure.component.NotifyModulesComponentAdded(instance);
                innerClosure.component.OnElementsChanged();
                if (innerClosure.onComplete != null)
                {
                    innerClosure.onComplete.Invoke(instance, innerClosure.data);
                }
            }));
        }
Exemplo n.º 14
0
        public CutscenePlayer(WindowSystem _winsys) : base(_winsys)
        {
            Width  = 800;
            Height = 600;
            Title  = "Select Cutscene";
            SetWindowStyle(WindowStyle.DialogNoDrag);
            AddChild(_scroll);
            _scroll.AddChild(_list);

            foreach (var cutscene in _cutscene.Cutscenes)
            {
                _list.AddItem(new ListViewItem
                {
                    Tag   = cutscene,
                    Value = cutscene.Name
                });
            }
            _list.Layout = ListViewLayout.List;
            _list.SelectedIndexChanged += (o, a) =>
            {
                if (_list.SelectedItem != null)
                {
                    _cutscene.Play(_list.SelectedItem.Value);
                    Close();
                }
            };
        }
Exemplo n.º 15
0
        public Plugin(
            DalamudPluginInterface pi,
            CommandManager commands,
            ChatGui chat,
            ClientState clientState)
        {
            this.pluginInterface = pi;
            this.chat            = chat;
            this.clientState     = clientState;

            // Get or create a configuration object
            this.config = (Configuration)this.pluginInterface.GetPluginConfig()
                          ?? this.pluginInterface.Create <Configuration>();

            // Initialize the UI
            this.windowSystem = new WindowSystem(typeof(Plugin).AssemblyQualifiedName);

            var window = this.pluginInterface.Create <PluginWindow>();

            if (window is not null)
            {
                this.windowSystem.AddWindow(window);
            }

            this.pluginInterface.UiBuilder.Draw += this.windowSystem.Draw;

            // Load all of our commands
            this.commandManager = new PluginCommandManager <Plugin>(this, commands);
        }
Exemplo n.º 16
0
 public void Play(Side side)
 {
     this.FlowHideFunctionLoader((routes) => {
         WindowSystem.HideAllAndClean(except: (WindowBase)null, callback: () => {
             routes.FlowGameplayView(side);
         });
     });
 }
Exemplo n.º 17
0
        public void OnEndDrag(PointerEventData eventData)
        {
            var windowDelta = this.GetAxisValue(WindowSystem.ConvertPointScreenToWindow(eventData.delta, this));

            this.Move(-windowDelta / this.GetSize() * this.dragSpeed, immediately: false);
            this.targetValue = Mathf.RoundToInt(this.targetValue);
            this.isDragging  = false;
        }
Exemplo n.º 18
0
 public void OnDrag(PointerEventData eventData)
 {
     if (this.isDragging == true)
     {
         var windowDelta = this.GetAxisValue(WindowSystem.ConvertPointScreenToWindow(eventData.delta, this));
         this.Move(-windowDelta / this.GetSize() * this.dragSpeed, immediately: true);
     }
 }
Exemplo n.º 19
0
 public void RemoveListener(TAction action)
 {
     this.listeners.Remove(action);
     if (WindowSystem.IsDebugWeakReferences() == true)
     {
         SimpleEventDebug.RemoveListener(action as System.Action);
     }
 }
Exemplo n.º 20
0
        public static void SetLanguageIndex(int index)
        {
            LocalizationSystem.currentLanguage = LocalizationSystem.GetLanguagesList()[index];

            WindowSystem.ForEachWindow((w) => {
                w.OnLocalizationChanged();
            }, includeInactive: true);
        }
Exemplo n.º 21
0
        public static void SetVersionIndex(int index)
        {
            GameDataSystem.currentVersion = GameDataSystem.GetVersionsList()[index];

            WindowSystem.ForEachWindow((w) => {
                w.OnVersionChanged();
            }, includeInactive: false);
        }
Exemplo n.º 22
0
        public void ShowConsole()
        {
            this.container.Show();
            this.Clear();
            this.Focus();

            WindowSystem.AddToHistory(this.GetWindow(), WindowObjectState.Shown, forced: true);
        }
Exemplo n.º 23
0
        public Clock(WindowSystem _winsys) : base(_winsys)
        {
            Width  = 1000;
            Height = 500;
            Title  = "Clock";

            AddChild(_head);
            AddChild(_currentTime);
        }
Exemplo n.º 24
0
        public static void SetLanguageIndex(int index)
        {
            LocalizationSystem.currentLanguage = LocalizationSystem.GetLanguagesList()[index];
            Debug.Log(string.Format("LS::SetLanguageIndex: {0}", index));

            WindowSystem.ForEachWindow((w) => {
                w.OnLocalizationChanged();
            }, includeInactive: true);
        }
Exemplo n.º 25
0
        private ExampleProject.UI.Loader.Loading.LoadingScreen INTERNAL_FlowFunctionLoader(bool hide, bool hideWait, System.Action <FlowFunctionLoaderRoutes> onFunctionEnds, System.Action <ExampleProject.UI.Loader.Loading.LoadingScreen> onParametersPassCall = null)
        {
            ExampleProject.UI.Loader.Loading.LoadingScreen newWindow = default(ExampleProject.UI.Loader.Loading.LoadingScreen);
            var item = UnityEngine.UI.Windows.Plugins.Flow.FlowSystem.GetAttachItem(43, 39);

            if (hide == true && hideWait == true)
            {
                this.Hide(() => {
                    if (onFunctionEnds != null)
                    {
                        newWindow = WindowSystem.Show <ExampleProject.UI.Loader.Loading.LoadingScreen>(
                            (w) => WindowSystem.RegisterFunctionCallback(w, (index) => onFunctionEnds(new FlowFunctionLoaderRoutes(w, index))),
                            item,
                            onParametersPassCall
                            );
                    }
                    else
                    {
                        newWindow = WindowSystem.Show <ExampleProject.UI.Loader.Loading.LoadingScreen>(
                            null,
                            item,
                            onParametersPassCall
                            );
                    }

                    WindowSystemFlow.OnDoTransition(item.index, 43, 39, hide);
                }, item);
            }
            else
            {
                if (onFunctionEnds != null)
                {
                    newWindow = WindowSystem.Show <ExampleProject.UI.Loader.Loading.LoadingScreen>(
                        (w) => WindowSystem.RegisterFunctionCallback(w, (index) => onFunctionEnds(new FlowFunctionLoaderRoutes(w, index))),
                        item,
                        onParametersPassCall
                        );
                }
                else
                {
                    newWindow = WindowSystem.Show <ExampleProject.UI.Loader.Loading.LoadingScreen>(
                        null,
                        item,
                        onParametersPassCall
                        );
                }

                WindowSystemFlow.OnDoTransition(item.index, 43, 39, hide);

                if (hide == true)
                {
                    this.Hide(item);
                }
            }

            return(newWindow);
        }
Exemplo n.º 26
0
        private void OnPointerUp()
        {
            var position = WindowSystem.GetPointerPosition();

            if (RectTransformUtility.RectangleContainsScreenPoint(this.label.rectTransform, position, this.GetWindow().workCamera) == false)
            {
                this.HideDropdown();
            }
        }
Exemplo n.º 27
0
 public ImageViewer(WindowSystem _winsys) : base(_winsys)
 {
     Title  = "Image Viewer";
     Width  = 640;
     Height = 480;
     AddChild(open);
     open.Click += (sender, e) => gui.AskForFile(false, (path) => load(path));
     img         = null;
 }
 public void DoStop()
 {
     #if FMOD_SUPPORT
     this.FMODStop();
     #else
     var audio = WindowSystem.GetAudio();
     audio.Play(this.clip);
     #endif
 }
    public void Start()
    {
        if (Application.isPlaying == false)
        {
            return;
        }

        WindowSystem.ShowDefault();
    }
        public override void OnPlay(WindowBase window, object tag, TransitionInputParameters parameters, WindowComponentBase root, bool forward, System.Action callback)
        {
            var param = this.GetParams <Parameters>(parameters);

            if (param == null)
            {
                if (callback != null)
                {
                    callback();
                }
                return;
            }

            this.currentWindow = window;

            this.prevWindow = WindowSystem.GetPreviousWindow(window, (item) => item.window != null && item.window.GetState() == WindowObjectState.Shown);
            if (this.prevWindow == null)
            {
                window.transition.SaveToCache(this.clearScreen, () => {
                    this.material.SetTexture("_ClearScreen", this.clearScreen);
                }, this.grabEveryFrame);
            }
            else
            {
                if (forward == true)
                {
                    // Take screenshot from current view
                    this.prevWindow.transition.SaveToCache(this.clearScreen, () => {
                        this.material.SetTexture("_ClearScreen", this.clearScreen);
                    }, this.grabEveryFrame);
                }
                else
                {
                    // Take screenshot from previous view
                    this.prevWindow.transition.SaveToCache(this.clearScreen, () => {
                        this.material.SetTexture("_ClearScreen", this.clearScreen);
                    }, this.grabEveryFrame);
                }
            }

            var duration = this.GetDuration(parameters, forward);
            var result   = param.GetResult(forward);

            TweenerGlobal.instance.removeTweens(tag);
            TweenerGlobal.instance.addTween(this, duration, this.material.GetFloat("_Value"), result).onUpdate((obj, value) => {
                this.material.SetFloat("_Value", value);
            }).onComplete((obj) => { if (callback != null)
                                     {
                                         callback();
                                     }
                          }).onCancel((obj) => { if (callback != null)
                                                 {
                                                     callback();
                                                 }
                                      }).tag(tag);
        }