コード例 #1
0
        Vector2 random_point(cleaner_hand hand)
        {
            Vector2 bottom = bottom_point(hand);
            Vector2 offset = new Vector2(Random.Range(-move_delta.x, move_delta.x), Random.Range(0f, move_delta.y));

            return(bottom + offset);
        }
コード例 #2
0
        Vector2 bottom_point(cleaner_hand hand, bool farest = false)
        {
            var  gun_pos = hand.gun_position;
            bool b       = (gun_pos - bottom_left).sqrMagnitude < (gun_pos - bottom_right).sqrMagnitude;

            if (farest)
            {
                b = !b;
            }
            return(b ? bottom_left : bottom_right);
        }
コード例 #3
0
        Vector2 direction2indruder(cleaner_hand hand)
        {
            var gun_pos = hand.gun_position;

            return((xf_intruder.position.vec2() - gun_pos).normalized);
        }