While Instantiating the buttons and adding them to the scene, I need to perform some kind of animations, so they get added to the scene with a slide down animation (or slide left or slide right). My code so far:
for (int i = 0; i < 4; i++) {
// Instantiate 4 buttons
Transform clone = (Transform)Instantiate (suggestionBtn,
new Vector3 (4, y, 0), Quaternion.identity);
// make instance the child of the canvas
clone.SetParent(gameObject.transform, false);
clone.transform.rotation = transform.localRotation;
y -= 70;
}
I am not sure whether I need to make animation files and attach them to each button I need to animate or use some engine like LeanTween or is it just few lines of code that will ensure slide down/ slide left/ slide right animations?