示例#1
0
        void COLLISIONDET()
        {
            if (nodegraph != null)
            {
                if (IS_KINEMATIC)
                {
                    CurrentNode = CheckNode(transform.position + offsetCOL);
                    // s_gui.AddText(nodeg.PosToVec(new Vector2( positioninworld.x + collision.size.x / 2,  positioninworld.y + collision.size.y / 2)).ToString());

                    if (CurrentNode != null)
                    {
                        NodeCollisionResponse(CurrentNode);
                    }
                }
            }

            /*
             * if (xvel != 0 || yvel != 0)
             * {
             *  velocity += new Vector2(xvel, 0);
             *  velocity += new Vector2(0, yvel);
             * }
             */
            /*
             * o_bullet b = GetBullet(collision);
             * if (b != null)
             * {
             *  if (damage_timer <= 0)
             *  {
             *      b.OnImpact(this);
             *  }
             * }
             */
        }
示例#2
0
        public s_node CheckNode(Vector2 v)
        {
            if (nodegraph == null)
            {
                return(null);
            }
            s_node no = nodegraph.PosToNode(v);

            if (no == null)
            {
                return(null);
            }
            else
            {
                return(no);
            }
        }
示例#3
0
 void NodeCollisionResponse(s_node nod)
 {
 }