Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using TenPN.DecisionFlex;
- using System;
- public class CustomSingleContextFactory : SingleContextFactory
- {
- public override IContext SingleContext(Logging loggingSetting)
- {
- ContextDictionary masterContext = new ContextDictionary();
- float distToPlayer = Player.DistanceTo(transform.root.position);
- masterContext.SetContext("PlayerPosition", Player.position);
- masterContext.SetContext("DistanceToPlayer", distToPlayer);
- if(loggingSetting == Logging.Enabled)
- {
- //Debug.Log("My distance to the player: " + distToPlayer);
- }
- return masterContext;
- }
- }
Add Comment
Please, Sign In to add comment