Search Unity

Design patter between singleton and current class.

Discussion in 'Scripting' started by IndieFist, Oct 29, 2019.

  1. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    Hi, i have a question about pattern design of my singleton for manage ads.
    In picture you can see my singleton to initialize my ads manager.
    But I want to have in a current class the delegate system, for ask a video to my GestionAds.Instance.showVideo() from my current.class and inside this one the delegate:
    Yodo1U3dSDK.setRewardVideoDelegate((Yodo1U3dConstants.AdEvent adEvent, string error) => etc...
    and show the reward when case Yodo1U3dConstants.AdEvent.AdEventFinish:
    Is this pattern a good choice?
     

    Attached Files: