public void StateHandler() { CustomDebug.Log(PlayerState); switch (_state) { case State.Moving: { Move(); break; } } }
private void FindObjects() { var wayPointBehaviours = FindObjectsOfType <WayPointBehaviour>(); for (int i = 0; i < wayPointBehaviours.Length; i++) { // if wayPointBehaviours[i].GetRouteData() != _routeData} delete } // sort wayPointBehaviours[i].numOfWayPoint _routeData.SetWayPoints(wayPointBehaviours); CustomDebug.Log("Scanned for: " + wayPointBehaviours.Length + " objects"); }
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; }
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); }
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); } }
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; } }