示例#1
0
    /*void Update () {
     *      if (Input.GetKey (KeyCode.Q) || Input.GetKey (KeyCode.W)) {
     *              Loop ("footsteps_walk_carpet_3");
     *      } else {
     *              if (Input.GetKeyUp (KeyCode.Q) || Input.GetKeyUp (KeyCode.W)) {
     *                      Stop ("footsteps_walk_carpet_3");
     *              }
     *      }
     * }*/

    public void Play(AudioClip clip)
    {
        clips = ExtensionMethods.AppendArray(clips, clip);
        AudioSource source = GetSource(name);

        if (!source.isPlaying)
        {
            source.clip = clip;
            source.Play();
        }
    }