'UnityEngine.Advertisements' not found

Advertisement.Show(); … simply does not work… it was working before but now it stopped… so i made this new project and tried again… with this script

#pragma strict
import UnityEngine.Advertisements;
function Start () {
	 Advertisement.Show();
}

and it gives this error : Namespace ‘UnityEngine.Advertisements’ not found, maybe you forgot to add an assembly reference

services window looks fine too


tried reinstalling unity… still the same… please help ASAP… my games ready to publish

I'm not a fan of statics in component classes unless it's something explicitly needed for the state of the component (and not just an object reference).

–

1 Answer

1

Follow this Fix Advertisement Unity

You can use any Unity method though it wouldn't be a singleton. Object B wants to access Object A during OnEnable is already more information to show it's designed incorrectly. Object A, if truly a singleton, doesn't need to know when it's accessed, only that it can be at any point. Trying to determine the timing of its availability is a huge flaw.

–