Example #1
0
    public void SetPlacementAlignment(string placementName, AATKitBinding.BannerAlignment bannerAlignment)
    {
        Log("SetPlacementAlignment placementName: " + placementName + " bannerAlignment: " + bannerAlignment);
        if (IsInitialized() && PlacementExists(placementName))
        {
            AATKitBanner aATKitBanner = placements[placementName];
            switch (bannerAlignment)
            {
            case AATKitBinding.BannerAlignment.TopLeft:
                aATKitBanner.SetPositionOnTheScreen(new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(0f, 1f));
                break;

            case AATKitBinding.BannerAlignment.TopCenter:
                aATKitBanner.SetPositionOnTheScreen(new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0.5f, 1f));
                break;

            case AATKitBinding.BannerAlignment.TopRight:
                aATKitBanner.SetPositionOnTheScreen(new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(1f, 1f));
                break;

            case AATKitBinding.BannerAlignment.BottomLeft:
                aATKitBanner.SetPositionOnTheScreen(new Vector2(0f, 0f), new Vector2(0f, 0f), new Vector2(0f, 0f));
                break;

            case AATKitBinding.BannerAlignment.BottomCenter:
                aATKitBanner.SetPositionOnTheScreen(new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0.5f, 0f));
                break;

            case AATKitBinding.BannerAlignment.BottomRight:
                aATKitBanner.SetPositionOnTheScreen(new Vector2(1f, 0f), new Vector2(1f, 0f), new Vector2(1f, 0f));
                break;
            }
        }
    }
Example #2
0
 public void CreatePlacement(string placementName, AATKitBinding.PlacementSize placementSize)
 {
     Log("CreatePlacement placementName: " + placementName + " placementSize: " + placementSize);
     if (IsInitialized())
     {
         if (placements.ContainsKey(placementName))
         {
             Log("Cannot create placement. " + placementName + " already exists.");
         }
         if (placementSize == AATKitBinding.PlacementSize.Fullscreen || placementSize == AATKitBinding.PlacementSize.MultiSizeBanner || placementSize == AATKitBinding.PlacementSize.Rewarded)
         {
             Log("Ignoring creating placement. Placement size " + placementSize + " is not supported in the Unity Editor.");
             return;
         }
         AATKitBanner aATKitBanner = UnityEngine.Object.Instantiate(bannerPrefab, base.transform);
         aATKitBanner.gameObject.name = placementName;
         aATKitBanner.placementSize   = placementSize;
         placements.Add(placementName, aATKitBanner);
     }
 }