Applying custom Ambient Color in Surface Shader (legacy)

Hello,

I have a shader that uses a custom lighting function with legacy surface shader format.

I really hope to use a custom Ambient Color for this specific shader only.
Is it possible to do that?

I am on Legacy, Unity 2019.4.16f1


Right now, as you know, this affects globally and that is okay but I want to set a specific color only for the shader separately.

Thank you!

Got an answer from bgolus:

There’s a noambient directive you can add to the
#pragma surface
line, and then you can add your own ambient lighting however you want.
A solid color ambient is really just ambientColor * albedo * ambientOcclusion (and you can skip the AO if you want).

You can do this with or without a custom lighting function. Just do:

o.Emission += _AmbientColor * o.Albedo;