コード例 #1
0
 /// <summary>
 /// 1. Init: SDK 초기화, 콜백 등록
 /// </summary>
 public void Init()
 {
     // IsAvailable Callback
     AmondPlugin.GetInstance().CallbackAvailable = Sample.CheckAvailable;
     // Init
     AmondPlugin.GetInstance().Init(EnvironmentType.Stage, "game-hyper-sliding");
     buttonInit.SetActive(false);
 }
コード例 #2
0
    /// <summary>
    /// 2. ConnectAmond
    /// </summary>
    public void ConnectAmond()
    {
        GameScoreDto result = AmondPlugin.GetInstance().ConnectAmond();

        textResult.text = "2. ConnectAmond: " + result;
        buttonConnectAmond.SetActive(false);
        buttonStartWatchAd.SetActive(true);
        buttonLeaderBoard.SetActive(true);
    }
コード例 #3
0
    private static void CheckAvailable(string value)
    {
        Sample sample = GameObject.Find("AdmondPlugin").GetComponent <Sample>();

        if (!AmondPlugin.GetInstance().Available)
        {
            return;
        }

        sample.textResult.text = "Connect Amond is available";
        // Connect Amond
        sample.ConnectAmond();
    }
コード例 #4
0
    /// <summary>
    /// 4. EndWatchingAd
    /// </summary>
    public void EndWatchingAd()
    {
        bool result = AmondPlugin.GetInstance().EndWatchingAd();

        if (result)
        {
            textResult.text = "4. EndWatchingAd: Success";
            buttonEndWatchAd.SetActive(false);
            buttonStartGame.SetActive(true);
        }
        else
        {
            textResult.text = "Failed EndWatchingAd()";
        }
    }
コード例 #5
0
    /// <summary>
    /// 3. StartWatchingAd
    /// </summary>
    public void StartWatchingAd()
    {
        bool result = AmondPlugin.GetInstance().StartWatchingAd(AdType.GameItem);

        if (result)
        {
            textResult.text = "3. StartWatchingAd: Success";
            buttonStartWatchAd.SetActive(false);
            buttonEndWatchAd.SetActive(true);
        }
        else
        {
            textResult.text = "Failed StartWatchingAd()";
        }
    }
コード例 #6
0
    /// <summary>
    /// 5. StartGame
    /// </summary>
    public void StartGame()
    {
        bool result = AmondPlugin.GetInstance().StartGame();

        if (result)
        {
            textResult.text = "5. StartGame: Success";
            buttonStartGame.SetActive(false);
            inputScore.SetActive(true);
            buttonEndGame.SetActive(true);
            _inputScoreField = inputScore.GetComponent <InputField>();
            _inputScoreField.Select();
        }
        else
        {
            textResult.text = "Failed StartGame()";
        }
    }
コード例 #7
0
    /// <summary>
    /// 6. EndGame
    /// </summary>
    public void EndGame()
    {
        if (_inputScoreField.text == "")
        {
            _inputScoreField.text = "1004";
        }
        int score = int.Parse(_inputScoreField.text);

        GameScoreDto result = AmondPlugin.GetInstance().EndGame(score);

        if (result != null)
        {
            textResult.text = "6. Rank: " + result.rank +
                              "\n Best score: " + result.score;
            inputScore.SetActive(false);
            buttonEndGame.SetActive(false);

            buttonStartWatchAd.SetActive(true);
        }
        else
        {
            textResult.text = "Failed EndGame()";
        }
    }
コード例 #8
0
 /// <summary>
 /// 7. OpenLeaderBoard
 /// </summary>
 public void OpenLeaderBoard()
 {
     AmondPlugin.GetInstance().OpenLeaderBoard();
 }