public void Initialize()
        {
            var resources = Resources.Load <EnemyBehaviour>(AssetsPathGameObject.Object[GameObjectType.Enemy]);

            var enemyObject = Object.Instantiate(resources, Vector3.zero, Quaternion.identity);

            _context.Enemy = enemyObject;
            CustomDebug.Log(_context.Enemy);
            CustomDebug.Log(_context.Enemy.RouteData);
            CustomDebug.Log(_context.Enemy.RouteData.GetWayPoints());
            var wayPoint = _context.Enemy.RouteData.GetWayPoints()[0];

            enemyObject.transform.position = wayPoint;
        }
Пример #2
0
        private T GetInteractableObject <T>(InteractableObjectType type) where T : class
        {
            var interactableObjects = _context.GetTriggers(type);
            T   behaviour           = default;

            foreach (var trigger in interactableObjects)
            {
                if (trigger.IsInteractable)
                {
                    CustomDebug.Log(trigger.Description);
                }
            }

            return(behaviour);
        }
Пример #3
0
 public void Awake()
 {
     if (ItemSlots != null)
     {
         for (int i = 0; i < ItemSlots.Count; i++)
         {
             ItemSlots[i].OnBeginDragEvent    += BeginDrag;
             ItemSlots[i].OnEndDragEvent      += EndDrag;
             ItemSlots[i].OnDragEvent         += Drag;
             ItemSlots[i].OnDropEvent         += Drop;
             ItemSlots[i].OnPointerEnterEvent += ShowTooltip;
             ItemSlots[i].OnPointerExitEvent  += HideTooltip;
         }
         CustomDebug.Log(ItemSlots.Count);
     }
 }
Пример #4
0
 private void Update()
 {
     if (_isScanScene)
     {
         var wayPointBehaviours = FindObjectsOfType <WayPointBehaviour>();
         List <WayPointBehaviour> listWayPointBehaviours = new List <WayPointBehaviour>();
         CustomDebug.Log(wayPointBehaviours.Length);
         for (int i = 0; i < wayPointBehaviours.Length; i++)
         {
             if (wayPointBehaviours[i]._routeData == _routeData)
             {
                 listWayPointBehaviours.Add(wayPointBehaviours[i]);
             }
         }
         CustomDebug.Log(listWayPointBehaviours.Count);
         listWayPointBehaviours.Sort();
         _routeData.SetWayPoints(listWayPointBehaviours.ToArray());
         CustomDebug.Log("Scanned for: " + wayPointBehaviours.Length + " objects");
         _isScanScene = false;
     }
 }