Exemplo n.º 1
0
    void Awake()
    {
        sfx   = FindObjectOfType <SfxPlayer>();
        music = FindObjectOfType <MusicPlayer>();

        StartGame();
    }
Exemplo n.º 2
0
    public void Ready(int i_TeamIndex)
    {
        if (IsValidIndex(i_TeamIndex))
        {
            if (!IsReady(i_TeamIndex))
            {
                // Cancel current selection, if any.

                SelectionCache cache = m_SelectionsCache[i_TeamIndex];

                if (!cache.IsEmpty())
                {
                    GameObject lastSelection = cache[0];
                    if (lastSelection != null)
                    {
                        tnUICharacterSlot slot = lastSelection.GetComponent <tnUICharacterSlot>();
                        if (slot != null)
                        {
                            slot.Deselect();
                        }
                    }

                    cache.Clear();
                }

                m_Confirmations[i_TeamIndex] = true;
                UpdateOverlay(i_TeamIndex);

                SfxPlayer.PlayMain(m_ReadySfx);
            }
        }
    }
Exemplo n.º 3
0
    public override void PlayerCommand(GameObject player)
    {
        if (hasCustomer && hasOrder)
        {
            if (Player.SetHasOrder(true, orderNumber))
            {
                Debug.Log("Get Order");
                hasOrder           = false;
                orderBubble.sprite = foodBubble[orderNumber];
            }
            else
            {
                //waring order
            }
        }

        if (hasCustomer && !hasFood && orderNumber == Player.instance.foodNumber)
        {
            if (Player.SetHasFood(false, -1))
            {
                Debug.Log("Sent Food");
                hasFood    = true;
                foodNumber = orderNumber;
                hero.ReceivedFood();
                SfxPlayer.PlaySfx(SfxEnum.HeroGetFood);
                orderBubble.sprite = null;
                foodOnTable.sprite = food[foodNumber];
            }
        }

        player.GetComponent <Animator>().SetTrigger("SE");
    }
Exemplo n.º 4
0
    void Start()
    {
        sfxPlayer = FindObjectOfType <SfxPlayer>();
        player    = GetComponent <Rigidbody2D>();

        src     = transform.Find("Source");
        reticle = src.Find("Reticle");

        characterInfo  = gameObject.GetComponentInChildren <CharacterInfo>();
        spriteRenderer = characterInfo.GetComponent <SpriteRenderer>();
        animator       = characterInfo.gameObject.GetComponent <Animator>();

        switch (PlayerNumber)
        {
        case PlayerNumber.PLAYER_1:
            playerNum = 1;
            break;

        case PlayerNumber.PLAYER_2:
            playerNum = 2;
            break;

        case PlayerNumber.PLAYER_3:
            playerNum = 3;
            break;

        case PlayerNumber.PLAYER_4:
            playerNum = 4;
            break;

        case PlayerNumber.PLAYER_N:     //Oh god ryan why
            break;
        }
    }
Exemplo n.º 5
0
    public void SetDeviceSide(tnUI_MP_DeviceSide i_Side, bool i_Immediatly)
    {
        if (!m_IsActive)
        {
            return;
        }

        if (i_Side != m_CurrentSide)
        {
            m_CurrentSide = i_Side;

            CancelCoroutine();

            SfxPlayer.PlayMain(m_Move_Sfx);

            if (!i_Immediatly)
            {
                m_CurrentCorroutine = MoveDevice();
                StartCoroutine(m_CurrentCorroutine);
            }
            else
            {
                Vector2 targetPosition = GetIdealPosition();
                Internal_SetDeviceAnchoredPosition(targetPosition);
            }
        }
    }
    protected override IEnumerator EndMatchSequence()
    {
        // Final wistle.

        SfxPlayer.PlayMain(m_FinalWhistleSfx);

        // Wait.

        yield return new WaitForSeconds(m_WaitBetweenFinalWhistleAndResults);

        // Close HUD.

        UI.ClosePanel(m_CelebrationPanel);

        // Show results.

        UI.OpenPanel(m_FlatBackgroundPanel);

        if (m_SubbuteoMatchResultsPanel != null)
        {
            m_SubbuteoMatchResultsPanel.Config(this);
        }

        UI.OpenPanel(m_SubbuteoMatchResultsPanel);

        // Wait.

        yield return new WaitForSeconds(m_WaitAfterResults);
    }
Exemplo n.º 7
0
        private void SpawnFlame()
        {
            var position = transform.position;
            var spawnPos = position / 1.6f;
            var spawnX   = Mathf.Round(spawnPos.x) * 1.6f;
            var spawnY   = Mathf.Round(spawnPos.y) * 1.6f;

            spawnPos = new Vector3(spawnX, spawnY, 0);
            // Check if the position is clear.
            var results = Physics2D.OverlapBoxAll(spawnPos, Vector2.one * 0.4f, 0);

            foreach (var coll in results)
            {
                if (coll.CompareTag("Flame"))
                {
                    return;
                }
            }
            // Spawn the flame.
            SfxPlayer.PlayAudio(_castClip);
            _ammo--;
            _timeSinceAction = 0;
            var flame = Instantiate(_flamePrefab, spawnPos, Quaternion.identity);

            flame.GetComponent <Flame>().SetOwner(gameObject);
        }
Exemplo n.º 8
0
 private void OnDestroy()
 {
     if (instance == this)
     {
         instance = null;
     }
 }
Exemplo n.º 9
0
    // Scrolls through the list of sounds when invoken, and sets the sound settings
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);

        if (sounds != null)
        {
            foreach (Sound s in sounds)
            {
                s.source      = gameObject.AddComponent <AudioSource> ();
                s.source.clip = s.clip;

                s.source.volume = s.volume;
                s.source.pitch  = s.pitch;
                s.source.loop   = s.loop;
                print(s.name);
            }
        }
    }
Exemplo n.º 10
0
 public void Awake()
 {
     ship      = GameObject.Find("Federico");
     playspace = GameObject.FindWithTag("PlaySpace");
     sPlayer   = GameObject.Find("SfxPlayer").GetComponent <SfxPlayer>();
     //speedometer = GameObject.Find("Speedometer").GetComponent<Text>();
     //helm = GameObject.Find("HelmPanel");
 }
Exemplo n.º 11
0
 void Awake()
 {
     if(Instance != null)
     {
         print("too many instance");
     }
     Instance = this;
 }
Exemplo n.º 12
0
    public override void _Ready()
    {
        _animationPlayer = this.GetNode <AnimationPlayer>();
        _heartBeat       = GetNode <HeartBeat>("/root/HeartBeat");
        _heartBeat.SafeConnect(nameof(HeartBeat.OnHeartBeat), this, nameof(OnHeartBeat));

        _explodeSfx = this.GetNode <SfxPlayer>();
    }
Exemplo n.º 13
0
 private void Start()
 {
     inputManager      = ClassManager.instance.inputManager;
     prefabManager     = ClassManager.instance.prefabManager;
     groundTileManager = ClassManager.instance.groundTileManager;
     sfxPlayer         = ClassManager.instance.sfxPlayer;
     updateUiFoodCounts();
 }
    public void SelectByIndex(int i_Index)
    {
        Internal_SelectByIndex(i_Index);

        // Play sfx.

        SfxPlayer.PlayMain(m_SelectionChangedSfx);
    }
Exemplo n.º 15
0
 void Awake()
 {
     // Set up the references.
     gunParticles = gunBarrel.GetComponent <ParticleSystem> ();
     gunLine      = gunBarrel.GetComponent <LineRenderer> ();
     gunLight     = gunBarrel.GetComponent <Light> ();
     //faceLight = GetComponentInChildren<Light> ();
     sfxPlayer = GetComponent <SfxPlayer>();
 }
Exemplo n.º 16
0
    public void Initialize(Vector2 position, float zRotationDeg, Vector2 v, SfxPlayer sfxPlayer)
    {
        this.transform.position    = position;
        this.transform.eulerAngles = new Vector3(0, 0, zRotationDeg);

        this.v = v;
        this.timeOfCreation = Time.time;
        this.sfxPlayer      = sfxPlayer;
    }
Exemplo n.º 17
0
        public override void OnEnter()
        {
            if (!audioClip.IsNone && audioClip.Value != null)
            {
                SfxPlayer.PlayMain((AudioClip)audioClip.Value, audioMixerGroup, volume);
            }

            Finish();
        }
Exemplo n.º 18
0
 public override void CustomerCommand(GameObject customer)
 {
     if (customer.GetComponent <Hero>().isCheckout)
     {
         checkoutList.Add(customer.GetComponent <Hero>());
         SfxPlayer.PlaySfx(SfxEnum.HeroCheckout);
         UpdateHeroPosition();
     }
 }
Exemplo n.º 19
0
    public override void _Ready()
    {
        _fadingLabelScene = ResourceLoader.Load <PackedScene>($"res://gameplay/TemporaryLabel.tscn");
        _kaboomScene      = ResourceLoader.Load <PackedScene>($"res://gameplay/Kaboom.tscn");
        RemainingHealth   = MaxHealth;
        Root = this.FindRoot();

        _tookDamageSfx = this.GetNode <SfxPlayer>();
    }
Exemplo n.º 20
0
    public override void _Ready()
    {
        _notesSfx = GetNode <SfxPlayer>("NotesSfxPlayer");
        _snareSfx = GetNode <SfxPlayer>("SnareSfxPlayer");
        _bassSfx  = GetNode <SfxPlayer>("BassSfxPlayer");

        _heartBeat = GetNode <HeartBeat>("/root/HeartBeat");
        _heartBeat.SafeConnect(nameof(HeartBeat.OnHeartBeat), this, nameof(OnHeartBeat));
    }
Exemplo n.º 21
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         SfxPlayer.PlayAudio(_powerUpClip);
         other.GetComponent <PlayerAction>().ChangeAmmo(1);
         Destroy(gameObject);
     }
 }
Exemplo n.º 22
0
 private void Start()
 {
     spriteManager = ClassManager.instance.spriteManager;
     inputManager  = ClassManager.instance.inputManager;
     ageManager    = ClassManager.instance.ageManager;
     prefabManager = ClassManager.instance.prefabManager;
     sfxPlayer     = ClassManager.instance.sfxPlayer;
     restock();
 }
Exemplo n.º 23
0
 public void AddHeroCheckin(Hero hero)
 {
     if (!IsCheckinFull())
     {
         checkinList.Add(hero);
         UpdateHeroPosition();
         SfxPlayer.PlaySfx(SfxEnum.HeroCheckIn);
     }
 }
Exemplo n.º 24
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         SfxPlayer.PlayAudio(_powerUpClip);
         LightUp();
         Destroy(gameObject);
     }
 }
Exemplo n.º 25
0
 public override void CustomerCommand(GameObject customer)
 {
     hasCustomer = true;
     customer.transform.position = this.customer.transform.position;
     hero = customer.GetComponent <Hero>();
     hero.AssignTable(this);
     SfxPlayer.PlaySfx(SfxEnum.HeroHungry);
     orderBubble.sprite = unknownBubble;
     customer.GetComponent <Animator>().SetTrigger("SW");
 }
Exemplo n.º 26
0
    void Awake()
    {
        img = gameObject.GetComponent <Image>();

        GameObject sfxObj = GameObject.Find("SfxPlayer");

        sfx = sfxObj.GetComponent <SfxPlayer>();

        coroutine = Flicker(waitTime);
        StartCoroutine(coroutine);
    }
Exemplo n.º 27
0
        // Prepares (instantiates) n amount of audio sources based on the buffer size specified.
        public void PrepareSfxBuffers(float volume)
        {
            if (m_sfx != null)
            {
                m_sfx.Stop();
                m_sfx = null;
            }

            m_sfx = new SfxPlayer(m_audioClip, m_SfxBufferSize);
            m_sfx.SetVolume(volume);
        }
Exemplo n.º 28
0
 private void Start()
 {
     playerInventory        = ClassManager.instance.playerInventory;
     groundTileManager      = ClassManager.instance.groundTileManager;
     selectedTileController = ClassManager.instance.selectedTileController;
     sfxPlayer    = ClassManager.instance.sfxPlayer;
     plantManager = ClassManager.instance.plantManager;
     ageManager   = ClassManager.instance.ageManager;
     foodManager  = ClassManager.instance.foodManager;
     shopManager  = ClassManager.instance.shopManager;
 }
Exemplo n.º 29
0
    public override void _Ready() {
        _battleSystem = GetNode<BattleSystem>("/root/BattleSystem");
        
        _heartBeat = GetNode<HeartBeat>("/root/HeartBeat");
        _heartBeat.SafeConnect(nameof(HeartBeat.OnHeartBeat), this, nameof(OnHeartBeat));

        _root = this.FindRoot();
        _vision = _root.AsNode().GetNode<Vision>();

        _hitWallSfx = this.GetNode<SfxPlayer>();
    }
    protected override void OnGoldenGoalStart()
    {
        base.OnGoldenGoalStart();

        int currentTick = TrueSyncManager.ticksMain;

        if (!m_GoldenGoalEffectsTicks.Contains(currentTick))
        {
            SfxPlayer.PlayMain(m_GoldenGoalSfx);
            m_GoldenGoalEffectsTicks.Add(currentTick);
        }
    }
Exemplo n.º 31
0
    /*
     * private GameObject statScrOverlayEBrake;
     * private GameObject statScrOverlayHelm;
     * private GameObject statScrOverlayNav;
     * private GameObject statScrOverlayManual;
     * private GameObject statScrOverlayAirlock;
     * private GameObject statScrOverlayShields;
     */

    private void Awake()
    {
        //Debug.Log(gameObject.GetComponent<SpriteRenderer>().sprite.name);
        anim   = GetComponent <Animator>();
        sfxObj = GameObject.Find("SfxPlayer");
        sfx    = sfxObj.GetComponent <SfxPlayer>();
        Debug.Log("SFX: " + sfx);

        throttleLoop = GetComponent <AudioSource>();

        // Debug.Log(gameObject.GetComponent<SpriteRenderer>().sprite.name);
    }