public void AddEmotion(EmotionDTO newEmotion) { var resultingEmotion = _emotionalAppraisalAsset.AddActiveEmotion(newEmotion); Emotions.DataSource.Add(resultingEmotion); Emotions.Refresh(); }
/// <summary> /// Set State to Off/On for an emotion /// </summary> /// <param name="emotion">Emotion to set the state of</param> /// <param name="emotionState">Off/On state</param> public void SetEmotionState(Emotions emotion, bool emotionState) { if (IsRunning) { nativePlatform.SetEmotionState((int)emotion, emotionState); } }
private string DescribeEmotion(Emotions topEmotion) { switch (topEmotion) { case Emotions.Neutral: return(""); case Emotions.Happiness: return("Glad you're happy. Get back to work."); case Emotions.Anger: return("Yeah, you show that code who's boss! #AnAngryDevIsAProductiveDev"); case Emotions.Contempt: return("Code reviews... Aren't they the worst?"); case Emotions.Disgust: return("Yeah... probably should've taken a bathroom break a long time ago. Too late now."); case Emotions.Fear: return("Those deadlines sure come up fast, don't they?"); case Emotions.Sadness: return("You seem sad. Is it because you didn't get any swag at Build?"); case Emotions.Surprise: return("You seem surprised, I hope it's nothing serious..."); default: return(""); } }
public void NotifyEmotions(Emotions type, uint netId) { // convert type EmotionType targetType; switch (type) { case Emotions.DANCE: targetType = EmotionType.DANCE; break; case Emotions.TAUNT: targetType = EmotionType.TAUNT; break; case Emotions.LAUGH: targetType = EmotionType.LAUGH; break; case Emotions.JOKE: targetType = EmotionType.JOKE; break; case Emotions.UNK: targetType = (EmotionType)type; break; default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } var packet = new EmotionPacketResponse((byte)targetType, netId); _packetHandlerManager.BroadcastPacket(packet, Channel.CHL_S2C); }
public void UpdateEmotion(EmotionDTO oldEmotion, EmotionDTO newEmotion) { _emotionalAppraisalAsset.RemoveEmotion(oldEmotion); _emotionalAppraisalAsset.AddActiveEmotion(newEmotion); Emotions.DataSource = _emotionalAppraisalAsset.ActiveEmotions.ToList(); Emotions.Refresh(); }
private void SetMotionStyleID(Emotions emotion) { switch (emotion) { case Emotions.happy: animManager.ChangeToWalkNeutral(); break; case Emotions.sad: animManager.ChangeToWalkSad(); break; case Emotions.mad: animManager.ChangeToWalkAngry(); break; case Emotions.anxious: animManager.ChangeToWalkSad(); break; case Emotions.loveing: animManager.ChangeToWalkNeutral(); break; } }
public void UpdateEmotion(EmotionDTO oldEmotion, EmotionDTO newEmotion) { _rpcAsset.RemoveEmotion(oldEmotion); _rpcAsset.AddActiveEmotion(newEmotion); Emotions.DataSource = _rpcAsset.GetAllActiveEmotions().ToList(); Emotions.Refresh(); }
// Update is called once per frame void Update() { GetComponent <Animator> ().SetInteger("EmotionState", (int)emotion); if (Input.GetKeyDown(KeyCode.Space)) { switch (emotion) { case Emotions.NORMAL: emotion = Emotions.HAPPY; break; case Emotions.HAPPY: emotion = Emotions.SCARED; break; case Emotions.SCARED: emotion = Emotions.ANGRY; break; case Emotions.ANGRY: emotion = Emotions.SAD; break; case Emotions.SAD: emotion = Emotions.NORMAL; break; } } }
public async Task Invoke(aiAuthdbContext dbContext, CancellationToken cancellationToken) { aiAuthdbContext _context = dbContext; List <Emotions> _emotions = _context.Emotions.ToList(); List <Objects> _objects = _context.Objects.ToList(); int numberOfEmotions = new Random().Next(1, 3); // Create a new list if (Auth.Current == null) { Auth.Current = new Auth(); } Auth.Current.items.Clear(); // Add the new AuthAction emotions to the static class list for (int i = 1; i <= numberOfEmotions; i++) { Emotions temp = GetRandomEmotion(_emotions); AuthAction newaction = new AuthAction { name = temp.Name, description = temp.Description }; Auth.Current.items.Add(newaction); } Objects tempObject = GetRandomObjects(_objects); AuthAction newActionObject = new AuthAction { name = tempObject.Name, description = tempObject.Description }; Auth.Current.items.Add(newActionObject); }
public void AddEmotion(EmotionDTO newEmotion) { var resultingEmotion = _rpcAsset.AddActiveEmotion(newEmotion); Emotions.DataSource.Add(resultingEmotion); Emotions.Refresh(); _mainForm.SetModified(); }
public DialogueObject(DialogueTarget speaker, string text, float speed, Emotions emotion, [CanBeNull] AudioSource sound) { Speaker = speaker; Text = text; Speed = speed; Feels = emotion; Sound = sound; }
// Use this for initialization void Start() { targetEmotion = Emotions.Joy; //Standard Joy, remove this emotions = GetComponent <PlayerEmotions>(); img.sprite = neutral; TotalScore = 0; graph = GetComponent <ScoreGraph>(); }
public void ChangeTarget() { ImageEnum imageEnum = images [Random.Range(0, images.Count)]; target.sprite = imageEnum.image; this.emotion = imageEnum.emotion; scoreManager.SetTarget(this.emotion); }
public void SetEmotion(Emotions emotion, bool isHero = false) { if (_cacheSprites.ContainsKey(emotion)) { _image.sprite = _cacheSprites[emotion]; } transform.localScale = new Vector3(isHero ? -1 : 1, 1, 1); }
public void RemoveEmotions(IList <EmotionDTO> emotionsToRemove) { foreach (var emotion in emotionsToRemove) { _emotionalAppraisalAsset.RemoveEmotion(emotion); } Emotions.DataSource = _emotionalAppraisalAsset.ActiveEmotions.ToList(); Emotions.Refresh(); }
/// <summary> /// Extension "On" method for the emotion to simplify the mask /// </summary> public static bool On(this Emotions emotion, Emotions value) { //The layermask in Unity uses bitmask values for the selection. //Find the value they mask with by pow(2, num); int unityVal = (int)Mathf.Pow(2, (int)value); return(((int)emotion & unityVal) == unityVal); }
public void PlayCustomReaction(string key) { if (reactions.ContainsKey(key)) { Emotions emotion = reactions[key]; AddExperience(emotion, 101); PlayReaction(emotion); } }
//-------------------------------------------------------------------------------------------------------------------- // - Set Emotion //-------------------------------------------------------------------------------------------------------------------- public void SetEmotionIndex(Emotions emotion, uint index) { // If the current mood is being replaced, replace it actively if (Emotion == emotion) { Index = index; } EmotionIndex[(int)emotion] = index; }
public void RemoveEmotions(IList <EmotionDTO> emotionsToRemove) { foreach (var emotion in emotionsToRemove) { _rpcAsset.RemoveEmotion(emotion); } Emotions.DataSource = _rpcAsset.GetAllActiveEmotions().ToList(); Emotions.Refresh(); }
void ShuffleEmotionsList(List <Emotions> emotionList) { for (int i = emotionList.Count - 1; i > 0; i--) { int rand = Random.Range(0, i); Emotions temp = emotionList[i]; emotionList[i] = emotionList[rand]; emotionList[rand] = temp; } }
public override void onImageResults(Dictionary <int, Face> faces) { if (finished) { return; } foreach (KeyValuePair <int, Face> pair in faces) { Face face = pair.Value; Emotions emotion = Emotions.Joy; switch (GameVariables.currentEmotion) { case "joy": emotion = Emotions.Joy; break; case "fear": emotion = Emotions.Fear; break; case "disgust": emotion = Emotions.Disgust; break; case "sadness": emotion = Emotions.Sadness; break; case "anger": emotion = Emotions.Anger; break; case "surprise": emotion = Emotions.Surprise; break; } float currentEmotion = 0; face.Emotions.TryGetValue(emotion, out currentEmotion); emotionValue.text = "" + (int)currentEmotion + "/100"; if (currentEmotion > 70) { winText.SetActive(true); finished = true; StartCoroutine(OpenJatekScene()); } } }
/// <summary> /// Given a word, we want to add the word and the synonyms to the dictionary (given /// that it's a valid word) and save it. Then we want to pass the word off /// to the controller that will convert it into a list of EmotionIdeals. /// </summary> /// <param name="word">The word with its synonyms. Note this word could be garbage!</param> /// <returns></returns> private static Word CallMeWhenDonePingingServer(Word word) { Debug.Log("New synonym done pinging server for word: " + word.GetWord()); string wordStr = word.GetWord(); if (word.IsGarbage()) { Debug.Log("word '" + word.GetWord() + "' thrown away, since it's garbage"); return(word); } //TO-DO: Now that we have the filled word, we need to get the EmotionIdeal it represents! List <EmotionModel.EmotionIdeal> emoIdealList = new List <EmotionModel.EmotionIdeal>(); EmotionModel.EmotionIdeal emotionIdeal = Emotions.GetEmotionIdealAssociated(word.GetWord()); if (emotionIdeal != EmotionModel.EmotionIdeal.None) { emoIdealList.Add(emotionIdeal); } foreach (string synonym in word.GetSynonyms()) { emotionIdeal = Emotions.GetEmotionIdealAssociated(synonym); if (emotionIdeal != EmotionModel.EmotionIdeal.None) { emoIdealList.Add(emotionIdeal); } } if (emoIdealList.Count > 0) { //pick a random emotion ideal in the list int randIndex = Random.Range(0, emoIdealList.Count - 1); emotionIdeal = emoIdealList[randIndex]; //And then have it affect the emotional model MySQLDictionary.AddEntry(wordStr, emotionIdeal); EmotionModel.ChangeStateByAddingEmotions(emotionIdeal); } else { Debug.Log("Word: " + word.GetWord() + " : has no associated emotion ideal"); } ////add the new word to the dictionary //SynonymDictionary.Add(word.GetWord(), word.GetSynonyms()); // ////If we should save, do it //if (Time.time - SynonymDictionary.LastSave > SynonymDictionary.MIN_TIME_BETWEEN_SAVES) //{ // SynonymDictionary.SaveSynonymDictionary(); //} return(word); }
public void AddEmotion(UserOrNpcInfo target, Emotion emotion) { if (Emotions.ContainsKey(target)) { Emotions[target] = emotion; } else { Emotions.Add(target, emotion); } }
void AnimationGUI() { GUILayout.Label("Animation", EditorStyles.boldLabel); emotion = (Emotions)EditorGUILayout.EnumPopup("Emotions", emotion, GUILayout.Width(300)); //GUILayout.BeginArea(new Rect(0,0,100,100)); GUILayout.Label(emotion.ToString() + ":"); currentAnimation = SetAnimation(emotion); currentAnimation [0] = EditorGUILayout.ObjectField("Frame 1 :", currentAnimation [0], typeof(Sprite), true) as Sprite; currentAnimation [1] = EditorGUILayout.ObjectField("Frame 2 :", currentAnimation [1], typeof(Sprite), true) as Sprite; }
public void OnTriggerExit2D(Collider2D p_collider) { if (p_collider.tag == "Player") { if (_playerEmotions == null) { _playerEmotions = p_collider.GetComponent <Emotions>(); } _playerEmotions.IsRaisingEmotion(false, 0f); _isRaising = false; } }
Sprite[] SetAnimation(Emotions _emo) { Sprite[] _spriteArray = null; switch (_emo) { case Emotions.Neutral: currentCharacter.neutralSprites = SpriteInitialiseur(currentCharacter.neutralSprites); _spriteArray = currentCharacter.neutralSprites; break; case Emotions.Angry: currentCharacter.angrySprites = SpriteInitialiseur(currentCharacter.angrySprites); _spriteArray = currentCharacter.angrySprites; break; case Emotions.Proud: currentCharacter.proudSprites = SpriteInitialiseur(currentCharacter.proudSprites); _spriteArray = currentCharacter.proudSprites; break; case Emotions.Mocking: currentCharacter.mockingSprites = SpriteInitialiseur(currentCharacter.mockingSprites); _spriteArray = currentCharacter.mockingSprites; break; case Emotions.Gay: currentCharacter.gaySprites = SpriteInitialiseur(currentCharacter.gaySprites); _spriteArray = currentCharacter.gaySprites; break; case Emotions.Surprised: currentCharacter.surprisedSprites = SpriteInitialiseur(currentCharacter.surprisedSprites); _spriteArray = currentCharacter.surprisedSprites; break; case Emotions.Happy: currentCharacter.happySprites = SpriteInitialiseur(currentCharacter.happySprites); _spriteArray = currentCharacter.happySprites; break; case Emotions.Thinking: currentCharacter.thinkingSprites = SpriteInitialiseur(currentCharacter.thinkingSprites); _spriteArray = currentCharacter.thinkingSprites; break; default: Debug.LogError("No Emmotion allowed"); break; } return(_spriteArray); }
public ITagValue RegisterEmotionOnCurrentContact(Emotions emotion) { if (!this.IsTracking()) return null; //Register the emotion on the contact if (Sitecore.Analytics.Tracker.Current.Contact.Tags.Find("Emotion") != null) return Sitecore.Analytics.Tracker.Current.Contact.Tags.Set("Emotion", emotion.ToString()); else return Sitecore.Analytics.Tracker.Current.Contact.Tags.Add("Emotion", emotion.ToString()); }
protected override void _init_cache() { base._init_cache(); if (!transform_avatar) { Debug.LogError(string.Format( "el avatar '{0}' no tiene modelo asignado se intade de buscar" + "uno", helper.game_object.name.full(this))); transform_avatar = transform.Find("model"); } emotion = emotion; }
private void HandleCastMember(CharacterRoster cast, Emotions emotions) { var member = callSheet.Find(x => x.characterRoster == cast); if (!currentActor || currentActor.runtimeAnimatorController != member.animatorPrefab.runtimeAnimatorController) { if (currentActor) { Destroy(currentActor.gameObject); } currentActor = BuildCastMember(member.animatorPrefab); } SetCastEmotion(emotions); }
public void SetCastEmotion(Emotions emotions) { if (currentActor) { try { currentActor.Play(emotions.ToString(), 0); } catch (System.Exception e) { Debug.LogException(e); } } }
//public bool IsDublicate { get; } = false; //static int[] emotionIDsChecked = new int[8]; //static int index = -1; public Score(Emotions emotion) { this.Emotion = emotion; this.EmotionID = (int)emotion; switch (emotion) { case Emotions.Anger: this.Glyph = "😠"; break; case Emotions.Contempt: this.Glyph = "🙄"; break; case Emotions.Disgust: this.Glyph = "😖"; break; case Emotions.Fear: this.Glyph = "😨"; break; case Emotions.Happiness: this.Glyph = "😁"; break; case Emotions.Neutral: this.Glyph = "😐"; break; case Emotions.Sadness: this.Glyph = "😢"; break; case Emotions.Surprise: this.Glyph = "😯"; break; } //for (int i = 0; i < index; i++) //{ // if (emotionIDsChecked[index] == this.EmotionID) // IsDublicate = true; //} //if (!IsDublicate) // emotionIDsChecked[++index] = this.EmotionID; }
public void InstantiateEmoticon( Emotions emoticon ) { _emoticon.SetTexture( ( int ) emoticon ); StopAllCoroutines(); StartCoroutine( ResetCurrentEmotionState() ); // We'll check if he's currently already doing something with his hands // so, for instance, he doesn't cheer whilst holding a boulder if ( _companionScript.currentAction == Character.CharacterAction.None || _companionScript.currentAction == Character.CharacterAction.Waiting ) { currentEmoticon = _emoticonStates [( int ) emoticon] [Random.Range( 0, _emoticonStates[( int ) emoticon].Length )]; } }
void State() { switch (SlotItem.name) { case "AnxiousMemory": emotion = Emotions.Anxious; break; case "FearMemory": emotion = Emotions.Fear; break; case "JoyfulMemory": emotion = Emotions.Happy; break; case "AngryMemory": emotion = Emotions.Anger; break; case "SadMemory": emotion = Emotions.Sad; break; case "ConfusedMemory": emotion = Emotions.Confused; break; } }
/// <summary> /// Extension "On" method for the emotion to simplify the mask /// </summary> public static bool On(this Emotions emotion, Emotions value) { //The layermask in Unity uses bitmask values for the selection. //Find the value they mask with by pow(2, num); int unityVal = (int)Mathf.Pow(2, (int)value); return ((int)emotion & unityVal) == unityVal; }
public static void SendSaveEmotion(int itemNum, Emotions.Emotion emotion) { TcpPacket packet = new TcpPacket("saveemoticon"); packet.AppendParameters( itemNum.ToString(), emotion.Command, emotion.Pic.ToString() ); packet.FinalizePacket(); SendPacket(packet); }
/// <summary> /// Set State to Off/On for an emotion /// </summary> /// <param name="Emotion">Emotion to set the state of</param> /// <param name="State">Off/On state</param> public void SetEmotionState(Emotions Emotion, bool State) { if (IsRunning) nativePlatform.SetEmotionState ((int)Emotion, State); }
/// <summary> /// This is a sync execution of \emotions rest call. /// It returns JsonResponse<Emotions.Response> /// Here comes request Comments: ///<para>获取微博官方表情的详细信息 </para> ///<para>URL:</para> ///<para> https://api.weibo.com/2/emotions.json</para> ///<para>支持格式:</para> ///<para> JSON</para> ///<para>HTTP请求方式:</para> ///<para> GET</para> ///<para>是否需要登录:</para> ///<para> 是 关于登录授权,参见 如何登录授权</para> ///<para>访问授权限制:</para> ///<para> 访问级别:普通接口 频次限制:否 关于频次限制,参见 接口访问权限说明</para> ///<para>注意事项:</para> ///<para> 无</para> ///<para></para> /// </summary> public JsonResponse<Emotions.Response> ExecuteEmotions(Emotions.Request request) { return ExecuteEmotionsAsync(request).Result; }
/// <summary> /// This is a async request of \emotions rest call. ///It returns JsonResponse<Stream> /// Here comes request Comments: ///<para>获取微博官方表情的详细信息 </para> ///<para>URL:</para> ///<para> https://api.weibo.com/2/emotions.json</para> ///<para>支持格式:</para> ///<para> JSON</para> ///<para>HTTP请求方式:</para> ///<para> GET</para> ///<para>是否需要登录:</para> ///<para> 是 关于登录授权,参见 如何登录授权</para> ///<para>访问授权限制:</para> ///<para> 访问级别:普通接口 频次限制:否 关于频次限制,参见 接口访问权限说明</para> ///<para>注意事项:</para> ///<para> 无</para> ///<para></para> /// </summary> public async Task<JsonResponse<Stream>> RequestEmotionsAsync ( Emotions.Request request, CancellationToken cancellationToken=default(CancellationToken), IProgress<ProgressReport> progress=null) { return await _requestEmotionsMethod.GetResponseAsync(request, cancellationToken, progress); }
/// <summary> /// This is a sync request of \emotions rest call. ///It returns JsonResponse<Stream> /// Here comes request Comments: ///<para>获取微博官方表情的详细信息 </para> ///<para>URL:</para> ///<para> https://api.weibo.com/2/emotions.json</para> ///<para>支持格式:</para> ///<para> JSON</para> ///<para>HTTP请求方式:</para> ///<para> GET</para> ///<para>是否需要登录:</para> ///<para> 是 关于登录授权,参见 如何登录授权</para> ///<para>访问授权限制:</para> ///<para> 访问级别:普通接口 频次限制:否 关于频次限制,参见 接口访问权限说明</para> ///<para>注意事项:</para> ///<para> 无</para> ///<para></para> /// </summary> public JsonResponse<Stream> RequestEmotions(Emotions.Request request) { return RequestEmotionsAsync(request).Result; }