Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEditor.Animations;
- using UnityEngine;
- public class LoadCharacter : MonoBehaviour
- {
- public List<AnimatorController> skins = new List<AnimatorController>();
- public GameObject selectedSkin;
- public GameObject player;
- public Animator selectedAnimator;
- void Start()
- {
- int selectedCharacter = PlayerPrefs.GetInt("selectedCharacter");
- selectedAnimator.runtimeAnimatorController = skins[selectedCharacter];
- selectedAnimator = selectedSkin.GetComponent<Animator>();
- player.GetComponent<Animator>().runtimeAnimatorController = skins[selectedCharacter];
- //PlayerPrefs.GetInt("selectedCharacter");
- Debug.Log("Loaded " + PlayerPrefs.GetInt("selectedCharacter"));
- //label.text = prefab.name;*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement