///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* De momento, no hay expresiones public void OnButtonExpressionChecked(BasicButton sender) { if(sender.Checked){ if(CurrentCharacter!=null){ SetExpression(ResourcesLibrary.getExpression(sender.ID).Name); } Data.selChapter.selBlock.IdExpression=sender.ID; } } */ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void OnButtonCameraChecked(BasicButton sender) { if(sender.Checked){ Data.selChapter.selBlock.ShotType=(Data.Chapter.Block.shotTypes)sender.ID; mCamera.GetComponent<SceneCameraManager>().SetParams((int)Data.selChapter.selBlock.ShotType); } sender.SetBottomTextColor(sender.Checked, new Color(0.79f,0.94f,0.1f,1)); //green }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void OnButtonAnimationChecked(BasicButton sender) { if(sender.Checked){ if(CurrentCharacter!=null){ CurrentCharacter.transform.Find("mesh").animation.Stop(); CurrentCharacter.transform.Find("mesh").animation.Play(ResourcesLibrary.getAnimation(sender.ID).Name); } Data.selChapter.selBlock.IdAnimation=sender.ID; } sender.SetBottomTextColor(sender.Checked, new Color(0.79f,0.94f,0.1f,1)); //green }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Background button public void OnButtonBackgroundChecked(BasicButton sender) { if(sender.Checked){ if(sender.sPrefab!=""){ Data.selChapter.IdBackground = sender.ID; CurrentBackground = ResourcesLibrary.getBackground(Data.selChapter.IdBackground).getInstance("ChapterMgr"); }else{ Debug.Log("El boton no tiene prefab asociado!"); } } sender.SetBottomTextColor(sender.Checked, new Color(0.11f,0.72f,1,1)); //blue }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Music button public void OnButtonMusicChecked(BasicButton sender) { if(sender.Checked){ Data.selChapter.IdMusicNotNullable = sender.ID; if(Data.selChapter.IdMusicNotNullable>0){ mCamera.audio.clip = ResourcesManager.LoadResource(ResourcesLibrary.getMusic(Data.selChapter.IdMusicNotNullable).ResourceName, "Chapter") as AudioClip; mCamera.audio.Play(); }else{ mCamera.audio.clip=null; } } sender.SetBottomTextColor(sender.Checked, new Color(0.11f,0.72f,1,1)); //blue }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Character button public void OnButtonCharacterChecked(BasicButton sender) { if(sender.Checked){ if(sender.sPrefab!=""){ Data.selChapter.IdCharacter = sender.ID; CurrentCharacter = ResourcesLibrary.getCharacter(Data.selChapter.IdCharacter).getInstance("ChapterMgr"); CurrentCharacter.AddComponent<DataManager>(); SampleAnimation(); }else{ Debug.Log("El boton no tiene prefab asociado!"); } } sender.SetBottomTextColor(sender.Checked, new Color(0.11f,0.72f,1,1)); //blue }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //APPLY EFFECT public void OnButtonTimeVoiceFxEffectChecked(BasicButton sender) { if(audioClips[0]!=null) { if(sender.Checked) { mCurrentFilter = sender.ID; if(audioClips[sender.ID] == null) { float[] indata, outdata; indata = new float[audioClips[0].samples * audioClips[0].channels]; outdata = new float[audioClips[0].samples * audioClips[0].channels]; audioClips[0].GetData(indata, 0); switch((Data.Chapter.Block.filterType)sender.ID) { case Data.Chapter.Block.filterType.Monster: filter.Monster(indata, out outdata); break; case Data.Chapter.Block.filterType.Mosquito: filter.Mosquito(indata, out outdata); break; case Data.Chapter.Block.filterType.MonsterPro: filter.MonsterPro(indata, out outdata); break; case Data.Chapter.Block.filterType.MosquitoPro: filter.MosquitoPro(indata, out outdata); break; case Data.Chapter.Block.filterType.Echo: filter.Echo(indata, out outdata); break; case Data.Chapter.Block.filterType.Compression: filter.Compression(indata, out outdata); break; case Data.Chapter.Block.filterType.Distorsion: filter.Distorsion(indata, out outdata); break; case Data.Chapter.Block.filterType.Robot: filter.Robot(indata, out outdata); break; case Data.Chapter.Block.filterType.Noise: filter.Noise(indata, out outdata); break; } audioClips[mCurrentFilter] = AudioClip.Create("sound", outdata.Length, channels, frequency, false, false); audioClips[mCurrentFilter].SetData(outdata, 0); } CloseButtonBar(); audio.clip = audioClips[mCurrentFilter]; CurrentTime = (int)audio.clip.length; bLastSaved=false; } } sender.SetBottomTextColor(sender.Checked, new Color(0.79f,0.94f,0.1f,1)); //green }