Ejemplo n.º 1
0
    public SoundClip GetCopy(int _index)
    {
        if (_index < 0 || _index >= soundClips.Length)
        {
            return(null);
        }

        SoundClip newClip = new SoundClip();

        newClip.realID           = _index;
        newClip.clipPath         = soundClips[_index].clipPath;
        newClip.clipName         = soundClips[_index].clipName;
        newClip.maxVolume        = soundClips[_index].maxVolume;
        newClip.pitch            = soundClips[_index].pitch;
        newClip.dopplerLevel     = soundClips[_index].dopplerLevel;
        newClip.audioRolloffMode = soundClips[_index].audioRolloffMode;
        newClip.minDistance      = soundClips[_index].minDistance;
        newClip.maxDistance      = soundClips[_index].maxDistance;
        newClip.spatialBlend     = soundClips[_index].spatialBlend;
        newClip.isLoop           = soundClips[_index].isLoop;
        newClip.checkTime        = new float[soundClips[_index].checkTime.Length];
        newClip.setTime          = new float[soundClips[_index].setTime.Length];
        for (int i = 0; i < newClip.checkTime.Length; i++)
        {
            newClip.checkTime[i] = soundClips[_index].checkTime[i];
            newClip.setTime[i]   = soundClips[_index].setTime[i];
        }
        newClip.PreEnter();
        return(newClip);
    }