예제 #1
0
        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");
                }
            }
        }
예제 #2
0
 private void Awake()
 {
     avatarController = GetComponent <AvatarController>();
 }