//tips
あとはステージ作成とシステムの問題の解決がメイン。
システムについてはもう少し突っ込んで理解してもいいかもしれない。
//easy,hard,hellモードの追加選択
title画面にeasy,hard,hellモードを追加する。
代わりにstartを削除して、int clearlevel = PlayerPrefs.GetInt("LEVEL", 0);を追加してレベル管理を行う。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class TitleManager : MonoBehaviour
{
public GameObject[] LevelButtons;
// Use this for initialization
void Start()
{
int clearlevel = PlayerPrefs.GetInt("LEVEL", 0);
for (int i = 0; i <= LevelButtons.GetUpperBound(0); i++)
{
bool buttonEnable;
if (clearlevel < i)
{
buttonEnable = false; //前ステージをクリアしていなければ無効
}
else
{
buttonEnable = true; //前ステージをクリアしていれば有効
}
LevelButtons[i].GetComponent<Button>().interactable = buttonEnable; //ボタンの有効/無効を設定
}
}
//スタートボタンを押した
public void PushStartButton()
{
SceneManager.LoadScene("StageSelect"); //ステージ選択シーンへ
}
public void PushStartButtonhard()
{
SceneManager.LoadScene("StageSelecthard"); //hardステージ選択シーンへ
}
public void PushStartButtonhell()
{
SceneManager.LoadScene("StageSelecthell"); //hellステージ選択シーンへ
}
}
//アイテム使用時のsubcameraの描写が透過する
アイテム使用時にsubcameraの描写の大半が透過部分になる場所があったのでclippingplanesのnearとfarを1e-09と1e+09まで拡大することで透過部分がだいぶ少なくなった。
ほとんどの人はこの向きでアイテムを使用することはないと思うが念のため。
//UnityADs広告導入のための試行錯誤
自分なりに試行錯誤してやってみたがGameIDSも表示されない状態。
本来はADSをONにした時点でDashbordに生成されるはず。
毎度発生するエラーで都度キャッシュを削除しているのが要因の気がする。ここでUnityADsの機能部分まで削除しているのではないか。
Library/PackageCache/com.unity.ads@3.4.9/Runtime/Monetization/IosPlacementContentOperations.cs(81,64): error CS0433: The type 'IUnityLifecycleManager' exists in both 'UnityEngine.Advertisements.Editor, Version=3.4.6.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Advertisements, Version=3.4.6.0, Culture=neutral, PublicKeyToken=null'
Library/PackageCache/com.unity.ads@3.4.9/Runtime/Monetization/IosPlacementContentOperations.cs(78,26): error CS0433: The type 'IUnityLifecycleManager' exists in both 'UnityEngine.Advertisements.Editor, Version=3.4.6.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Advertisements, Version=3.4.6.0, Culture=neutral, PublicKeyToken=null'
Library/PackageCache/com.unity.ads@3.4.9/Runtime/Monetization/IosPlacementContentOperations.cs(136,65): error CS0433: The type 'IUnityLifecycleManager' exists in both 'UnityEngine.Advertisements.Editor, Version=3.4.6.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Advertisements, Version=3.4.6.0, Culture=neutral, PublicKeyToken=null'
Library/PackageCache/com.unity.ads@3.4.9/Runtime/Monetization/MonetizationPlatform.cs(33,17): error CS0433: The type 'UnityLifecycleManager' exists in both 'UnityEngine.Advertisements.Editor, Version=3.4.6.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Advertisements, Version=3.4.6.0, Culture=neutral, PublicKeyToken=null'
Advertisementのバージョンを変更してインストールしてもエラーが出る。
以後はUnityAdsではなくAdMobの使用も模索してみる。