public void populateAnimations()
    {
        TIME.Figurine fig = ScreenManager.getInstance().currentFigurine;

        foreach (Transform child in animationGroup.transform)
        {
            Destroy(child.gameObject);
        }

        for (int i = 0; i < fig.animations.Count; i++)
        {
            GameObject preview = Instantiate <GameObject>(previewPrefab);
            preview.transform.SetParent(animationGroup.transform, false);
            RectTransform rt = preview.GetComponent <RectTransform>();
            rt.anchoredPosition = new Vector2((120 * (i % 6) + 100), -150 - (120 * (i / 6)));

            RawImageAnimator riAnim = preview.GetComponent <RawImageAnimator>();
            riAnim.anim = fig.animations[i];
        }
    }
Exemplo n.º 2
0
 void Start()
 {
     ria = GetComponent <RawImageAnimator>();
 }