コード例 #1
0
 public void OnActionGraphActivation()
 {
     if (internalState == RewardState.READY_TO_ACTIVATE)
     {
         Service.Get <iOSHapticFeedback>().TriggerImpactFeedback(iOSHapticFeedback.ImpactFeedbackStyle.Medium);
         int num = CoinRewardableDefinition.Coins(RewardDef);
         List <CollectibleRewardDefinition> definitions = RewardDef.GetDefinitions <CollectibleRewardDefinition>();
         if (num > 0 && definitions.Count > 0)
         {
             string collectibleType = definitions[0].Collectible.CollectibleType;
             int    num2            = num;
             Service.Get <ICPSwrveService>().CoinsGiven(num2, "picked_up", collectibleType);
         }
         setPickedUp();
         sendQuestEvent();
     }
 }
コード例 #2
0
    private void giveReward()
    {
        List <MascotXPRewardDefinition> definitions = RewardDef.GetDefinitions <MascotXPRewardDefinition>();

        if (definitions.Count > 0 && definitions[0].XP > 0)
        {
            Reward reward = RewardDef.ToReward();
            dispatcher.DispatchEvent(new RewardServiceEvents.MyRewardEarned(RewardSource.WORLD_OBJECT, base.gameObject.GetPath(), reward));
        }
        int num = CoinRewardableDefinition.Coins(RewardDef);
        List <CollectibleRewardDefinition> definitions2 = RewardDef.GetDefinitions <CollectibleRewardDefinition>();

        if (num > 0 && definitions2.Count > 0)
        {
            Service.Get <ICPSwrveService>().CoinsGiven(num, "pickupable", definitions2[0].Collectible.CollectibleType);
            Service.Get <CPDataEntityCollection>().GetComponent <CoinsData>(Service.Get <CPDataEntityCollection>().LocalPlayerHandle).AddCoins(num);
            dispatcher.DispatchEvent(new InteractablesEvents.InWorldItemCollected(definitions2[0].Collectible.CollectibleType, num));
        }
    }