private void CreateAvatar(string viewerName)
        {
            Viewer           viewer           = ViewerBaseController.Instance.GetViewer(viewerName);
            GameObject       avatarGO         = Instantiate(avatarPrefab);
            AvatarController avatarController = avatarGO.GetComponent <AvatarController>();

            if (avatarController == null)
            {
                Logger.LogMessage("AvatarListController::CreateAvatar -- " +
                                  "Avatar prefab does not have AvatarController script attached.", LogType.Error);
            }
            else
            {
                avatarController.viewer          = viewer;
                avatarController.spriteSortOrder = avatarSortOrder++;
                viewerDictionary.Add(viewerName, avatarController);
                if (logType == DebugLogType.Full)
                {
                    Logger.LogMessage($"{viewerName} Avatar was created");
                }
            }
        }
Example #2
0
 private void Awake()
 {
     avatarController = GetComponent <AvatarController>();
 }