/// <summary>
 /// Sets the parameter for the behaviour. This specific overload of the function is used for wandering and patrolling
 /// </summary>
 /// <param name="target"></param> The gameobject reference of the moving target
 public void SetParameters(TargetSetter targetSetter, float speed, string behaviourName = "", UnityEvent behaviourEvent = null)
 {
     m_targetSetter   = targetSetter;
     m_isMovingTarget = false;
     m_behaviourName  = behaviourName;
     m_speed          = speed;
     m_behaviourEvent = behaviourEvent;
 }
示例#2
0
        private void Awake()
        {
            _unitMover = new UnitMover(transform, GetComponent <Rigidbody>());

            _unitAttacker = GetComponent <UnitAttacker>();

            _targetSetter = new TargetSetter(transform);

            _navMeshAgent = GetComponent <NavMeshAgent>();
        }
示例#3
0
 public static void SaveConfiguration(List <string> configs)
 {
     TargetSetter.Open(CONFIG_FILE);
     try
     {
         TargetSetter.GenerateFile(configs);
     }
     finally
     {
         TargetSetter.Close();
     }
 }
示例#4
0
        private static void ProcessATarget(string target, List <string> parms)
        {
            string siteId      = ListParser.Get("SITE-ID=", parms);
            string serviceUrl  = ListParser.Get("SERVICE-URL=", parms);
            string servicePort = ListParser.Get("SERVICE-PORT=", parms);
            string crmUrl      = ListParser.Get("CRM-URL=", parms);
            string crmPort     = ListParser.Get("CRM-PORT=", parms);

            TargetSetter.Open(target);
            try
            {
                TargetSetter.Replace(BuildUrl(serviceUrl, servicePort, "0"), BuildUrl(serviceUrl, servicePort, siteId));
                TargetSetter.Replace(BuildUrl(crmUrl, crmPort, "0"), BuildUrl(crmUrl, crmPort, siteId));
            }
            finally
            {
                TargetSetter.Close();
            }
        }