Ejemplo n.º 1
0
 private void Update()
 {
     if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1))
     {
         SoundyManager.Play("Example Clicks", "Bubble Pop");
     }
 }
Ejemplo n.º 2
0
 public virtual void Awake()
 {
     BackButton.Init();
     SoundyManager.Init();
     Database.Add(GetComponent <T>());
     UpdateStartValues();
 }
Ejemplo n.º 3
0
 /// <summary> Plays the sound (if enabled) of this UIAction </summary>
 public void PlaySound()
 {
     if (!HasSound)
     {
         return;
     }
     SoundyManager.Play(SoundData);
 }
Ejemplo n.º 4
0
 void Start()
 {
     buttons   = new List <GameObject>();
     actualCar = PlayerAvatar.Instance.ActualCar;
     SpawnCar(actualCar.CarMenuViewPrefab);
     SetCarDefaultColor();
     SoundyManager.Play(CarVFXSettings.Instance.music, null, Vector3.zero, 0.5f, 1, true, 0);
 }
Ejemplo n.º 5
0
    private void Start()
    {
        //StartTimer();
        SoundyManager.StopAllSounds();
        SoundyManager.Play("Music", "GameMusic");

        Inventory.onInventoryChange += OnInventoryItemsChange;
    }
Ejemplo n.º 6
0
 public override void OnEnter()
 {
     if (DebugMode.Value)
     {
         DDebug.Log("Playmaker - State Name [" + State.Name + "] - Play Sound");
     }
     SoundyManager.Play(DatabaseName.Value, SoundName.Value);
     if (FinishImmediately.Value)
     {
         Finish();
     }
 }
Ejemplo n.º 7
0
 public override void OnEnter()
 {
     if (DebugMode.Value)
     {
         DDebug.Log("Playmaker - State Name [" + State.Name + "] - Pause All Sounds");
     }
     SoundyManager.PauseAllSounds();
     if (FinishImmediately.Value)
     {
         Finish();
     }
 }
 public override void OnEnter()
 {
     if (DebugMode.Value)
     {
         DDebug.Log("Playmaker - State Name [" + State.Name + "] - Play AudioClip");
     }
     SoundyManager.Play(AudioClip);
     if (FinishImmediately.Value)
     {
         Finish();
     }
 }
Ejemplo n.º 9
0
 private void OnTriggerEnter(Collider other)
 {
     Debug.Log("Hit something");
     if (other.CompareTag("Enemy"))
     {
         Debug.Log("Hit Enemy");
         IEnemy enemy = other.GetComponent <IEnemy>();
         SoundyManager.Play("General", "Hit");
         Vector3    particleSpawnPos = other.transform.position + new Vector3(0f, 1.5f, 0f);
         GameObject _hitPart         = Instantiate(hitParticle, particleSpawnPos, Quaternion.identity);
         Destroy(_hitPart, 1f);
         enemy.TakeHit();
     }
     Destroy(gameObject);
 }
        public override void OnEnter(Node previousActiveNode, Connection connection)
        {
            base.OnEnter(previousActiveNode, connection);
            if (ActiveGraph == null)
            {
                return;
            }

            switch (SoundAction)
            {
            case SoundActions.Play:
                if (HasSound)
                {
                    SoundyManager.Play(SoundData);
                }
                break;

            case SoundActions.Stop:
                SoundyManager.StopAllSounds();
                break;

            case SoundActions.Pause:
                SoundyManager.PauseAllSounds();
                break;

            case SoundActions.Unpause:
                SoundyManager.UnpauseAllSounds();
                break;

            case SoundActions.Mute:
                SoundyManager.MuteAllSounds();
                break;

            case SoundActions.Unmute:
                SoundyManager.UnmuteAllSounds();
                break;

            default: throw new ArgumentOutOfRangeException();
            }

            if (!FirstOutputSocket.IsConnected)
            {
                return;
            }
            ActiveGraph.SetActiveNodeByConnection(FirstOutputSocket.FirstConnection);
        }
Ejemplo n.º 11
0
    void ShootFX()
    {
        GameObject _shootParticle = Instantiate(shootParticle, shootPosition.position, Quaternion.identity);

        Destroy(_shootParticle, 1f);
        // sound
        SoundyManager.Play("General", "Shoot", shootPosition.position);
        // animation
        //_anim.SetTrigger("Shoot");
        Vector3 gunEndRot = transform.localEulerAngles + new Vector3(0f, 0f, 360f);

        transform.DOLocalRotate(gunEndRot, startFireCooldown - 0.05f, RotateMode.FastBeyond360).SetEase(gunRotationEase);
        // rotate magazine
        Transform magazine = transform.GetChild(0);
        Vector3   endRot   = magazine.localEulerAngles + new Vector3(0f, 0f, 35f);

        magazine.DOLocalRotate(endRot, 0.3f);
    }
Ejemplo n.º 12
0
    private void Update()
    {
        if (!_editable || GameMgr.Inst.IsRunning || !_uiBtn.IsSelected)
        {
            return;
        }

        foreach (var conf in GameMgr.Inst.Configs)
        {
            if (Input.GetKeyDown(conf.ShortcutKey))
            {
                SoundyManager.Play("Example Clicks", "Button Tap");
                SetCommandConf(conf);
            }
        }

        if (Input.GetKeyDown(KeyCode.Delete) || Input.GetKeyDown(KeyCode.Backspace))
        {
            SoundyManager.Play("Example Clicks", "Button Tap");
            Remove();
        }
    }
Ejemplo n.º 13
0
 // public static CheckoutArea instance;
 // private void Awake() {
 //  if(instance == null) {
 //      instance = this;
 //  }
 // }
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Cart"))
     {
         CartController cart = other.GetComponent <CartController>();
         // stop using the cart
         cart.StopUsingCart();
         // add to score
         TimedRush.instance.IncrementScore(cart.cartScore);
         // reset game state
         TimedRush.instance.SetGameState(GameStates.FindItems);
         // Cart complete sound
         SoundyManager.Play("General", "CartComplete", transform.position);
         // cart enter particle
         GameObject cartEnterPart = Instantiate(CheckoutAreasManager.instance.GetCartEnterParticle(), other.transform.position, Quaternion.identity);
         Destroy(cartEnterPart, 2f);
         float newCartDelay = 0.5f;
         // destroy cart after some time
         Destroy(cart.gameObject, newCartDelay);
         // spawn new cart
         ShoppingCartManager.instance.SpawnCartAtEmptyPosAfterDelay(newCartDelay);
     }
 }
Ejemplo n.º 14
0
    private void Update()
    {
        // Resetting the outline
        if (_interactingObject != null)
        {
            //Debug.Log("Resetting");
            _interactingObject.GetComponentInChildren <Outline>().enabled = false;
            _interactingObject = null;
        }
        RaycastHit hit;
        Outline    targetOutline = null;

        // Chehcking raycast
        if (Physics.Raycast(transform.position, transform.forward, out hit, interactDistance, interactLayer))
        {
            //Debug.Log("hit");
            Transform interactingObject = hit.transform;
            if (!targetOutline)
            {
                targetOutline = interactingObject.GetComponentInChildren <Outline>();
            }
            // enable the outline
            targetOutline.enabled = true;
            // wait for interaction input
            if (Input.GetButtonDown("Interact"))
            {
                IInteractible interactible = hit.collider.GetComponent <IInteractible>();
                if (interactible != null)
                {
                    SoundyManager.Play("General", "Grab");
                    interactible.Interact();
                }
            }
            _interactingObject = interactingObject;
        }
    }
Ejemplo n.º 15
0
 private void Start()
 {
     SoundyManager.StopAllSounds();
     SoundyManager.Play("Music", "MenuMusic");
 }