Example #1
0
    public virtual void Start()
    {
        sl   = FindObjectOfType <SoundLibrary>();
        unit = gameObject.GetComponent <Unit>();
        aso  = GetComponent <AudioSource>();

        switch (unit.name)
        {
        case "Revenant":
            unit.SetDeadClip(sl.GetRevenantDead());
            unit.SetHurtClip(sl.GetRevenantHurt());
            break;

        case "EliteRevenant":
            unit.SetDeadClip(sl.GetRevenantDead());
            unit.SetHurtClip(sl.GetRevenantHurt());
            break;

        case "FriendlyRevenant":
            unit.SetDeadClip(sl.GetRevenantDead());
            unit.SetHurtClip(sl.GetRevenantHurt());
            break;

        case "Necromancer":
            unit.SetDeadClip(sl.GetNecroDead());
            unit.SetHurtClip(sl.GetNecroHurt());
            break;
        }
    }