Reward 조건 달성시 보상

Namespace: Matrix.Component
Assembly: MatrixGames (in MatrixGames.dll)

void GiveEventReward( 
string eventType
string eventData
int heart
Callback<GiveEventRewardResponse> cb 
)
This language is not supported or no code example is available.

Parameters

eventType

Type: string

응모하는 이벤트 타입

eventData

Type: string

달성한 보상 조건. ex)친구초대이벤트일때는 friendID.

heart

Type: int

유저의 heart 갯수. 친구초대시 뼈다귀 1개 주기 위함.

cb

Type: Callback<GiveEventRewardResponse>

Return Value

  • On Successful -

    cb.result: 0.

    cb.cause: "OK"

    cb.response: Response Data GiveEventRewardResponse

  • On Error -

    cb.result: 0가 아닌 integer 값

    cb.cause: 상세 에러 메세지

Reward 조건 달성시 보상하는 Method.
	
  using UnityEngine;
  using System;
  using System.Collections;
  using System.Collections.Generic;
  using Matrix;
 
  static void onRewardGiveEventRewardTest(Matrix.CallbackInfo<Matrix.Domain.Reward.GiveEventRewardResponse> info)
  {
      Debug.Log("onRewardGiveEventRewardTest Called");
      Debug.Log("result: " + info.result);
 
      if (info.result == 0)
      {
          string message = info.response.StructToJson();
 
          Debug.Log(message);
      }
  }
 
  static void RewardGiveEventRewardTest()
  {
      IMatrix API = MatrixManager.Instance;
      Debug.Log("[RewardGiveEventRewardTest]");
 
      API.Reward.GiveEventReward("InviteFriendEventReward", "89770867213013984", 5, onRewardGiveEventRewardTest);
  }
 					

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0

XNA Framework

Supported in: 3.0, 2.0, 1.0