private AvatarManager()
        {
            avatarTailor = new AvatarTailor();

            Plugin.instance.sceneTransitionDidFinish += OnSceneTransitionDidFinish;

            SceneManager.sceneLoaded += OnSceneLoaded;
        }
Exemple #2
0
        public void Init(IPA.Logging.Logger log)
        {
            Util.Logger.logger = log;
            Instance           = this;

            AvatarLoader = new AvatarLoader(CustomAvatarsPath, AvatarsLoaded);
            AvatarTailor = new AvatarTailor();
            _avatarUI    = new AvatarUI();

            FirstPersonEnabled = PlayerPrefs.HasKey(FirstPersonEnabledKey);
            //RotatePreviewEnabled = PlayerPrefs.HasKey(RotatePreviewEnabledKey);
            SceneManager.sceneLoaded += OnSceneLoaded;
        }
        public PlayerAvatarManager(AvatarLoader avatarLoader, AvatarTailor avatarTailor, CustomAvatar startAvatar = null)
        {
            _playerAvatarInput = new PlayerAvatarInput();
            _avatarLoader      = avatarLoader;
            _avatarTailor      = avatarTailor;

            if (startAvatar != null)
            {
                CurrentPlayerAvatar = startAvatar;
            }

            Plugin.Instance.FirstPersonEnabledChanged += OnFirstPersonEnabledChanged;
            SceneManager.sceneLoaded += SceneManagerOnSceneLoaded;
        }
        public void OnApplicationStart()
        {
            if (_init)
            {
                return;
            }
            _init = true;

            File.WriteAllText("CustomAvatarsPlugin-log.txt", string.Empty);

            AvatarLoader = new AvatarLoader(CustomAvatarsPath, AvatarsLoaded);
            AvatarTailor = new AvatarTailor();
            _avatarUI    = new AvatarUI();

            FirstPersonEnabled = PlayerPrefs.HasKey(FirstPersonEnabledKey);
            //RotatePreviewEnabled = PlayerPrefs.HasKey(RotatePreviewEnabledKey);
            SceneManager.sceneLoaded += SceneManagerOnSceneLoaded;
        }