private static Character AddCharacter(Follower follower) { Manager manager = SingletonUtil.GetMain(); Character character = new Character(); character.PCharacter = PCharacterInstanceUtil.CreateInstanceFromBase(CharacterCollectionUtil.GetDefaultCharacter()); character.Position = Vector2.zero + Vector2.up; character.FollowerReference = follower; SetObjectLayer(character.PCharacter.gameObject, LayerMask.NameToLayer(manager.Chat.CharacterLayer), true); character.PCharacter.gameObject.SetActive(false); return(character); }
private static bool ExistInClient(out Follower follower, Follower target) { follower = null; Client client = ClientUtil.GetClient(); for (int i = 0; i < client.Followers.Count; i++) { var curFollower = client.Followers[i]; if (curFollower.UserName == target.UserName) { follower = curFollower; return(true); } } return(false); }
private static bool ExistInChat(out Character character, Follower follower) { Chat chat = GetChat(); character = null; for (int i = 0; i < chat.Characters.Count; i++) { var curCharacter = chat.Characters[i]; if (curCharacter.FollowerReference == follower) { character = curCharacter; return(true); } } return(false); }