internal override Action Clone(IDocumentEssential owner) { PDFDictionary dict = new PDFDictionary(); dict.AddItem("Type", new PDFName("Action")); dict.AddItem("S", new PDFName("Hide")); IPDFObject t = _dictionary["T"]; if (t != null) { dict.AddItem("T", t.Clone()); } HideAction action = new HideAction(dict, owner); action.Hide = Hide; IPDFObject next = _dictionary["Next"]; if (next != null) { for (int i = 0; i < Next.Count; ++i) { action.Next.Add(Next[i]); } } return(action); }
public override void OnAnimalExit(Animal animal) { if (_enterCount == 1) { // Set animal to null _animal = null; GameManager.Instance.OnAnimalExitFoothold(this); _isDouble = false; var delay = DelayAction.Create(0.5f); var playExplosion = CallFuncAction.Create(() => { // Play sound SoundManager.Instance.PlaySound(SoundID.Explose); if (explosionPrefab != null) { GameObject explosion = explosionPrefab.Create(transform, icon.transform.position); explosion.AddSortingOrder(icon.GetSortingOrder() + 1); } }); var fadeOut = FadeAction.FadeOut(0.25f); var hide = HideAction.Create(); // Hide icon icon.Play(SequenceAction.Create(delay, playExplosion, fadeOut, hide)); } else { base.OnAnimalExit(animal); } }
static void Main() { // Create new document Document pdfDocument = new Document(); pdfDocument.RegistrationName = "demo"; pdfDocument.RegistrationKey = "demo"; // If you wish to load an existing document uncomment the line below and comment the Add page section instead // pdfDocument.Load(@".\existing_document.pdf"); // Add page Page page = new Page(PaperFormat.A4); pdfDocument.Pages.Add(page); // Create widget that will be shown/hidden EditBox editBox = new EditBox(20, 20, 100, 25, "editBox1"); editBox.Text = "editBox1"; page.Annotations.Add(editBox); // Create button that will show the widget PushButton buttonShow = new PushButton(20, 80, 50, 25, "buttonShow"); buttonShow.Caption = "Show"; page.Annotations.Add(buttonShow); // Add Show action HideAction showAction = new HideAction(false); showAction.Fields.Add(editBox); buttonShow.OnActivated = showAction; // Create button that will hide the widget PushButton buttonHide = new PushButton(100, 80, 50, 25, "buttonHide"); buttonHide.Caption = "Hide"; page.Annotations.Add(buttonHide); // Add Hide action HideAction hideAction = new HideAction(true); hideAction.Fields.Add(editBox); buttonHide.OnActivated = hideAction; // Save document to file pdfDocument.Save("result.pdf"); // Cleanup pdfDocument.Dispose(); // Open result document in default associated application (for demo purpose) ProcessStartInfo processStartInfo = new ProcessStartInfo("result.pdf"); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); }
static void Main() { // Create new document Document pdfDocument = new Document(); pdfDocument.RegistrationName = "demo"; pdfDocument.RegistrationKey = "demo"; // Add page Page page = new Page(PaperFormat.A4); pdfDocument.Pages.Add(page); // Create widget that will be shown/hidden EditBox editBox = new EditBox(20, 20, 100, 25, "editBox1"); editBox.Text = "editBox1"; page.Annotations.Add(editBox); // Create button that will show the widget PushButton buttonShow = new PushButton(20, 80, 50, 25, "buttonShow"); buttonShow.Caption = "Show"; page.Annotations.Add(buttonShow); // Add Show action HideAction showAction = new HideAction(false); showAction.Fields.Add(editBox); buttonShow.OnActivated = showAction; // Create button that will hide the widget PushButton buttonHide = new PushButton(100, 80, 50, 25, "buttonHide"); buttonHide.Caption = "Hide"; page.Annotations.Add(buttonHide); // Add Hide action HideAction hideAction = new HideAction(true); hideAction.Fields.Add(editBox); buttonHide.OnActivated = hideAction; // Save document to file pdfDocument.Save("result.pdf"); // Cleanup pdfDocument.Dispose(); // Open document in default PDF viewer app Process.Start("result.pdf"); }
void UpdateTime() { // Get current time int time = Mathf.CeilToInt(_time); if (time != _currentTime) { if (_currentTime > 0) { // Frame frame.StopAction(); frame.Show(); frame.Play(BlinkAction.Create(2, 0.3f, false, false), () => { frame.Hide(); }); // Play effect GameObject effect = numberEffect.gameObject; effect.StopAction(true); effect.Show(); effect.transform.localScale = Vector3.one; effect.SetColor(_currentTime > 3 ? Color.white : alarmColor, true); numberEffect.Number = _currentTime; var zoomOut = ScaleAction.ScaleTo(alarmScale, alarmDuration); var fadeOut = FadeAction.RecursiveFadeOut(alarmDuration); var hide = HideAction.Create(); effect.Play(SequenceAction.Create(ParallelAction.ParallelAll(zoomOut, fadeOut), hide)); } // Set current time _currentTime = time; // Update number number.Number = time; } }
public void OnNextRound(int nextRound) { int index = (nextRound > 3) ? 2 : nextRound - 1; round.SetImageSprite(rounds[index]); target.SetImageSprite(targets[index]); round.Show(); target.Show(); var roundMove1 = AnchoredMoveAction.MoveTo(new Vector2(0, _roundPosition.y), 0.25f, Ease.SineOut); var roundDelay = DelayAction.Create(1.0f); var roundMove2 = AnchoredMoveAction.MoveTo(new Vector2(_targetPosition.x, _roundPosition.y), 0.25f, Ease.SineIn); var targetMove1 = AnchoredMoveAction.MoveTo(new Vector2(0, _targetPosition.y), 0.25f, Ease.SineOut); var targetDelay = DelayAction.Create(1.0f); var targetMove2 = AnchoredMoveAction.MoveTo(new Vector2(_roundPosition.x, _targetPosition.y), 0.25f, Ease.SineIn); round.Play(SequenceAction.Create(roundMove1, roundDelay, roundMove2, SetAnchoredPositionAction.Create(_roundPosition), HideAction.Create())); target.Play(SequenceAction.Create(targetMove1, targetDelay, targetMove2, SetAnchoredPositionAction.Create(_targetPosition), HideAction.Create())); }