void Attack()                                                   //método de ataque
    {
        Charge = true;                                              //está carregando o ataque
        if (!alratack)                                              //se já não tiver atacado
        {
            loadtime -= Time.deltaTime;                             //diminua o tempo para usar o ataque em um frame

            anim.SetBool("Charge", true);                           //"avisae pro animator que pode rodar a animação de carregar o ataque"
            if (loadtime > 0.0f)                                    //até o tempo de carregamento do ataque acabar ¬
            {                                                       //															   v
                rigb.velocity = new Vector2(0.0f, rigb.velocity.y); //fica parado, corno
            }
        }

        if (loadtime <= 0.0f)                //se o tempo de carregamento do ataque acabou
        {
            AudioInterface a = this.gameObject.GetComponent <AudioInterface>();

            a.PlaySound("dash");
            rigb.AddForce(new Vector2(speed * 4 * dir, 0.0f), ForceMode2D.Impulse); //empurre o inimigo na direção do jogador, muito rápido

            anim.SetBool("Charge", false);                                          //"já parou de carregar, não precisa mais tocar a animação de carregamento"

            loadtime = load;                                                        // reinicia o tempo de carregamento do ataque

            alratack = true;                                                        // o inimigo acabou de atacar, não dá pra ele começar a carregar o ataque de novo até ele ficar parado e na distância certa(linha 116)
        }
    }
Exemplo n.º 2
0
        private void SetApplicationDefaultDevice()
        {
            ObservableProcess process          = (cb_applications.SelectedItem as ObservableProcess);
            AudioInterface    currentInterface = (cb_interfaces.SelectedItem as AudioInterface);

            AudioInterfaceCollection.ChangeDefaultApplicationDevice(currentInterface, process);
            UpdateApplicationAudioDevices(process, true);
        }
Exemplo n.º 3
0
 private void Start()
 {
     m_scenario = GetComponent <ScenarioManager>();
     m_stats    = GetComponent <StatsManager>();
     m_scene    = GetComponent <ScenesManager>();
     m_audio    = GameObject.Find("Audio Source").GetComponent <AudioInterface>();
     state      = State.Processing;
 }
Exemplo n.º 4
0
    void OnEnable()
    {
        GameEvents.StartListening("selectKeyButton", Unselect);

        thiscode     = InputManager.instance.keybindings.CheckKey(innerName);
        keytext.text = thiscode.ToString();
        Unselect();
        a = this.gameObject.GetComponent <AudioInterface>();
    }
Exemplo n.º 5
0
 public Chip8XMachine() : base()
 {
     m_VideoInterface = new VideoInterface(this);
     m_AudioInterface = new AudioInterface();
     m_CodeEngine     = new Interpreter(this);
     m_HybridDynarec  = new ILDynarec <ILEmitter1802>();
     m_ResManager     = new ChipResources(this);
     m_PatchEngine    = new CodePatchEngine();
 }
Exemplo n.º 6
0
    void jump()
    {
        AudioInterface a = this.gameObject.GetComponent <AudioInterface>();

        if ((!anim.GetCurrentAnimatorStateInfo(0).IsName("attack") || this.gameObject.GetComponent <CombatEnemy>().stuncheck()) && isGrounded)
        {
            rigb.AddForce(new Vector2(-dir * jumpforce / 2, jumpforce), ForceMode2D.Impulse);
            isGrounded = false;
            a.PlaySound("jump");
        }
    }
 private Task StartPlaySilence(AudioInterface audioInterface)
 {
     if (audioInterface.IsActive && silentAudioEvent?.PlaybackState != PlaybackState.Playing)
     {
         SilenceProvider provider = new SilenceProvider(WaveFormat.CreateIeeeFloatWaveFormat(44100, 2));
         silentAudioEvent = new WaveOutEvent()
         {
             DeviceNumber = GetWaveOutDeviceNumber(audioInterface)
         };
         silentAudioEvent.Init(provider);
         silentAudioEvent.Play();
     }
     return(Task.CompletedTask);
 }
        private static int GetWaveOutDeviceNumber(AudioInterface audioInterface)
        {
            int    deviceNameMaxLength = Math.Min(audioInterface.FriendlyName.Length, 31);
            string deviceNameTruncated = audioInterface.FriendlyName.Substring(0, deviceNameMaxLength);

            for (int i = 0; i < WaveOut.DeviceCount; i++)
            {
                if (WaveOut.GetCapabilities(i).ProductName == deviceNameTruncated)
                {
                    return(i);
                }
            }
            return(-1);
        }
Exemplo n.º 9
0
    public void Reset()
    {
        m_PotController.ClearEffect();
        m_PotController.SetColor(Color.white);

        m_TargetPotController.RandomSetting();

        for (int i = 0; i < COUNTAINER_COUNT; i++)
        {
            m_itemContainerList[i].RemoveItem();
        }

        m_AudioInterface  = DouduckGameCore.GetSystem <AudioInterface> ();
        itemNameText.text = "";
    }
Exemplo n.º 10
0
    // Start is called before the first frame update
    void Start()
    {
        a      = this.gameObject.GetComponent <AudioInterface>();
        Player = GameObject.FindGameObjectWithTag("Player").transform; //busca por um objeto com a tag "Player" (tag = marcador/categoria) e coloca suas cordenadas na variável Player.

        trs = GetComponent <Transform> ();                             //acessa as coordenadas do inimigo e coloca dentro da variável trs

        rigb = GetComponent <Rigidbody2D> ();                          //this.gameObject vai acessar o objeto em que esse script foi colocado e, com o método GetComponent<RigidBody2D>() vai pegar o componente de física dele e jogar para a variável rigb;

        anim = GetComponent <Animator> ();                             // acessa o componente de animação (a Classe Animator) do inimigo e joga pra dentro da variável "anim"

        spr = GetComponent <SpriteRenderer> ();

        mainCode = GetComponent <CombatEnemy>();

        col = GetComponent <CircleCollider2D>();
    }
Exemplo n.º 11
0
        private void UpdateApplicationAudioDevices(ObservableProcess process, bool announceChanges)
        {
            AudioInterface applicationRender     = AudioInterfaceCollection.GetDefaultApplicationDevice(DataFlow.Render, process);
            AudioInterface applicationCapture    = AudioInterfaceCollection.GetDefaultApplicationDevice(DataFlow.Capture, process);
            string         previousAppRenderText = app_render.Text;

            app_render.Text = applicationRender?.FriendlyName ?? Properties.Resources.text_default;
            if (announceChanges && app_render.Text != previousAppRenderText)
            {
                AnnounceVisualElementChanged(app_render);
            }
            string previousAppCaptureText = app_capture.Text;

            app_capture.Text = applicationCapture?.FriendlyName ?? Properties.Resources.text_default;
            if (announceChanges && app_capture.Text != previousAppCaptureText)
            {
                AnnounceVisualElementChanged(app_capture);
            }
        }
Exemplo n.º 12
0
 private void Awake()
 {
     instance = this;
     InitSpectrum();
 }
Exemplo n.º 13
0
 public RealityCoprocessor(Nintendo64 nintendo64)
 {
     this.nintendo64 = nintendo64;
     SP         = new SignalProcessor(this);
     DP         = new DisplayProcessor(this);
     PI         = new ParallelInterface(this);
     SI         = new SerialInterface(this);
     AI         = new AudioInterface(this);
     VI         = new VideoInterface(this);
     MI         = new MIPSInterface(this);
     RI         = new RDRAMInterface(this);
     MemoryMaps = new[]
     {
         new MappingEntry(0x00000000, 0x03FFFFFF, false)
         {
             Read  = nintendo64.RAM.MemoryMaps.ReadWord,
             Write = nintendo64.RAM.MemoryMaps.WriteWord
         },
         new MappingEntry(0x04000000, 0x040FFFFF, false)
         {
             Read  = SP.MemoryMaps.ReadWord,
             Write = SP.MemoryMaps.WriteWord
         },
         new MappingEntry(0x04100000, 0x041FFFFF, false)
         {
             Read  = DP.MemoryMaps.ReadWord,
             Write = DP.MemoryMaps.WriteWord
         },
         new MappingEntry(0x04300000, 0x043FFFFF, false)
         {
             Read  = MI.MemoryMaps.ReadWord,
             Write = MI.MemoryMaps.WriteWord
         },
         new MappingEntry(0x04400000, 0x044FFFFF, false)
         {
             Read  = VI.MemoryMaps.ReadWord,
             Write = VI.MemoryMaps.WriteWord
         },
         new MappingEntry(0x04500000, 0x045FFFFF, false)
         {
             Read  = AI.MemoryMaps.ReadWord,
             Write = AI.MemoryMaps.WriteWord
         },
         new MappingEntry(0x04600000, 0x046FFFFF, false)
         {
             Read  = PI.MemoryMaps.ReadWord,
             Write = PI.MemoryMaps.WriteWord
         },
         new MappingEntry(0x04700000, 0x047FFFFF, false)
         {
             Read  = RI.MemoryMaps.ReadWord,
             Write = RI.MemoryMaps.WriteWord
         },
         new MappingEntry(0x04800000, 0x048FFFFF, false)
         {
             Read  = SI.MemoryMaps.ReadWord,
             Write = SI.MemoryMaps.WriteWord
         },
         new MappingEntry(0x10000000, 0x1FBFFFFF, false)
         {
             Read = PI.MemoryMaps.ReadWord
         },
         new MappingEntry(0x1FC00000, 0x1FC007FF, false)
         {
             Read  = SI.MemoryMaps.ReadWord,
             Write = SI.MemoryMaps.WriteWord
         }
     };
 }
Exemplo n.º 14
0
 public void Init(int index, AudioInterface audioInterface)
 {
     this.index          = index;
     this.audioInterface = audioInterface;
     material            = GetComponent <SpriteRenderer> ().material;
 }
Exemplo n.º 15
0
 void Start()
 {
     trs = this.gameObject.GetComponent <Transform>();
     a   = this.gameObject.GetComponent <AudioInterface>();
 }
Exemplo n.º 16
0
 void Awake()
 {
     _instance = this;
 }
 //
 public void SetInterface(AudioInterface i)
 {
     _interface = i;
 }
Exemplo n.º 18
0
 void Start()
 {
     a             = this.gameObject.GetComponent <AudioInterface>();
     anim          = this.gameObject.GetComponent <Animator>();
     sign_instance = Instantiate(dangerSign, new Vector3(this.gameObject.GetComponent <Transform>().position.x, -65, 0), new Quaternion(0, 0, 0, 0));
 }
Exemplo n.º 19
0
 void Start()
 {
     a        = this.gameObject.GetComponent <AudioInterface>();
     mainCode = this.gameObject.GetComponent <MasterController>();
 }
Exemplo n.º 20
0
    void ChangeMusic()
    {
        AudioInterface a = this.gameObject.GetComponent <AudioInterface>();

        a.PlaySound("boss");
    }
Exemplo n.º 21
0
 void Start()
 {
     mainCode = this.gameObject.GetComponent <MasterController>();
     a        = this.gameObject.GetComponent <AudioInterface>();
     temprad  = mainCode.radius;
 }
Exemplo n.º 22
0
 void Start()
 {
     mainCode           = this.gameObject.GetComponent <MasterController>();
     mainCode.knockback = Vector2.zero;
     a = this.gameObject.GetComponent <AudioInterface>();
 }
Exemplo n.º 23
0
 void Start()                                             //método padrão do unity que roda no início da fase/cena
 {
     a = this.gameObject.GetComponent <AudioInterface>(); //this.gameObject vai acessar o objeto em que esse script foi colocado e, com o método GetComponent<AudioSource>() vai pegar o componente de áudio dele e jogar para a variável aud;
 }
Exemplo n.º 24
0
 // Start is called before the first frame update
 void Start()
 {
     this.iface = this.gameObject.GetComponent <AudioInterface>();
     this.iface.AddTrack(AudioTracks.Tracks.HigherDrums);
     this.iface.AddTrack(AudioTracks.Tracks.LowerDrums);
 }
 void Awake()
 {
     AnBook = GameObject.Find("AnotationBook").GetComponent <AnotationManager>();
     a      = ao.GetComponent <AudioInterface>();
 }