Esempio n. 1
0
 public void PlayAnimationAudio(string eventName)
 {
     if (controller != null)
     {
         if (audioData != null)
         {
             if (eventName == EventName)
             {
                 controller.PlayAudio(audioData, this.gameObject);
             }
             else
             {
                 Debug.LogWarning("Event Name does not match. Tried to play: " + eventName + " from: " + EventName);
             }
         }
         else
         {
             Debug.LogError("No audio data found on: " + this.name + " for Audio Event: " + EventName);
         }
     }
     else
     {
         Debug.LogError("No audio controller found on: " + this.name + " for Audio Event: " + EventName);
     }
 }
Esempio n. 2
0
    // Start is called before the first frame update
    void Start()
    {
        burnReset = burnTimer;

        if (controller != null)
        {
            if (fireballAudio != null)
            {
                controller.PlayAudio(fireballAudio, gameObject);
            }
        }
    }
Esempio n. 3
0
    public void HandleOnGrab()
    {
        _isInRest = false;

        transform.rotation = _startRotation;

        if (_resetPositionCoroutine != null)
        {
            StopCoroutine(_resetPositionCoroutine);
            _resetPositionCoroutine = null;
        }

        _audioSourceController.PlayAudio(_recording.Clip);
    }
Esempio n. 4
0
        public virtual bool Move(NeighborDirection dire)
        {
            if (!CanMove(dire))
            {
                return(false);
            }

            bool didMove = parent.GetNeighbor(dire).SetContent(this);

            if (didMove && MovedSound != null)
            {
                AudioSourceController.PlayAudio(MovedSound);
            }

            return(didMove);
        }
Esempio n. 5
0
 public void PlayAudioEvent()
 {
     controller.PlayAudio(audioData, gameObject);
 }
Esempio n. 6
0
    public void PlayAudioAtPoint(GameObject instantiatedBy)
    {
        controller.PlayAudio(audioData, instantiatedBy);

        Destroy(gameObject, 3);
    }