In the previous period, the early realization of the creation of skills information and read into memory, and now start to build the skills of the display box.
This issue first realizes the display and hiding of the skill interface.
Demand:
① click on the function bar skills, call out the skill bar;
② Click the skill icon again to hide the skill bar.
Ideas:
With the pre-function to achieve a thought, the establishment of a singleton mode, and then add the display marker bit, and then control tweenposition playback and anti-play on it.
The script is as follows:
Class Skillui
{
public static Skillui _instance;
Pravte tweenposition Tween;
private bool Isshow = false;
void Awake ()
{
_instance = this;
Tween = getcompnent<tweenposition> ();
}
public void Translatestate ()
{
if (isshow)
{
Tween. Playresers ();
Isshow = false;
}
Else
{
Tween. Playfawrod ();
Isshow = true;
}
}
}
This enables the display of hidden features.
UNITY3D-RPG Project Study notes (25)