private void Awake() { canSendData = true; soundsPlayer = GetComponent <SoundsPlayer>(); _followCanvas = FindObjectOfType <FollowCanvas>(); _timerManager = GetComponent <TimerManager>(); }
protected override void Awake() { base.Awake(); _button = GetComponent <Button>(); _soundsPlayer = GetComponentInChildren <SoundsPlayer>(); }
protected virtual void Die() { stateMachine.ExitState(); if (Anim != false) { Anim.enabled = false; } spriteAnim !.SetTrigger(Dying); var damageableAreas = GetComponentsInChildren <EnemyDamageableArea>(); foreach (var damageableArea in damageableAreas) { damageableArea.DisableCollider(); } damagingArea.DisableCollider(); HideShadows(); _enemyDeathParticles.PlayParticles(); _essenceOfPunishmentSpawner.SpawnEssences(BaseParameters.Stats.essenceOfPunishmentAmount); SoundsPlayer.Play("Dying"); onDie?.Invoke(); if (!BaseParameters.hasBeenSpawned) { SaveSystem.AddEnemyDead(BaseParameters.id); } }
// Start is called before the first frame update void Start() { rigidBody = GetComponent <Rigidbody>(); skinController = GetComponent <CharacterSkinController>(); animator = GetComponent <Animator>(); soundsPlayer = transform.Find("Sounds").GetComponent <SoundsPlayer>(); }
// Start is called before the first frame update void Start() { GameObject[] gos = GameObject.FindGameObjectsWithTag("ReflectProbes"); for (int i = 0; i < gos.Length; i++) { lights.Add(gos[i].GetComponent <ReflectionProbe>()); } soundsPlayer = transform.Find("Sounds").GetComponent <SoundsPlayer>(); }
void Awake() { camera = GameObject.Find("Main Camera").gameObject; playerName = transform.Find("Canvas").Find("Name").GetComponent <TextMeshProUGUI>(); skinController = GetComponent <CharacterSkinController>(); animator = GetComponent <Animator>(); rigidBody = GetComponent <Rigidbody>(); soundsPlayer = transform.Find("Sounds").GetComponent <SoundsPlayer>(); }
private void DirectionalAttack(Vector2 direction) { SetState(DirectionalAttackState); var force = directionalAttackInitialForce; force *= SaveSystem.currentMaskType == PlayerMaskController.MaskType.ScarletMask ? 1.9f : 1; force *= SaveSystem.currentMaskType == PlayerMaskController.MaskType.VigorousMask ? 1.25f : 1; Rigidbody.velocity = force * direction; SoundsPlayer.Play("Throwing"); }
public Juego(Storyboard ani_juego, Label label_puntuacion) { this.ani_juego = ani_juego; this.playing = false; this.canplay = false; Globals.cvLago.MouseDown += cvLago_MouseDown; Globals.cvLago.MouseEnter += mouseEnter; s = new SoundsPlayer(); d = new SoundsPlayer(); }
void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; GameObject.DontDestroyOnLoad(gameObject); } }
public static bool Create(SoundsPlayer soundsPlayer, int rootId, out SoundsPlayerSerialized result, bool saveClipToFile = false) { result = new SoundsPlayerSerialized { rootId = rootId }; for (var i = 0; i < 4; i++) { result.selectFrom.Add(soundsPlayer.Configs[i].SelectFrom); result.selectTo.Add(soundsPlayer.Configs[i].SelectTo); result.rate.Add(soundsPlayer.Configs[i].Rate); result.volume.Add(soundsPlayer.Configs[i].Volume); } return(true); }
private void clickOnCaca(object sender, MouseButtonEventArgs e) { s = new SoundsPlayer(); isCreated = false; cvBunny.Children.Remove(cvCaca); if (Globals.ProgressBar_diversion.Value >= 30) { s.cleaningSound(); Globals.score += 5; Globals.label_puntuacion.Content = "Puntuación: " + Globals.score; Globals.cacas--; showPuntuation(); } }
// Use this for initialization void Start() { sound = SoundsPlayer.Instance; if (sound != null) { SoundSlider.value = sound.GetSoundsVolume(); } CP.Game.AddToListener(this); playerManager = GetComponent <PlayerManager>(); InputController.EscapeEvent += OnTouchEscape; ExitGame.onClick.AddListener(OnExit); Escape.onClick.AddListener(OnEscape); SoundSlider.onValueChanged.AddListener(OnChangeSoundVolume); PassTurn.onClick.AddListener(OnPassTurn); }
private void PlayStepSound() { SoundsPlayer.Play("Step"); }
void Start() { instance = this; AS = GetComponent <AudioSource> (); }
/// <summary> /// Called when a new game is started. Sets all fields to default. /// </summary> public void FirstLoad() { _score = Camera.main.GetComponent<Score>(); currentWeapon = weaponFactory.getPistol (); currentWeaponInt = 1; unlocked [0] = true; for (int i = 1; i < unlocked.Length; i++) { unlocked [i] = false; } setUnActive (); setActive (); setTextOfLockUnlock (); for (int i = 0; i < 8; i ++) { unitCostWeaponTexts[i].text = weaponCost[i] + " Units"; } playerAnimator = gameObject.GetComponent<Animator> (); pSys1.enableEmission = false; pSys2.enableEmission = false; PlayerSounds = gameObject.GetComponent<SoundsPlayer>(); WeaponsSounds = gameObject.GetComponent<SoundsWeapons>(); WeaponsSounds.loadGunSounds(gameObject); if (currentWeaponInt == 1) { currentWeapon = weaponFactory.getPistol(); playerAnimator.SetInteger("weapon", 1); currentWeaponInt = 1; setAllWeaponsUnactive(); weapons[0].SetActive(true); } if (currentWeaponInt == 2) { currentWeapon = weaponFactory.getShrimpPistol(); currentWeaponInt = 2; playerAnimator.SetInteger("weapon", 1); setAllWeaponsUnactive(); weapons[1].SetActive(true); } if (currentWeaponInt == 3) { currentWeapon = weaponFactory.getStingerGun(); currentWeaponInt = 3; playerAnimator.SetInteger("weapon", 1); setAllWeaponsUnactive(); weapons[2].SetActive(true); } if (currentWeaponInt == 4) { currentWeapon = weaponFactory.getWeaponizedEel(); currentWeaponInt = 4; playerAnimator.SetInteger("weapon", 3); setAllWeaponsUnactive(); weapons[3].SetActive(true); } if (currentWeaponInt == 5) { currentWeapon = weaponFactory.getWunderwuffen(); currentWeapon.setType(new Type(1)); currentWeaponInt = 5; playerAnimator.SetInteger("weapon", 1); setAllWeaponsUnactive(); weapons[4].SetActive(true); } if (currentWeaponInt == 6) { currentWeapon = weaponFactory.getBatteringRam(); currentWeaponInt = 6; playerAnimator.SetInteger("weapon", 3); setAllWeaponsUnactive(); weapons[5].SetActive(true); } if (currentWeaponInt == 7) { currentWeapon = weaponFactory.getSwordfish(); currentWeaponInt = 7; playerAnimator.SetInteger("weapon", 2); setAllWeaponsUnactive(); weapons[6].SetActive(true); } if (currentWeaponInt == 8) { currentWeapon = weaponFactory.getBaseballBat(); currentWeaponInt = 8; playerAnimator.SetInteger("weapon", 2); setAllWeaponsUnactive(); weapons[7].SetActive(true); } }
public Hambre(Storyboard ani_hambre) { this.ani_hambre = ani_hambre; s = new SoundsPlayer(); }
public Dormir(Storyboard ani_dormir) { this.ani_dormir = ani_dormir; s = new SoundsPlayer(); }
public Comiendo(Storyboard ani_comiendo) { this.ani_comiendo = ani_comiendo; s = new SoundsPlayer(); ani_comiendo.Completed += comiendoStop; }
public Cansancio(Storyboard ani_cansancio) { this.ani_cansancio = ani_cansancio; s = new SoundsPlayer(); }
public MainWindow() { InitializeComponent(); string path = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "resources\\cursor.cur"); customCursor = new Cursor(path); counter = new Counter(); Timer_counter.Content = 0; Globals.firstGame = true; Globals.cvDormido = cvDormido; Globals.cvTriste = cvTriste; Globals.cvCama = cvCama; Globals.cvBunny = cvBunny; Globals.cvPescando = cvPescando; Globals.label_puntuacion = Label_Puntuacion; Globals.img_pause = img_pause; Globals.img_music = img_music; Globals.state = 0; Globals.listCaca = new List <Caca>(); Globals.cvLago = cvLago; Globals.cvFondo = cvFondo; //nivel Globals.progressbar_nivel = ProgressBar_nivel; Globals.label_nivel = Label_Nivel; //peces Globals.pezVerde = pezVerde; Globals.pezAmarillo = pezAmarillo; Globals.pezLila = pezLila; Globals.pezRojo = pezRojo; Globals.pezAzul = pezAzul; //progress bar Globals.ProgressBar_hambre = ProgressBar_hambre; Globals.ProgressBar_baño = ProgressBar_baño; Globals.ProgressBar_sueño = ProgressBar_sueño; Globals.ProgressBar_diversion = ProgressBar_diversion; Globals.cacas = 0; Globals.score = 0; Globals.state_label = Label_State; Globals.cvPause = cvPause; //Decoracion Globals.cvEstructuraCasa = cvEstructuraCasa; Globals.cvPuerta = cvPuerta; Globals.cvVentana = cvVentana; Globals.cvChimenea = cvChimenea; Globals.cvCarretera = cvCarretera; Globals.cvPajarillos = cvPajarillos; Globals.cvGafasSol = cvGafasSol; Globals.cvCampoFlores = cvCampoFlores; Globals.cvCampoFlores2 = cvCampoFlores2; //Inicializar animaciones ani_respirar = new Respirar(cuerpo); ani_parpadear = new Parpadear(parpadoIzq, parpadoDer); ani_rascarbarriga = new RascarBarrigaCanvas(cvBrazoIzquierdo, cvBrazoDerecho); ani_cansancio = new Cansancio(this.FindResource("sbCansancio") as Storyboard); ani_hambre = new Hambre(this.FindResource("sbHambre") as Storyboard); ani_dormir = new Dormir(this.FindResource("sbDurmiendo") as Storyboard); ani_comiendo = new Comiendo(this.FindResource("sbComiendo") as Storyboard); ani_triste = new Triste(this.FindResource("sbTristeza") as Storyboard); Globals.juego_pescar = new Juego(this.FindResource("movimientoPeces") as Storyboard, Label_Puntuacion); //Barra de progreso progressbar_controler = new ProgressBarControler( //ProgressBars Label_hambre, Label_baño, Label_sueño, Label_Puntuacion, Label_diversion, //Labels ani_cansancio, ani_hambre, ani_dormir, ani_triste, //Animations cvBunny) //Canvas ; Nivel nivel_controller = new Nivel(); temporizador = new Temporizador(this); temporizador.registrarObservador(progressbar_controler); temporizador.registrarObservador(nivel_controller); new Pause(); new ReadXml(progressbar_controler); s = new SoundsPlayer(); d = new SoundsPlayer(); s.ambientalSound(); d.welcomeSound(); //Leer XML }
// Start is called before the first frame update void Start() { soundsPlayer = transform.Find("Sounds").GetComponent <SoundsPlayer>(); light = transform.Find("Light").gameObject; }
// Start is called before the first frame update void Start() { soundsPlayer = transform.Find("Sounds").GetComponent <SoundsPlayer>(); }
public void Start() { playerAnimator = GetComponent<Animator>(); PlayerSounds = gameObject.GetComponent<SoundsPlayer>(); // LoadSound running = false; }
private void Start() { door = transform.Find("Inner").gameObject; soundsPlayer = GetComponent <SoundsPlayer>(); }
public Caca(Canvas cvBunny, Label label_puntuacion) { Random rnd = new Random(); top = rnd.Next(-40, 40); left = rnd.Next(-40, 40); Color color = Color.FromRgb(0, 0, 0); Globals.cacas++; isCreated = true; this.cvBunny = cvBunny; this.cvCaca = new Canvas(); cvCaca.Height = 45.3; cvCaca.Width = 74; cvCaca.Opacity = 100; Canvas.SetLeft(cvCaca, 362 + left); Canvas.SetTop(cvCaca, 390 + top); Ellipse EllipseA = new Ellipse(); EllipseA.Stroke = Brushes.Black; EllipseA.Fill = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FF825919")); EllipseA.Width = 74; EllipseA.Height = 23.05; Canvas.SetTop(EllipseA, 22.25); cvCaca.Children.Add(EllipseA); Ellipse EllipseB = new Ellipse(); EllipseB.Stroke = Brushes.Black; EllipseB.Fill = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FF825919")); EllipseB.Width = 56.4; EllipseB.Height = 22.25; EllipseB.Stroke = new SolidColorBrush(Colors.Black); Canvas.SetTop(EllipseB, 13.8); Canvas.SetLeft(EllipseB, 9.6); cvCaca.Children.Add(EllipseB); Ellipse EllipseC = new Ellipse(); EllipseC.Stroke = Brushes.Black; EllipseC.Fill = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FF825919")); EllipseC.Width = 38.8; EllipseC.Height = 16.25; EllipseC.Stroke = new SolidColorBrush(Colors.Black); Canvas.SetTop(EllipseC, 7.2); Canvas.SetLeft(EllipseC, 18.8); cvCaca.Children.Add(EllipseC); Ellipse EllipseD = new Ellipse(); EllipseD.Stroke = Brushes.Black; EllipseD.Fill = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FF825919")); EllipseD.Width = 18.8; EllipseD.Height = 13.8; EllipseD.Stroke = new SolidColorBrush(Colors.Black); Canvas.SetLeft(EllipseD, 28); cvCaca.Children.Add(EllipseD); cvCaca.Visibility = Visibility.Visible; cvCaca.MouseUp += clickOnCaca; cvCaca.MouseEnter += mouseEnter; cvBunny.Children.Add(cvCaca); s = new SoundsPlayer(); s.toiletSound(); }