Beispiel #1
0
        private void GetDestination()
        {
            points.Clear();
            DebugManager dm = (DebugManager)target;

            if (dm.RectObj == null)
            {
                return;
            }
            int dx = 0, dy = 0;

            if (dm.RectObj != null)
            {
                dx = (int)(dm.RectObj.Position.x + dm.RectObj.Velocity.x * dm.RectObj.Delta);
                dy = (int)(dm.RectObj.Position.y + dm.RectObj.Velocity.y * dm.RectObj.Delta);
            }
            Debug.Log(dm.RectObj.Delta);
            Debug.Log(dm.RectObj.Velocity.y * dm.RectObj.Delta);
            Debug.Log(dm.RectObj);
            points.Add(new Vector2Int(dx, dy));
            Debug.Log(dx + ", " + dy);
        }
Beispiel #2
0
        private void GetCollisionNodes()
        {
            DebugManager dm = (DebugManager)target;

            if (!dm.RectObj)
            {
                return;
            }

            points.Clear();
            collisions.Clear();

            Vector2 pos  = dm.RectObj.Position;
            Vector2 vel  = dm.RectObj.Velocity * dm.RectObj.Delta;
            Vector2 dest = dm.RectObj.Position + vel;
            string  info = "";

            Vector2Int[] colNodes = Collision.GetCollisionNodes(pos, dest, ref info);
            foreach (var colN in colNodes)
            {
                Debug.Log(colN);
                collisions.Add(colN);
            }
        }