Ejemplo n.º 1
0
 private void Vertical_MouseDown(object sender, MouseEventArgs e)
 {
     Action   = SizeAction.SizeV;
     StartPos = new Point(e.X, e.Y);
     Vertical.BringToFront();
     Vertical.BackColor = SystemColors.ControlDark;
     FirstTime          = true;
 }
Ejemplo n.º 2
0
 public override async Task <object> Fetch()
 {
     return(await SizeAction.Action(new Uri(uri),
                                    (folder, content) =>
     {
         WriteVerboseLine($"Found subfolder {folder.Uri.LocalPath} with {content.Count} pending resources.");
     }));
 }
Ejemplo n.º 3
0
 private void AddBut_Click(object sender, EventArgs e)
 {
     if (action == SizeAction.Remove)
     {
         addBut.FlatStyle    = FlatStyle.Flat;
         removeBut.FlatStyle = FlatStyle.Standard;
         action = SizeAction.Add;
     }
 }
Ejemplo n.º 4
0
        private void Center_MouseUp(object sender, MouseEventArgs e)
        {
            int xDiff = StartPos.X - e.X;
            int yDiff = StartPos.Y - e.Y;

            //	StartPos=new Point (e.X,e.Y);
            ReSize(xDiff, yDiff);

            Action = SizeAction.None;
            DoResize();
        }
Ejemplo n.º 5
0
        private void Vertical_MouseUp(object sender, MouseEventArgs e)
        {
            int xDiff = StartPos.X - e.X;
            int yDiff = 0;

            //	StartPos=new Point (e.X,e.Y);
            ReSize(xDiff, yDiff);

            Action = SizeAction.None;
            DoResize();
            this.Refresh();
        }
		private void Center_MouseUp(object sender, MouseEventArgs e)
		{
			int xDiff = StartPos.X - e.X;
			int yDiff = StartPos.Y - e.Y;
			//	StartPos=new Point (e.X,e.Y);
			ReSize(xDiff, yDiff);

			Action = SizeAction.None;
			DoResize();
		}
		private void Vertical_MouseUp(object sender, MouseEventArgs e)
		{
			int xDiff = StartPos.X - e.X;
			int yDiff = 0;
			//	StartPos=new Point (e.X,e.Y);
			ReSize(xDiff, yDiff);

			Action = SizeAction.None;
			DoResize();
			this.Refresh();
		}
		private void Center_MouseDown(object sender, MouseEventArgs e)
		{
			Action = SizeAction.SizeA;
			StartPos = new Point(e.X, e.Y);
			Vertical.BringToFront();
			Horizontal.BringToFront();
			Vertical.BackColor = SystemColors.ControlDark;
			Horizontal.BackColor = SystemColors.ControlDark;
			FirstTime = true;
		}
Ejemplo n.º 9
0
    // Update is called once per frame
    void Update()
    {
        if (running)
        {
            Action action = actionsList[actionIndex];
            actionTime += Time.unscaledDeltaTime;

            if (action.type == ActionType.Fade)
            {
                FadeAction faction = (FadeAction)action;

                if (!faction.started)
                {
                    faction.SetupColor(GetColor());
                }

                if (actionTime >= action.time)
                {
                    faction.started = false;
                    SetColor(faction.targetColor);
                    nextAction();
                    return;
                }

                SetColor(Color.Lerp(faction.originalColor, faction.targetColor, actionTime / action.time));
            }
            else if (action.type == ActionType.Func)
            {
                ((FuncAction)action).function();
                nextAction();
            }
            else if (action.type == ActionType.Delay && actionTime >= action.time)
            {
                nextAction();
            }
            else if (action.type == ActionType.ImageFill)
            {
                ImageFillAction iaction = (ImageFillAction)action;

                if (!iaction.started)
                {
                    iaction.SetupFill(GetFillAmount());
                }

                if (actionTime >= action.time)
                {
                    iaction.started = false;
                    SetFillAmount(iaction.targetFill);
                    nextAction();
                    return;
                }

                SetFillAmount(Mathf.Lerp(iaction.originalFill, iaction.targetFill, actionTime / action.time));
            }
            else if (action.type == ActionType.Scale)
            {
                ScaleAction saction = (ScaleAction)action;

                if (!saction.started)
                {
                    saction.SetupScale(transform.localScale);
                }

                if (actionTime >= action.time)
                {
                    saction.started      = false;
                    transform.localScale = saction.targetScale;
                    nextAction();
                    return;
                }

                transform.localScale = Vector3.Lerp(saction.originalScale, saction.targetScale, actionTime / action.time);
            }
            else if (action.type == ActionType.Size)
            {
                SizeAction saction = (SizeAction)action;

                if (!saction.started)
                {
                    saction.SetupSize(GetSize());
                }

                if (actionTime >= action.time)
                {
                    saction.started = false;
                    SetSize(saction.targetSize);
                    nextAction();
                    return;
                }

                Vector2 size = Vector2.Lerp(saction.originalSize, saction.targetSize, actionTime / action.time);
                SetSize(size);

                if (sizeUpdatebc && bc2d != null)
                {
                    bc2d.size   = size;
                    bc2d.offset = new Vector2(size.x * pivot.x, size.y * pivot.y);
                }
            }
        }
    }