using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FanRiot : MonoBehaviour {


    private Animator animator;
    private SpriteRenderer spriteRender;

    // Use this for initialization
    void Start () {
        spriteRender = GetComponent<SpriteRenderer>();
        animator = this.GetComponent<Animator>();
        float choice = Random.Range(1, 12);

        if (choice == 1)
        {
            animator.runtimeAnimatorController = Resources.Load("Sprites/Normal1Controller") as RuntimeAnimatorController;
            spriteRender.sprite = Resources.Load<Sprite>("Sprites/Normal-Character-1");
        }
        if (choice == 2)
        {
            animator.runtimeAnimatorController = Resources.Load("Sprites/Normal2Controller") as RuntimeAnimatorController;
            spriteRender.sprite = Resources.Load<Sprite>("Sprites/Normal-Character-2");
        }
        if (choice == 3)
        {
            animator.runtimeAnimatorController = Resources.Load("Sprites/Normal3Controller") as RuntimeAnimatorController;
            spriteRender.sprite = Resources.Load<Sprite>("Sprites/Normal-Character-3");
        }
        if (choice == 4)
        {
            animator.runtimeAnimatorController = Resources.Load("Sprites/Normal4Controller") as RuntimeAnimatorController;
            spriteRender.sprite = Resources.Load<Sprite>("Sprites/Normal-Character-4");
        }

        if (choice == 5)
        {
            animator.runtimeAnimatorController = Resources.Load("Sprites/Tsun1Controller") as RuntimeAnimatorController;
            spriteRender.sprite = Resources.Load<Sprite>("Sprites/Tsundere-Character-1");
        }
        if (choice == 6)
        {
            animator.runtimeAnimatorController = Resources.Load("Sprites/Tsun2Controller") as RuntimeAnimatorController;
            spriteRender.sprite = Resources.Load<Sprite>("Sprites/Tsundere-Character-2");
        }
        if (choice == 7)
        {
            animator.runtimeAnimatorController = Resources.Load("Sprites/Tsun3Controller") as RuntimeAnimatorController;
            spriteRender.sprite = Resources.Load<Sprite>("Sprites/Tsundere-Character-3");
        }
        if (choice == 8)
        {
            animator.runtimeAnimatorController = Resources.Load("Sprites/Tsun4Controller") as RuntimeAnimatorController;
            spriteRender.sprite = Resources.Load<Sprite>("Sprites/Tsundere-Character-4");
        }
        if (choice == 9)
        {
            animator.runtimeAnimatorController = Resources.Load("Sprites/Agressive1Controller") as RuntimeAnimatorController;
            spriteRender.sprite = Resources.Load<Sprite>("Sprites/Agressive-Character-1");
        }
        if (choice == 10)
        {
            animator.runtimeAnimatorController = Resources.Load("Sprites/Agressive2Controller") as RuntimeAnimatorController;
            spriteRender.sprite = Resources.Load<Sprite>("Sprites/Agressive-Character-2");
        }
        if (choice == 11)
        {
            animator.runtimeAnimatorController = Resources.Load("Sprites/Agressive3Controller") as RuntimeAnimatorController;
            spriteRender.sprite = Resources.Load<Sprite>("Sprites/Agressive-Character-3");
        }
        if (choice == 12)
        {
            animator.runtimeAnimatorController = Resources.Load("Sprites/Agressive4Controller") as RuntimeAnimatorController;
            spriteRender.sprite = Resources.Load<Sprite>("Sprites/Agressive-Character-4");
        }
        animator.SetInteger("state", 1);
    }
}
