- Create a Canvas (change a background color and add other elements you need).
- Add a Slider to the Canvas (you can check "Whole Numbers", change slider direction, min and max value, value at start as you need).
- Create script SliderController.
- Delete Start and Update methods.
- Create public method OnSliderChanged that takes one float parameter.
- Add field valueText and inside a new method assign it with method parameter.
- Inside Slider component add new script to events list and change method name.
- You can also make the slider prettier: change it Handle, Background and Fill area.
- Create a Canvas (change a background color and add other elements you need).
- Add a Button and a Slider to the Canvas (uncheck Interactable in Slider component or just delete Handle Slide Area).
- Create new script Progressbar.
- Create a variable that will hold a progress.
- Add slider reference.
- Create UpdateProgress public method.
- Increase progress value and set it as slider value;
- In Button register a new event from slider (drug slider into new event).
- In Progressbar script choose UpdateProgress() method.
- You can also create a second Button (Remove) and create a new method (RemoveProgress). After that register a new event from slider.
- Create a Canvas (change a background color and add other elements you need).
- Add Slider, change its color as you wish.
- Delete Handle Slide Area.
- Set slider to it max value.
- In Slider add TimerText to show time left.
- Create an empty GameObject (rename it to TimerController).
- Create a new C#-script (Timer).
- Add this script to TimerController.
- In the script add reference to Slider.
- Create public field for timer text.
- Create variable float maxTime (max game time).
- Create private bool stopTimer (we need to know when we stop the timer).
- In Start set stopTimer to false.
- In Start set timerSlider maxValue and value to maxTime;
- In Update create a new variable float time and set its value to maxTime - Time.time.
- In Update calculate a number of minutes that left.
- In Update calculate a number of seconds that left.
- Create string variable for correct time format.
- Set stopTimer to true if time <= 0.
- If !stopTimer - update timer value and timerText.text.
- Create Canvas, change its background, set UI Scale Mode to Scale with screen size.
- Create Slider, delete Handle Slide Area, set Transition to None, uncheck Interactable.
- Rename slider background to OuterBorder.
- Create a new Sprite (Circle).
- Add circle to OuterBorder source image.
- Set Slider Width and Height to 160.
- Stretch OuterBorder, set buttom and top to 0.
- Stretch Fill Area, set left, top, right and bottom to 5.
- Add circle to Fill source image.
- Stretch Fill, set left, top, right and bottom to 0.
- Change Fill color, set image type to Filled.
- Dublicate OuterBorder, rename it to InnerBorder, set left, top, right, bottom to 20.
- Dublicate InnerBorder, rename to CenterArea and put into InnerBorder.
- In CenterArea set left, top, right, bottom to 5, change its color to main background color.
- Create a Canvas, change background color.
- Add a Panel (rename to ContainerPanel), set Opacity to 0.
- Inside ContainerPanel create a new Panel (rename to MissionsPanel), resize it, change color or add sprite.
- Inside MissonsPanel create Button (rename it to MissionButton1), add Text (number 1).
- Duplicate this button 8 times.
- Duplicate MissionPanel, drop it to right.
- Add 2 Button for slider (Slide to right and to left).
- Create a new script MissionSlider, attach it to Canvas (or othr parent object).
- In script create field (reference to ContainerPanel).
- Create reference to all MissionsPanel.
- Create reference to right and left buttons.
- Create field int currentIndex.
- Create field float containerPositionX, initialize in Start method.
- Set up a iTween asset from assets store.
- Call MoveTo method through the code.
- In Unity attach events to buttons.